#Maya python ls code#
I searched for scripts online, and found 2 great posts online, but decided to combine their 2 solutions, with a bit of my own code mixed in to come up with a new script. I find it worth it to fix duplicate names for that reason alone.
ma file takes more characters, hence the increased file size. If that is still duplicated, it’s adding the grandparent as well, and will continue to add parents names until it becomes a unique name. The “Long Name” that Maya uses is the name of the object preceded by the object’s parent. ma files became lighter, sometimes up to 20% lighter! I also realized that after renaming my objects, my. Maya handles these duplicate names by using a “long name” internally, but some other scripts (including some default scripts) will complain about it and constantly throw error messages. def ls(): '''Yields containers from active Maya scene This is the host-equivalent of api.ls(), but instead of listing assets on disk, it lists assets already loaded in Maya once loaded they are called containers Yields: dict: container ''' containernames ls() hasmetadatacollector False confighost findsubmodule(api. You will find this node in the channelBox when you select the curve.While it may not sound like a big issue at first, I recently realized that having duplicate names in Maya can be more problematic than I originally thought.
#Maya python ls how to#
There will be a gray box surrounding that attribute when locked) I have been trying to find out how to do it myself without much success. Shape = cmds.listRelatives(circle, c=True)Īfter running this script you can edit the curves radius, normal and other settings on the makeNurbCircle node. Hi, How would i go about unlocking translate, rotate, scale if they have been locked (like if you right click them in channel box and click lock.
This also make pick-walking more intuitive. Contribute to sungho1114/MayaPythonStudy development by creating an account on GitHub. That is, all of the built-in Maya commands, such as sphere, ls, and so on, are accessible through Python. The implementation of Python scripting in Maya provides the same access to native Maya commands as is provided through MEL.
Because of this you do not need an extra transform in between every curve. Autodesk Maya supports the use of Python-style scripting wherever you used to use MEL commands. Maya handles these duplicate names by using a long name internally, but some other scripts (including some default scripts) will complain about. Since the transform still is a joint, you can freeze the rotate attributes without loosing the joints orient (joints has a spesial joint orient attribute). Maya Python: Renaming Duplicate Objects While it may not sound like a big issue at first, I recently realized that having duplicate names in Maya can be more problematic than I originally thought.
For example, ls will list all nodes whether internal or not. geometry cmds.ls(type('mesh', 'nurbsCurve', 'nurbsSurface')) You can also search for 'abstract' types, which correspond to Maya's internal class hierarchy. When doing this, you can animate directly on the joints, but they will look like curves in the viewport. However, using a wildcard will cause all the nodes matching the wild card to show up, including internal nodes.
#Maya python ls series#
By the end of this series students should have a fundamental understanding of the Python.
#Maya python ls free#
In this example I’m parenting a nurbs curve to a joint transform. Beginning Python for Maya is a free series designed for anyone who is new to Python and scripting in Maya. This is an example of how you can move a shapes from one transform to another.