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

Adding multiple selections to a main selection list to be used for a snapping script

setting up a snapping script by storing a list of control curves and have been having trouble getting my test script to use my selections in my snapping function(right now I want it to print the combined ik and fk control curves). When I print my…
0
votes
1 answer

calling a function in a class when button is pressed? in python

I'm running into a a few errors when trying to call a function. I have a button that when pressed should print snapped. #code for button cmds.button(label='FK 2 IK', command = 'Fk2Ik()', width=100) cmds.button(label='IK 2 FK', command =…
0
votes
1 answer

Why the code executes twice whenever first run after launching Maya?

import maya.cmds as cmds def aaa(): blah... blah... aaa() saved this code as aaa.py and placed it right folder and launched Maya and run the code by import aaa reload(aaa) And it executes twice when the first run. How can I prevent that?
0
votes
0 answers

Get the list of option for an attribute in Maya

I want to create an UI that list all options relative to an attribute that have an option menu and get it in my own option menu. The UI building is fine but i cant get the option for the attribute. I found this command : "attrEnumOptionMenu" and it…
KL75
  • 3
  • 1
0
votes
2 answers

how can i set a mesh control point value use maya python api

I want use maya python api to get a mesh control point attribute and set a new value.but I don't have a clue. like mel command setAttr 'pCubeShape1.pnts[3].pntx' 2; but i want to use api or some quicker way.. Thnks!
Z.Ben
  • 1
0
votes
1 answer

maya can't recognize unicode if it's in PySide2?

So there is a lines of code that if I run it in 'script editor' it whould work fine, but if it get the same text from PySide2 it wouldn't work. lets say you put 'a#↑' into your input. it would print 'a' and '#' but not '↑' and instead it print 'Not…
zazuvahe
  • 33
  • 7
0
votes
0 answers

Position an object with respect to another object

Problem: I have object A, I know the position of object A (x,y,z). I also know the euler angles of object A. I would like to position object B such that it faces object A's -z axis. My code: The code I have listed below will take Object A and…
0
votes
1 answer

Why does my object not go to 0,0,0 when using the xform Maya command

I am using Maya and I would like to move my object to 0,0,0 in world space. I am using the xform command and my object does not move ( based on its centered pivot) to 0,0,0. Here is what I am running: import maya.cmds as cmds temp_xforms =…
winteralfs
  • 459
  • 6
  • 25
0
votes
0 answers

Associate / reference a JSON file within a Maya scene

I have a JSON file that has parity with a maya scene. The maya scene file name usually goes through several increment or naming changes, but the JSON file would not . My current script was trying to find the JSON file from the maya file name ( for…
blam
  • 87
  • 1
  • 8
0
votes
0 answers

Using python to place a locator for a pole vector in maya

I've been following a tutorial (https://vimeo.com/240328348) which involves creating a locator and placing it in the correct location for a pole vector. For some reason when I run my script, it consistently places the locator directly on the middle…
0
votes
2 answers

How to perform element-wise parent constraint of two lists?

I am trying to create a parent constraint between the elements in two lists as follows: import maya.cmds as mc objCtl= mc.ls('red_ctl', 'green_ctl', 'blue_ctl') objJt= mc.ls('red_jt', 'green_jt', 'blue_jt') for item in objCtl: …
0
votes
1 answer

Position a layout to the bottom of main layout python Autodesk Maya

I'am creating a user interface that allows the user each time he clicks on '+' button it adds a new layout with text fields in it, knowing that I have to put that apply button at the bottom of my main layout, but the problem that I have is that the…
it4Astuces
  • 432
  • 5
  • 17
0
votes
0 answers

Load two animated maya files into Javascript

I'm trying to load two different maya files that are animated but only one is animating, the second one isn't. I tried to load fbx files using the fbx loaders var loader = new THREE.FBXLoader(); loader.load('models/jumpi.fbx', function(object) { …
0
votes
1 answer

Expression is not captured in the first run

I am trying to query for the 'default' expression used in imagePlane node with the following code: # Part01 img = cmds.imagePlane() frame_ext_attr = "{0}.useFrameExtension".format(img[0]) cmds.setAttr(frame_ext_attr, True) # Part02 print '>>> ',…
yan
  • 631
  • 9
  • 30
0
votes
1 answer

show window on menuItem clicked Python Maya

I'am new to python scripting using Maya I want to autoload a plugin that I created to display a custom menu in Maya main Window. When clicking the menu item, it shows a window using a function that I create. So the problem: When I run my code simply…
it4Astuces
  • 432
  • 5
  • 17