run script on selection
Hi
I am stuck on probably a simple part of my script.
I have the main body of it working perfectly, on a per object basis, but don't know the string to make it work on a selection.
e.g. When I select 1 object (a simple plane) and evaluate the script, it does as expected. But when I select more than one such object (all copies of the same plane) and try to evaluate it, it fails. How can I make it run on more than one object? Many thanks!
Here's the script:
macros.run "Modifiers" "EditPolyMod"
subobjectLevel = 2
$.modifiers[#Edit_Poly].SetSelection #Edge #{}
$.modifiers[#Edit_Poly].Select #Edge #{1, 3}
$.modifiers[#Edit_Poly].SetOperation #ConnectEdges
$.modifiers[#Edit_Poly].connectEdgeSegments = 2
$.modifiers[#Edit_Poly].connectEdgePinch = random 1 100
$.modifiers[#Edit_Poly].connectEdgeSlide = random -50 50
$.modifiers[#Edit_Poly].Commit ()
subobjectLevel = 4
$.modifiers[#Edit_Poly].SetSelection #Face #{}
$.modifiers[#Edit_Poly].Select #Face #{1}
actionMan.executeAction 0 "40020" -- Edit: Delete Objects
max delete
$.modifiers[#Edit_Poly].ButtonOp #DeleteFace
subobjectLevel = 0
Comments
Many thanks Swordslayer !
Many thanks Swordslayer !
Some of my scripts and MCGs :: 3ds Max SDK Intro for Scripters