Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Maya® / MEL / Duplicate object without duplicating children?
  RSS 2.0 ATOM  

Duplicate object without duplicating children?
Rate this thread
 
49105
 
Permlink of this thread  
avatar
  • MRAnim8or
  • Posted: 04 November 2010 07:37 AM
  • Total Posts: 36
  • Joined: 25 May 2010 08:59 PM

Does anyone know of a way I can duplicate a control object (its a nurbs curve, if that matters) in my rig without duplicating everything below it?  Our rigs are pretty complex, so duplicating and deleting the unneeded stuff isn’t really desirable, if there’s a way around it.

I’m trying to write a function that does this, but so far no luck.



Replies: 0
avatar
  • THNKR
  • Posted: 04 November 2010 02:19 PM

I would not have a control object that has children in a rig. I’d use constraints, not parenting. But anyway, if you need to duplicate an object without duplicating the children, select the transform and instance the shape node immediately below it. Now you have an instance, so duplicate that and then delete the instance.

string $shapes[] = `listRelatives -s`;
string $tmp[] = `instance $shapes[0]`;
duplicate $tmp;
delete $tmp;

if you don’t care that it’s an instance, and you probably don’t, since the control objects would all have the same shape anyway, the command is simply

instance `listRelatives -s`;


Replies: 0
avatar
  • MRAnim8or
  • Posted: 05 November 2010 06:04 AM

Thanks!



Replies: 0