CGTalk > Software > Autodesk Maya > Maya Programming
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 11-29-2012, 11:45 PM   #1
Neilman
Scout
portfolio
Neil
Toronto, Canada
 
Join Date: Apr 2012
Posts: 31
duplicate question

Is there a way to duplicate just the geometry of an object? For example, here is the hierarchy of an object I wish to duplicate, but I don't want the parentConstraint to get duplicted with it. I just want the transform and the shape node.

pSphere
-pSphereShape
-pSphere_parentConstraint

Is there a direct way to duplicate pSphere along with pSphereShape without manually deleting whatever other children are contained inside the transform? I just want the raw mesh to be duplicated.
 
Old 11-30-2012, 12:43 AM   #2
Nyro
Lurking
 
Nyro's Avatar
portfolio
A. D.
Vertex Slinger
Munich, Germany
 
Join Date: Dec 2006
Posts: 1,436
From what I can tell: no.

There is a way to duplicate just the top-level DAG node without any of its children, including the shape node. This, unfortunately, leaves you with an empty transform.

Via scripting you could determine the transform node and its (child) shapenodes and duplicate those individually, then reconnect them.
 
Old 11-30-2012, 04:02 PM   #3
Nyro
Lurking
 
Nyro's Avatar
portfolio
A. D.
Vertex Slinger
Munich, Germany
 
Join Date: Dec 2006
Posts: 1,436
I went back over this and tried to script it myself.

As suspected, there really is no way to utilze the duplicate command on any transform node to create a non-instanced duplicate of it that has a unique duplicated shapenode and no instanced inputconnections.

However, it turns out that if you duplicate a shapeNode instead of a transform node, you get exactly what you want: a new transform and a new shapenode.
It's then a matter of simply deleting everything but the transform node from the resulting list of duplicated nodes:

Code:
$tNode = `ls -sl -as`; $s = size($tNode); if($s == 0) { print "Nothing selected"; } else if ($s > 1) { print "Too many nodes selected"; } else { $transform = $tNode[0]; $shapes = `ls -dag -type "shape" $transform`; $dNodes = `duplicate -rc $shapes`; for($i = 1; $i < size($dNodes); $i++) { delete $dNodes[$i]; } }


I haven't been able to test this on a transform that has more than 1 shapeNodes connected to it, so I have no idea what exactly happens in that situation
 
Old 11-30-2012, 04:02 PM   #4
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,480
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 06:56 PM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.