Thanks a lot Sasha, that's really helpful! :)
I have a quick question about a utility module, I'm not sure how to build the
different methods in a flexible way.
Here's an example (pseudo-code-ish):
#Method for locking/unlocking attributes
def lockAttr(objects, attributes, state):
for obj in objects:
for attr in attributes:
if state == "lock":
cmds.setAttr( obj + '.' + attr, lock=True, keyable=False )
if state == "unlock":
cmds.setAttr( obj + '.' + attr, lock=False, keyable=True )
#Try to call the method
lockAttr(['pSphere1','pSphere2'], ['translateX', 'translateZ', 'lock')
This is what I want (kinda), a flexible way so that I can run the command in
one line, and have multiple objects as inputs, and define wether to lock or
unlock it. I was wondering if you could give an example on how you would go
about doing this in a method?
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.