[Closed] InstanceMgr.MakeObjectsUnique doesn't quite work
Here’s a new brain teaser. So In max 2008 (or possibly max9, I don’t have it to check) they added the ability to use the instancemgr to make a modifier unique. So I wrote a little code to test it, and while it does make the modifiers unique, once I’ve done that task, I still can’t seem t make the base object unique. Try this…
s1 = sphere pos:[0,0,0]
s2 = instance s1
s2.pos = [50,0,0]
s3 = instance s2
s2.pos = [100,0,0]
select #(s1,s2,s3)
modPanel.addModToSelection (meshsmooth ())
select s1
modPanel.addModToSelection (bend ())
select #(s1,s2,s3)
modPanel.addModToSelection (uvwmap ())
select s1
for m in $.modifiers do
(
if (InstanceMgr.CanMakeModifiersUnique $ m) == true then InstanceMgr.MakeModifiersUnique $ m #individual
)
InstanceMgr.MakeObjectsUnique $ #individual
So now all the modifiers on my selected sphere are unique, but that last command still didn’t make the base object unique. Is the command broken, or am I doing something weird?
- Neil
I don’t think you’re doing anything weird. Maybe the method doesn’t work with referenced nodes? In the meantime you could try $.baseObject = copy $.baseObject. I think that should do what you’re after.
Martijn
Actually, I stopped using that technique because it changes too many things. Like if the object is part of a selectionset, copying it will remove it from the selection set. Or if the object is part of a group, it removes it from the group. The InstanceMgr retains all that info because it’s not copying the mesh, it’s changing the original mesh. Looks like a bug
- Neil
$.baseObject = copy $.baseObject only creates a copy of the baseObject of the node, so this shouldn’t affect the node itself (nor any properties, hierarchies ect). It’s like copying/pasting base objects in the trackview.
Martijn