View Full Version : Nurbs curves
Once you have created a whole heap of nurbs curves as control objects for a rig, is it possible to select all of the curves in a scene regardless of their names using mel ?
Ayjay.
:thumbsup:
|
|
zachgrachan
10-05-2003, 03:31 PM
I could swear it should be an easy flag in ls. But I haven't been able to figure it out. I ended up using nameing conventions to make it easier (ie. just add xx to the end of every one). If you do figure it out, please let me know...
mhovland
10-05-2003, 04:04 PM
You can use:
string $nurbsCuves[] = `ls -type "nurbsCurve"`;
to get all the shape nodes associated with the nurbsCurves. Then it is a simple walk through relatives to find the transform nodes.
Here is an example, mangle it as you need for your application:
{
string $nurbsCurves[] = `ls -type "nurbsCurve"`;
string $nurbsCurveTransforms[];
for($i = 0; $i<size($nurbsCurves);$i++)
{
string $hold[] = `listRelatives -parent $nurbsCurves[$i]`;
$nurbsCurveTransforms[$i] = $hold[0];
}
print $nurbsCurveTransforms;
}
Hope this helps.
zachgrachan
10-05-2003, 06:28 PM
is there a list of the types anywhere? when I use -showType, everything is a transform, so I can't figure out what to use as the type strings for various types of surfaces.
Thanks very much for your help guys !
Here it is, the final script to select all curves regardless of name.
string $nurbsCurves[] =`ls -type "nurbsCurve"`;
select $nurbsCurves;
Thanks again for your help.
Ayjay.
:thumbsup:
mhovland
10-06-2003, 02:43 PM
Originally posted by zachgrachan
is there a list of the types anywhere? when I use -showType, everything is a transform, so I can't figure out what to use as the type strings for various types of surfaces.
That is because of the way Maya works internally. You need to pass in the shapeNode to use -showType. All the top nodes are transforms, the shapeNode is where the type is defined.
zachgrachan
10-06-2003, 04:54 PM
so then it would be
ls -sl -shapes -showtype;
yes?
playmesumch00ns
10-07-2003, 10:41 PM
You can also do it using the nodeType function with the name of an object's shape node.
e.g:
nodeType curveShape1
would return:
nurbsCurve
CGTalk Moderation
01-16-2006, 06:00 AM
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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.