
MAYA Python: getting the position of selected object using getAttr
cmds.select(item, r=True) # replace the original selection with one item print cmds.getAttr(".translateX") # if the name is only an attribute name, Maya # supplies the current …
Maya Python: cannot import name 'cmds' from 'maya.cmds'
Jul 23, 2022 · From what I've researched there seems to be minimum to no difference between "import maya.cmds as cmds" and "from maya.cmds import cmds" unless someone can explain …
Getting all materials attached to object throughout all render …
# Gets all shaders attached to the current renderLayer for all objects in "group1" import maya.cmds as cmds cmds.select("group1") allChildren = cmds.listRelatives(ad=1) for …
How do I run two commands in one line in Windows CMD?
I want to run two commands in a Windows CMD console. In Linux I would do it like this touch thisfile ; ls -lstrh How is it done on Windows?
Set Maya Display Layers to Off with PythonScript
Feb 11, 2021 · If you trace the Maya commands that occur on a layer visibility change, you get pointed to setDisplayLayerVisibility() in layerEditor.mel. More specifically to this MEL …
import objects from references in maya - Stack Overflow
Apr 18, 2020 · import maya.cmds as cmds refs = cmds.ls(type='reference') print refs for ref in refs: rFile = cmds.referenceQuery(ref, f=True) cmds.file(rFile, importReference=True) it returns this …
Maya Error - ModuleNotFoundError: No module named 'maya.cmds'
Nov 14, 2019 · Are you executing this from within Maya? If so, the bundled Python interpreter should have automatically done whatever needs doing to give you access to maya.cmds.
Maya python get top most parent transforms - Stack Overflow
May 4, 2021 · I have a selection of transforms in maya and I want to get the top parent transforms of all hierarchies within the selection. Is this the best way to achieve that? import maya.cmds …
Maya AbcExport with Python - Stack Overflow
Apr 25, 2017 · 5 You can find help for cmds.AbcExport and cmds.AbcImport by instantiating them with the h arg set to True. The following commands will print help docs:
How to get the name of a selected Object Python Maya
Mar 23, 2017 · 5 cmds.ls will return a list, you need to check the list and delete what ever you want to delete, and sn is very bad always use long name because there can be duplicates.