I created a MAXScript to automatizate the process Ive been doing manually for 5hours already and the script works. Problem is it erases the AuroraTrimesh modifier on the update.
How can I avoid that?
I created a MAXScript to automatizate the process Ive been doing manually for 5hours already and the script works. Problem is it erases the AuroraTrimesh modifier on the update.
How can I avoid that?
If you want to post your script somewhere I can take a look at it and see if I can figure something out for you.
[EDIT]After thinking about it. Sounds like whatever your script is doing is collapsing the the stack. What you could do is copy any modifiers at the beginning of your script and the re-apply the copied modifiers at the end of your script.
![]()
MDA
for obj in selection do --loop through all objects selected ( if canConvertTo obj Mesh then --has Editable Mesh modifier ( convertToMesh obj --collapse to EditableMesh for v = 1 to getNumVerts obj do --loop through all vertices ( vert = getVert obj v --get the v-th vertex vert.z = vert.z+20; setVert obj v vert --assign back to the v-thvertex ) update obj --update the mesh ) )
the code is from the MAXScript reference with minor modifications, but tried googling already and didnt found other way to do this neither how could I save modifiers and restore after this operation
for obj in selection do -- loop through all objects selected ( if canConvertTo obj Mesh then -- has Editable Mesh modifier ( -- -- Copy node -- local copy_of_meshnode = copy obj local modifier_count = (obj.modifiers).count convertToMesh obj -- collapse to EditableMesh for v = 1 to getNumVerts obj do -- loop through all vertices ( vert = getVert obj v -- get the v-th vertex vert.z = vert.z + 20 setVert obj v vert -- assign back to the v-thvertex ) update obj -- update the mesh -- -- Copy modifiers from node copy to original collapsed node -- if (modifier_count != 0) then ( for i = modifier_count to 1 by -1 do ( addmodifier obj copy_of_meshnode.modifiers[i] ) ) -- -- Delete the copy -- delete copy_of_meshnode ) )
Try that.
![]()
MDA
this appears to work without any issue, tyvm MDA!