ScriptSpot is a diverse online community of artists and developers who come together to find and share scripts that empower their creativity with 3ds Max. Our users come from all parts of the world and work in everything from visual effects to gaming, architecture, students or hobbyists.
not if next line after "add modifier" is "collapse to Edit_Poly"...
- because all instances of "o" will be collapsed to Edit_poly too...
- that's mean they will be skipped later by ".. where classof o == Editable_mesh do ..."
of course this don't work if you "--" turn off collapse line, do you agree ?
About your code:
- it should be "appendifunique" otherwise same object will be collected multiple times (so "--add something here...." will be also repeated few times on the same object)
- "if firstOnly.count > 1 do" it will collects only instanced objects
- what about other selected objects which don't have any instance ?
(qestion was about convert "all objects" to EditPoly but keep instances)
- why "firstOnly[firstOnly.count-1]" not just firstOnly[1] ?
I think your code should look this way:
firstInstances = #()for o in selectiondo(
InstanceMgr.GetInstances o &Arr
if Arr.count > 1 then
appendifunique firstInstances Arr[1]else
appendifunique firstInstances o
)--print firstInstances if firstInstances.count != 0 do--add something here....
or even:
firstInstances = #()for o in selectiondo(
InstanceMgr.GetInstances o &Arr
appendifunique firstInstances Arr[1])--print firstInstances if firstInstances.count != 0 do--add something here....
if its intance we just need the first node only...say bout using InstanceMgr.GetInstances...
firstInstances = #()for o in selectiondo(
InstanceMgr.GetInstances o &firstOnly
if firstOnly.count > 1 do
append firstInstances firstOnly[firstOnly.count-1])if firstInstances.count != 0 do--add something here....
if object added modifer while the object itself is intance then if it added more than two modifier it'll result to add modifer 2xobject in selection count per object...
say something like this
for o in selection where classof o == Editable_mesh do(
addmodifier o (Poly_Select())
addmodifier o (Cloth())--maxOps.CollapseNodeTo o 1 off)
Comments
`
Hi Fajar,
not if next line after "add modifier" is "collapse to Edit_Poly"...
- because all instances of "o" will be collapsed to Edit_poly too...
- that's mean they will be skipped later by ".. where classof o == Editable_mesh do ..."
of course this don't work if you "--" turn off collapse line, do you agree ?
About your code:
- it should be "appendifunique" otherwise same object will be collected multiple times (so "--add something here...." will be also repeated few times on the same object)
- "if firstOnly.count > 1 do" it will collects only instanced objects
- what about other selected objects which don't have any instance ?
(qestion was about convert "all objects" to EditPoly but keep instances)
- why "firstOnly[firstOnly.count-1]" not just firstOnly[1] ?
I think your code should look this way:
or even:
what do you think ?
if its intance we just need
if its intance we just need the first node only...say bout using InstanceMgr.GetInstances...
if object added modifer while the object itself is intance then if it added more than two modifier it'll result to add modifer 2xobject in selection count per object...
say something like this
`
try this:
for selected objects only:
for whole scene:
cheers,
Pixamoon
Thank you very much. Works
Thank you very much. Works great