PDA

View Full Version : if (selection is particle)


tdruckenmiller
05-08-2009, 09:39 PM
I am trying to create a conditional statement that checks to see if my selection is a particle, and only run if it is. I cannot seem to figure out how to query the selection's type however. I have tried nodeType, but that only returns 'transform'. Then if I use listRelatives -child I am given the shape nodes name of the selection. If anyone could help it would be greately appreciated. Thanks in advance.

rxgeez
05-09-2009, 01:18 AM
you'd want to do the nodeType on the particle shape not the transform....you can do this

//select the particle transform or shape

string $sel[] = `ls -sl -fl -dag -type "shape"`;
string $nodeType = `nodeType $sel[0]`;
if ($nodeType == "particle"){
print "Im a particle!";
}

hope this helps

-k

tdruckenmiller
05-09-2009, 05:26 AM
Thanks a lot. That does the job!

CGTalk Moderation
05-09-2009, 05:26 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.