I need to create two arrays and populate one with all the body objects in the scene and another with all the editable meshes in the scene. Any clues, i'm new to max script.
Thanks
Forum topic · General Scripting
By 3di · 2018-01-31
I need to create two arrays and populate one with all the body objects in the scene and another with all the editable meshes in the scene. Any clues, i'm new to max script.
Thanks
sorted
3di · 2018-02-02
Don't worry, sorted.
macroScript 3diFixCad
category:“3diTools”
toolTip:“FixCAd”
(
undo off
(
WM_SETREDRAW=0xB
windows.sendmessage (windows.getmaxhwnd()) WM_SETREDRAW 0 0
)
fn FixMesh i = (
FixAll = xform name:“3diXform”
addModifier i FixAll
AddMesh = edit_mesh name:“3diEditMesh”
addModifier i AddMesh
select i
maxOps.CollapseNodeTo $ 1 off
)
fn FixBody i = (
poly2 = Edit_Poly name:“3diEditPoly”
addModifier i poly2
)
SelectionArr = selection as array
Count = 0
for i in SelectionArr do(
CurrentTypeOfObject = classof i.baseobject
Count = Count +1
print (“item ” + Count as string)
case CurrentTypeOfObject of
(
Body_Object: FixBody(i)
Editable_Mesh: FixMesh(i)
)
)
(
WM_SETREDRAW=0xB
windows.sendmessage (windows.getmaxhwnd()) WM_SETREDRAW 1 0
)
)