ScriptSpot home

Forum topic · General Scripting

copy object hierarchies/controllers/userProperties e.g. like an object "deepCopy"

By br0t · 2011-06-28

Description

Hi,

If I shift-drag a selection of objects in the 3ds Max viewport, I create a copy of them that have the same animation controllers, user properties, linked hierarchy etc.

If I copy those objects with Maxscript, they are disconnected and most stuff is not copied. Is there a way to do this easily, like a "deepCopy" for objects? Or do I have to buffer and reapply all that stuff?

Cheers

Comments (4)
br0t

Sweet, that was it! No collecting hierarchy, no buffering userProps and controllers, thanks Anubis. In fact that made 1 line out of my 24 lines of code

Reply to br0t
br0t

those are not needed or are

those node array lists are not needed or are they? what are they typically used for?

edit: ah nevermind, the maxOps just returns "OK" so i need the node list to access my copied objects, right :D?

Panayot Karabakalov

maxOps.CloneNodes ?

maybe

maxOps.CloneNodes

can help?...

maxOps.CloneNodes $Header offset:[0,130,0] expandHierarchy:on cloneType:#copy actualNodeList:&anl newNodes:&nnl