
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 selection This is useful when you …
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 why one …
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?
how to make selected object renamed in maya using python?
Oct 11, 2020 · But in the rename function, you use again a string 'a'. So maya searches for an object called 'a' and tries to rename it what does not work unless you really have an object called 'a'. And …
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 as cmds def
Getting all materials attached to object throughout all render layers ...
# 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 eachChild in allChildren: # …
python - batch fbx export in maya - Stack Overflow
Mar 12, 2023 · import maya.cmds as cmds from CreatureExport import CreatureAnimBakeProcess def exportAllAnim(): path = r'F:\Characters\Creatures\Animation' print path files = …
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 command: layerButton …
python - Maya - query animation curve data - Stack Overflow
Jul 11, 2020 · import maya.cmds as cmds # Create an animation curve with 2 keys. anim_curve = cmds.createNode("animCurveTL") cmds.setKeyframe(anim_curve, t=0, v=0) …
Get Animation start and end keyframes in Maya Standalone (No User ...
Aug 21, 2020 · import pymel.core as pymel pymel.playbackOptions(q=True, min=True) pymel.playbackOptions(q=True, max=True) import maya.cmds as cmds …