PDA

View Full Version : listAttribute by type... ?


Dryden
01-03-2008, 12:13 PM
Hi everyone,

First of all, HAPPY NEW YEAR !!!

After those lil holliday im back to work.
I try to realize a script to symetrize controller. In few word this script will help animator, who have made a pose, and wanna symetrize it along vertical axe. All controller are named classicly exept few of them who start with 'Left' or 'Right'. I already know the name of all controller in the mesh, so I use "startsWith" to know if the current need to be symetrize alone (by exemple rotate angle of 5 became -5) or need to be symetrize with the opposite one (like left arm value paste to right, and right to left).

'Till here no problems, so I list all attributes with 'listAttr -keyable -unlocked' store them and make the symetry. I'm forced to do that dynamicly cause all controller do not have the same attributes, (some have only scale, some other scale translate rotate and custom one), left & right one have the same attr of course. But for some of them they have boolean attribute, like visibility. Here I don't want to symetrize it, visibility 'on' must stay 'on'.

So I came here to ask if anyone know a procedure to listAttr with specified type, like float and integer...

Thank's for the time u take to read this, and if u have any tips don't hesitate to reply ;)

Happy 2008 !!!

Chadrik
01-04-2008, 01:10 AM
you can use `getAttr -type "myObj.attr"` to get the type of attribute. then use a switch statement to do different things based on the type.

Dryden
01-04-2008, 07:14 PM
Thank's a lot, exactly what I need here.

CGTalk Moderation
01-04-2008, 07: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.