PDA

View Full Version : curveShape naming frustrations...


stowaway0
10-07-2008, 03:06 PM
When you create most anything in Maya: primitives, nurbs prims, etc, using the "-n" flag - you name both the transform and the Shape. But when I create a curve with something like the following

curve -n ($ctrlName+"_line1") -d 1 -p -1 0 0 -p -0.33 1 0 -k 0 -k 1 ;

Maya does not name the Shape below it. This means I have to follow that with

rename curveShape1 ($ctrlName+"_line1"+$s);

Does anyone know how to name the child Shape during creation? Is there a special flag for this in the curve command? I can't seem to find it in the command reference. Or if you have another stable work-around that would also be great.

The obvious issue with my approach is that if I have any other unnamed curveShapes floating around in my scene the whole script is broken.

Can't tell you how much headache this will save me, so thanks in advance!

nelsonteixeira
10-07-2008, 06:31 PM
I would do like this:

$ctrlName = "myCurve";

$curve = `curve -n ($ctrlName+"_line1") -d 1 -p -1 0 0 -p -0.33 1 0 -k 0 -k 1`;

rename (`listRelatives -s $curve`) ($curve + "Shape");

Not the Maya convention ending on a number. But this would require an extra step.

Nayway... my 10 cents.

NaughtyNathan
10-08-2008, 09:02 AM
this is far easier:

string $curve = `curve -d 1 -p -1 0 0 -p -0.33 1 0 -k 0 -k 1`;
rename $curve ($ctrlName+"_line1") ;

:nathaN

stowaway0
10-08-2008, 04:15 PM
Thank you both very much, this helps. Any idea why Maya names other shapes with the -n flag but not curveShapes? Is there some benefit to this, or just an oversight in the code?

NaughtyNathan
10-08-2008, 04:22 PM
my guess is it's one of many such oversights in the code... :(

CGTalk Moderation
10-08-2008, 04:22 PM
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.