selecting shape nodes

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  03 March 2009
selecting shape nodes

How can I select the shape nodes from the list of selected objects? The selected objects are curves.

I am getting the transform nodes by:

string $selected[]=`ls -sl`;

I have my script working by using the pickWalk down but is there a way to read the shape nodes of the selected curves into an array?


Edit: Never mind, figured it out.

string $selected[]=`ls -dag -g -sl`;

Last edited by ronviers : 03 March 2009 at 09:39 PM.
  03 March 2009
I`m also doing it with :

string $shape = `pickwalk -d down`;
Portfolio and Demoreel Review Service
  03 March 2009
That seems to work just as well. Thanks.
  03 March 2009
listRelatives -s will get you there too.

  03 March 2009
pickwalk will physically change your selection and will slow your script down. I suggest using something like this: it will give you the most control over your selections (IE: only transform objects and only transforms that have a specific shape type (meshes, nurbscurves, whatever you want)

string $list[] = `ls -long -type "transform" -sl`; //get the selected transforms.
 string $sel[] = `listRelatives -typ "mesh" -f $list`; //of the transforms selected, get the shapes that are polymeshes.

you will need to change the -type flag to "nurbsCurve" and maybe add another -type flag for "nurbsSurface" if you need those too.

Also, I use the -long flag to get full paths of nodes to avoid name clashes. you may or may not need it for your purposes.
- elenerville
  03 March 2009
Thanks thematt and DOor. I did not know about listRelatives, so that is very good to know. It is great to have this kind of flexibility from a simple user selection.
  03 March 2009
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

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
Society of Digital Artists

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

All times are GMT. The time now is 04:15 PM.

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