#401230
I'm trying to remove the material from the scene, the code just doesn't work whatever use "free()" or "extract()", anyone can give me some tip?

scene = Cmaxwell(mwcallback_cb)
scene.readMXS(mxsFile)
material= CmaxwellMaterialIterator()
mat = material.first(scene)
while not mat.isNull():
mat.free()
mat = material.next()
scene.writeMXS(mxsFile)
User avatar
By Brany
#401235
I'm afraid you cannot delete a material from the scene and keep using the material interator. Try to store the materials you want to delete in a list, and then delete each one:
Code: Select all
scene = Cmaxwell(mwcallback_cb)
scene.readMXS(mxsFile)
material= CmaxwellMaterialIterator()
mat = material.first(scene)
matlist = []
while not mat.isNull():
    matlist.append(mat)
    mat = material.next()
for m in matlist:
    mat.free()
scene.writeMXS(mxsFile)

...and 3 Days later, 82.528 Views !!! ...NL, every[…]

Hello dear customers, We have just released a new[…]

grass generator extension

Just downloaded MWR5 for Rhino 6 and want to use g[…]

Hello everyone, I have a new bug with the latest M[…]