Clone Options (Instance Controllers)
I'm trying to write a code that does the equivelant of selecting and object and pressing Ctrl+V. Which brings up the Clone Options dialog.
I want to copy a selection of objects with the option of either copying or instancing the controllers of any possible objects.
In the max help I came across a few things and this was the closest which still did not have the option of the controllers.
maxOps.CloneNodes <&node array>nodes offset: expandHierarchy: cloneType: actualNodeList: newNodes:
I'm ultimately trying to copy a rig. My example scene consists of 3 spheres all just linked one to another so Sphere01 > Sphere02 > Sphere03.
Selecting all of them and then copying the rig with instanced controllers
function selectHierarchy = --//Selects both children/parents of obj's heirarchy ( for obj in selection do ( if obj.children != undefined do ( selectmore obj.children ) ) ) for obj in selection do ( CON = selection[1] selectHierarchy() newObj = copy obj newController = obj.controller newObj.controller = newController )
Comments
so is there an easy way to
so is there an easy way to retain the skinning of the newly copied object along with the controllers
John Martini
Digital Artist
http://www.JokerMartini.com (new site)
I think its going to take a
I think its going to take a little more work than i expected.
With the initial copy (as seen in the attached image)
it retains hierarchy a skinny properties of the newly created copy.
Where as the copy method does not do that.....bummer
I've got it to retain hierarchy and whatnot but not the skinning.
This is what I've got so far.
John Martini
Digital Artist
http://www.JokerMartini.com (new site)
Hi John
Where is the problem with instance() function or maxOps.CloneNodes() function? As your clone type is #instance, your controllers will be instanced.
my recent MAXScripts RSS (archive here)
It results in allowing the
It results in allowing the meshes or spline shapes to be copies but their controllers to be instances of each other.
So if I rotate the spline shape the one i copied it from also rotates.
John Martini
Digital Artist
http://www.JokerMartini.com (new site)
Image
Image attached to show what I'm after settings wise.
John Martini
Digital Artist
http://www.JokerMartini.com (new site)
i see...
so, you wish to instance transform controllers, its easy:
$Obj1.controller = $Obj2.controller
, but that will instancing whole transform (pos/rot/scale) tracks. If this is the case, you can do this step after cloning process -selection.controller = selection[1].controller
, but if you whant to instancing to say just rotation tracks, then should supply more options to your tool. Ah, and if you do this, the process w'd a bit different 'cause subAnims are not mapped, for ex.:theTrack = selection[1][3][2].controller; for obj in selection do obj[3][2].controller = theTrack
hope this help
my recent MAXScripts RSS (archive here)
Yeah this definitely helps.
Yeah this definitely helps. It makes complete sense. I will start compiling things together and see what I come up with here.
Thanks Anubis for the explanation and help on this.
John Martini
Digital Artist
http://www.JokerMartini.com (new site)