Hi,
I tried to make a script to "Freeze" some objects:
I have spline object with subdivide, tyconform,.. in the stack, so to remove the need max calculate these objects, I do :
- create a snapshot of the object
- deactivate all modifiers
- add editpoly modifier
- remove all geometry in the modifier
- attach snapshot to the geometry.
It works fine for one object.( and I did a script to revert to "normal" geometry )
But when I use this script on multiple selection I got error.
"-- Runtime error: Requested sub-object level out of range: 1"
Anybody could help ? Thanks
(
for o in selection where o.modifiers.count > 0 do
(
theTMesh = snapshotAsMesh o
theNewMesh = Editable_mesh()
theNewMesh.mesh = theTMesh
convertTo theNewMesh Editable_Poly
delete theTMesh
o.modifiers.enabled = off
cep = edit_poly()
addModifier o cep
max modify mode -- !!!
subobjectLevel = 1
max select all
o.modifiers[#Edit_Poly].ButtonOp #DeleteVertex
o.modifiers[#Edit_Poly].attach theNewMesh
subobjectLevel = 0
cep.name = "FREEZED"
)
)
miauu · 2021-11-24