Questions tagged [maya]

Autodesk Maya is a 3D modeling, animation and rendering tool used in film, TV and advertising. Only programming questions are on-topic.

Autodesk Maya is a cross-platform 3D modeling, animation and rendering tool used by many entertainment companies in film, TV and advertising.

Scripting in Maya can be done in either or . Tree Python APIs are included: maya.cmds, and maya.api for a more core-level access to the Maya behaviour.

Non-programming questions should not be posted to Stack Overflow.

Documentation

To access all the documentation for the different Maya versions: https://knowledge.autodesk.com/support/maya/getting-started/caas/simplecontent/content/maya-documentation.html

2561 questions
0
votes
1 answer

How do I list vertices in the order I select them in Maya?

I'm writing a tool for may that returns the vertices in the same order as selected, but I get them in numerical order. import maya.cmds as cmds cmds.selectPref(tso=True) print(cmds.ls( orderedSelection=True)) print(cmds.ls( sl=True,))
Peter
  • 67
  • 1
  • 8
0
votes
1 answer

How to find the Redshift Maya API Document?

I'm looking for the Redshift Maya API Documents. I've been working on the tools that will automatically create the Active AOVS Puzzle matte accordingly to the Object ID Info. The problem is i couldn't find the Redshift API Document specificly right…
0
votes
1 answer

Maya python commands: modelEditor (capture flag)

I want to save viewport into an image file and then use it as an icon in a PySide2.QtGui.QIcon, this is my code: path = os.path.join(DIRECTORY, "{}.jpg".format(name)) cmds.modelEditor(self.viewport, e=True, capture=path) icon =…
0
votes
1 answer

How can you get parent groups of joints in maya python

I have a hierarchy like this: root_ctrl group2 group3 joint I want to get names of the groups. The output should be ['group2', 'group3']. i have tried using parents = cmds.listRelatives('joint', allParents = True ) output = [] parents =…
0
votes
2 answers

Calling function from UI class in maya resulting in nonetype error

I'm building a toolbox UI using python in Maya, and I keep on getting a Nonetype error when I call one of the imported functions. This is the script for the toolbox: class Toolbox(): import maya.cmds as cmds def __init__(self): …
0
votes
1 answer

Floating UI in Maya, and Button clicked connect, but the event not working

In my case, I tried to float QMainWindow in Maya. In that window, there are three buttons, and I connect the event to my function. After that, I float the window and try to click but it's not working. I want to know the reason why it is not working,…
ssong.ty
  • 1
  • 2
0
votes
2 answers

matching elements of one array with another and changing the main index

ctrlList = [box_1_ctrl, box_2_ctrl, box_3_ctrl, box_4_ctrl, box_5_ctrl, box_6_ctrl, box_7_ctrl, box_8_ctrl]; ctrl1 = ctrlList.index(ctrlList[0]); ctrl2 = ctrlList.index(ctrlList[1]); ctrl3 = ctrlList.index(ctrlList[2]); ctrl4 =…
0
votes
1 answer

How to get the attribute's anim curve that is stemming from animation layer

I need some help with Animation-related + OpenMaya API. I am using OpenMaya to iterate rig controllers I have in my scene, targeting mainly at the rotational attributes. Things work fine if these rotational attributes are keyed (manually). But then…
Teh Ki
  • 455
  • 1
  • 3
  • 14
0
votes
1 answer

Set Maya Image Plane Attr "Image Number" to expression "=frame" through python

I'm trying to set the attribute "Image Number" to the expression "=frame" through python. Currently I've tried cmds.setAttr(myImagePlane+".ufe", 1) cmds.setAttr(myImagePlane+".fe", '=frame') Which doesn't work as .fe only takes integers. From maya…
mhetman
  • 3
  • 2
0
votes
1 answer

How to run function objects(Maya, Python)?

Sometimes when I query a command of a button or something like that I get this: For example: cmds.menuItem('MtoAReleaseNotes', query = True, command = True) >>> at 0x0000019849774588> So how do I run these commands via Python?
Lala_Ghost
  • 211
  • 1
  • 12
0
votes
0 answers

I want that each time that I select an new object in maya it opens a new dialogue box that can select the same object

I am trying to put class in function in order to select severals objests each with its own box for re select again import maya.cmds as cm obj = selection = cm.ls(selection=True) print(obj) cmds.select(obj) …
0
votes
1 answer

Create a GIF for Maya with python threading

I want to add a gif element in my custom Maya UI using python. Since Maya doens't accept animated images as input I created a while loop and edit the input image. To do to that I used Timer and everything works fine, untill I rerun the script. The…
Craven
  • 3
  • 2
0
votes
1 answer

Undo an operation in Maya API

In my Maya .mll file I have the following: void doIt() { MGlobal::executeCommand("polyMapCut -ch 1 pCube1.e[2];"); } void undoIt() { MStreamUtils::stdOutStream() << "Undo is called"; MGlobal::executeCommand("undo;"); } This are all…
John Tan
  • 1,331
  • 1
  • 19
  • 35
0
votes
3 answers

PySide: TreeView widget for folders

I want to create a TreeView widget using PySide for Autodesk Maya that can display the content of a directory like the example below: I did find an example using tkinter for a simple python script : Tkinter: Treeview widget. But I want to use…
IT World
  • 165
  • 1
  • 10
0
votes
1 answer

Question about select command execution in a script

How to execute the cmds.select before confirmDialog cmds.select(clear=True) lightType =['aiAreaLight'] selLight=cmds.ls(lights=True, visible = True, type= lightType ) cmds.select(selLight) answer = cmds.confirmDialog() I've a stupid problem in a…
sonobru
  • 1
  • 1