#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)

Larry, the gpu temps could not be a good indicator[…]

It does run very well. Can’t see any particu[…]

Hi there Just trying here as I had no luck in the[…]

Hi CDRDA, Thanks for checking on this. I haven't […]