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

In Maya python, run command even if an object (part of a string) doesn't exist in the scene

I have this code cmds.select('cat', 'dog', 'cow', 'mouse', hierarchy=True, r=True) min_time = cmds.playbackOptions(q=True, min=True) max_time = cmds.playbackOptions(q=True, max=True) cmds.bakeResults(simulation=True, time=(min_time, max_time)) If,…
Arturo ID
  • 3
  • 2
0
votes
1 answer

How to implement MObject picker in Maya

I have a plugin running inside Maya that needs to perform an 'eye dropper' test against objects in the scene. My Plugin is running as a hosted WPF control, so I have a C# button event callback that wants to operate in a modal fashion until the hit…
Steven
  • 619
  • 5
  • 24
0
votes
1 answer

Selecting Maya objects through memory using classes

Selecting Maya objects through memory using classes What is the problem with the below code: import maya.cmds as cmds class MakeObject: def __init__(self): self.grp = cmds.createNode('transform') def make_cube(self): …
0
votes
1 answer

how do i link the UVs from a custom UVset to a texture in Maya using pymel (or maya.cmds)

I'm writing a tool that will help make me make custom uvSets on a model that will be linked to ramps(no interpolation) that will be sent to vray_extraTex render elements. these will become mattes and used in the same way as vRay multi mattes.…
mr.matt
  • 51
  • 3
0
votes
0 answers

Maya Python Script - os.popen tasklist read Is super slow. Faster way?

I'm checking os tasklist to find out if an external app is running or not. The script is run through python & maya. This command takes more than 10 seconds which seems very slow to fetch a list of strings? How can I speed up this process? #…
Tireless22
  • 31
  • 3
0
votes
3 answers

Using correct class instance when making multiple instances in succession

Having an issue with my script when I make multiple tabs in a row. I if I make two tabs and then try to edit the first; it changes the second tab and not the first. import pymel.core as pm import maya.cmds as cmds class TabWindow(pm.ui.Window): …
0
votes
1 answer

How "pickle" works on py-mel?

I'm trying to store some variables with pickle using python on Maya, but I'm having some problem. The error that shows up is: # Error: IOError: file -maya console- line 6: 13 # that's what I've tried: import maya.cmds as mc import pickle names…
0
votes
1 answer

Setting a camera based on modelPanel

First of all, I don't code yet. My problem is that every time I open a scene in maya, the render cam panel is replaced with a persp view, thus making it a useless duplicate. I didn't find any way to make maya remember the panel with the camera and…
0
votes
1 answer

Make input and run loop to create custom number of objects

I have been trying to learn how to code for Maya for a while. And here I am making a rock generator using reduce face, quad-mesh, smooth in a loop. Now I would like to make an input so user can specify how many rock they want to make. Like if you…
Rey1000
  • 3
  • 1
0
votes
1 answer

Changing the text in a textFieldButtonGrp by using the button

I'm trying to find a better way to change the textfield in multiple textFieldButtongGrps when I press their buttons. Currently, what I have here works, but with this, I have to make additional lines in select_Object() for any additional…
0
votes
1 answer

How to set width and height / position ui when show up in maya?

I made a tool script for Maya. It works. I just want to set default position/at least ui size when it show up. Is there anyway to do this? I already tried with some 7 commands. None of 'em works. Most of the code tested in vscode with python 2.7…
0
votes
0 answers

replacing argument values with return values

I'm creating a list of selected objects in maya for an IK/FKswitch and have run into a bit of a problem. When I create my selection list instances I need to temporarily make my argument values foo, bar, and baz. When I select my control curves in…
0
votes
2 answers

Python- class instance problem (init takes five arguments; only passing two)

I’ve been working on an IK/FK joint matching script, that I managed to finally get working correctly last month. Today start I up Maya, run the script and while the interface loads up, I received the following errors… This one upon running loading…
0
votes
1 answer

How to select a random value from a list?

I am trying to select one item from the list below but my list = RN.choice(xyz) currently selecting everything in xyz list so can you guys please give me a tip on how to solve it? import maya.cmds as MC import pymel as pm import random as…
Rey1000
  • 3
  • 1
0
votes
1 answer

Is there any way to export the specific object based on its name with Python in Maya?

Working on a batch exporter that is able to export different objects into different files at the same time (with one button). I am using cmds.file or mel.eval('FBXExport') to export the fbx files. I got trouble with exporting a specific object…
ZTZML
  • 11
  • 1
  • 5