![]() ![]() ![]() You can Python's star *args to pass an iterable object like a generator to a command: lect(*a_generator_function())Ī lot of commands take flags which control their behavior. You can pass these individually or as iterables (lists, tuples) lect("top", "side") Many commands can accept multiple targets. The most basic form is simply () where is the function you're calling and is the string name of an object you are working with: cmds.hide('pCube1') ![]() Recognizing the form that a command takes is useful for working with new commands. Maya commands come in a very small range of forms. TxValue = cmds.getAttr("%s.tx" % nodeName) Here is a very minimal example of getAttr nodeName = "pSphere1" Autodesk has well documented the command here And it can return multiple types of dataTypes also. Same as setAttr here it will give back the value from a specific attribute from a node. Here is a very minimal example of setAttr nodeName = "pSphere1" For detailed instructions please visit the official documentation from maya itself here. import maya.cmds as cmds class MayaProperty(object): in a real implmentation. ![]() And it support very wide range of options. I have seen examples of re-implementing setattr on stack overflow. Basically as any other language setAttr can set a value for a specified attribute of a node or any context. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
February 2023
Categories |