


At the moment, this is the only way I know of how to search for objects in maya. If there is a better way to query for objects in maya, let me know what it's called and I'll do some research into what that is. I couldn't find an answer on this website, so I chose to ask a question. I'm not sure why this is the case because in those examples, the string concatination should come out to 'mesh*' like the first example. However, in both examples, it returns an empty list unlike the first.

This code works and will return a list of objects with the matching string in the name, however, I would like to use a variable instead of hard coding in the string. Simple sample code like this: from maya.cmds import * The -typeįlag is only required when setting a non-numeric attribute.I'm trying to use the "ls" python command in maya, to list certain objects with a matching string in the name in concatination with a wildcard. The full script lives here if you want to download it:. If you are starting to venture into Python and have trouble finding simple examples, hopefully this post will help I will go into detailing part by part, with sample codes and screenshots. No value for the theĪttribute is needed when the -l/-k/-s flags are used. This tutorial covers the very basics of Pyside and Python for Maya 2018.

You may check out the related API usage on the. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. What is the difference The example in the documentation is the same one. It's a text field on the status line (on the top right of the screen) where you can type in the name of an object in order to select it. You may already be familiar with the Input Box in Maya. This tutorial originated on the 3D Animation weblog Set Driven Key. These examples are extracted from open source projects. In Maya, when using the setAttr() command, we can use float and double as a variable type. Wildcards Selecting nodes using wildcards in the Input Box. Sets the value of a dependency node attribute. The following are 30 code examples for showing how to use (). SetAttr is undoable, queryable, and editable. Python examples import maya.cmds as cmds cmds.sphere( n'sphere' ) Set a simple numeric value tAttr( 'anslateX', 5 ) Lock an attribute to prevent further modification tAttr( 'anslateX', lockTrue ) Make an attribute unkeyable tAttr( 'anslateZ', keyableFalse ) Set an entire list of multi. Add : to your search string, or use recursive flag. Note: Strings representing object names andĪrguments must be separated by commas. Not sure if you can use the tools for this, but using MEL/Python you could do it 2 ways.
