View Full Version : Query the type of a NonLinear Deformer?

08-14-2012, 04:14 PM
I'm trying to retrieve the type from a nonLinear deformer (twist, bend, flare, etc.), but there appears to be a problem with the nonLinear command.

cmds.nonLinear('flare2', q=True, type=True)
# Error: A deformer type was expected.

okay, so I tried:

cmds.nonLinear('flare2', q=True, type='flare')
# Error: Flag 'type' must be passed a boolean argument when query flag is set

Is this a bug with the command? Is there another way to determine the type of nonLinear deformer? I suppose I could test attribute configurations...

(Maya 2012 btw)

08-14-2012, 07:14 PM
if you look carefully at the nonLinear docs you should see that the type flag is NOT queryable. That's presumably why it doesn't work (although I'm not in a position to test and confirm unfortunately).
Can't you just do a nodeType on it?

08-14-2012, 07:32 PM
You can notice in the nonLinear doc that near some attributes there's a green square with a 'Q' inside it. On the bottom the legend will tell you that this icon flags attributes which can be queried and 'type' isn't among them.
So as an alternative solution you can query the nodes that are connected to the deformer, and check their type using nodeType. For example flare1 has a connection to flare1HandleShape which is of type deformFlare. If you are the one who created the deformer then the second returned value is the handle.

EDIT: Nathan beat me to the answer.

08-14-2012, 07:36 PM
...EDIT: Nathan beat me to the answer.haha, but don't great minds think (almost exactly) alike! :)

08-14-2012, 08:13 PM
thanks guys, i'll use the handle to make the determination. all nonlinear deformers are of the type "nonLinear", so i was stumped trying to query the type.

CGTalk Moderation
08-14-2012, 08:14 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.