Questions tagged [pymel]

PyMEL makes python scripting with Maya work the way it should. It builds on the cmds module by organizing many of its commands into a class hierarchy, and by customizing them to operate in a more succinct and intuitive way.

PyMEL according to its website, makes python scripting with Maya work the way it should. Maya's command module is a direct translation of mel commands into python commands.

The result is a very awkward and unpythonic syntax which does not take advantage of python's strengths (particulary, a flexible, object-oriented design).

PyMEL builds on the cmds module by organizing many of its commands into a class hierarchy, and by customizing them to operate in a more succinct and intuitive way.

185 questions
1
vote
1 answer

how can I stop "for loop" in the "run_script" file, when "file_a" doesn't open the file

i'm working on a "python script" in "MAYA", when i use "pm.fileDialog2" and when i click the exit button, the loop script is still running, i want when i open the file and click the close button "for loop" stops. Thank you for the help this is the…
Wongselent
  • 31
  • 3
1
vote
1 answer

how to do a selection of specific edges on duplicated objects in Maya?

I’m new to python, so I'm sorry if my question seems to be silly. But, I'll be grateful if someone could help. I'm writing a script in Maya Python. I have a set of duplicated meshes. I need to select certain poly edges and convert them into…
Val
  • 11
  • 4
1
vote
1 answer

Pymel setColor not working on vertices

I was trying to change the colors of the vertices of a cube in maya using pymel. My goal was to create a shaded cube. However, when I run the following code nothing changes. Any idea? cube, pcube = pmc.polyCube() for v in cube.vtx: …
1
vote
1 answer

How do I get list of all types in Maya's ls command?

In Maya there is a ls command which lists all objects in a scene (or DAG). pm.ls() Here is reference to ls command. We can list specific type of element by passing type parameter. pm.ls(type="joint") Some possible types are, camera, mesh, joint…
Santosh Kumar
  • 26,475
  • 20
  • 67
  • 118
1
vote
1 answer

Getting the inverse of a matrix with PyMel in Maya 2017

I've been looking around in the PyMel docs but can't I get the inverse of a matrix from pymel.core.datatypes. My code is: inverseM = orientationM*bindRotationM; inverseM = inverseM.asMatrixInverse() I just get the error: Error: line 1:…
Hamaro
  • 49
  • 9
1
vote
1 answer

Trasnparent Window in Maya 2017

i found a script by SAFRONOV 3D (on youtube) that allows him to make the graph editor transparent inside Maya... The problem is that it works on Maya 2014 and i'm Trying to update it to 2017. I know very little of opne maya and all that, i´m a…
Mendel Reis
  • 55
  • 2
  • 14
1
vote
0 answers

Skeletal animation transfer - Orientation

I'm trying to make a pymel script in Maya where I want to transfer an animation from one rig to another. Right now the script is transferring the keyframes from the orignal rig to the other, but it ignores the joint orientation. I have the…
Haplue
  • 70
  • 9
1
vote
1 answer

How to setup Maya 2016 and PyCharm Community Edition 2017 IDE

Been trying for 8 hours now to get pycharm to work with mayapy.exe but i just cant get it to work. From clean installs of both programs i first open an empty scene in maya. Then i open pycharm and add mayapy.exe as interpreter and what automaticly…
Hamaro
  • 49
  • 9
1
vote
1 answer

PyMel - urllib2 400 Bad Request when calling from function

I apologise if the titles too vague. In Maya (PyMel) im calling a function below to draw a login screen def ms_ui(self): logged_in = False if not logged_in: login_col = pm.rowColumnLayout(numberOfColumns=3) usr =…
Voronoi
  • 23
  • 4
1
vote
1 answer

How to output a .cprofile file from script

I'm using the cProfiler in my script. I'd like to output the .cprofile file with results. I want to get the output file that is not human readable and later open it in snakeviz. Is that possible? I cannot use the python -m cProfile -o program.prof…
Kowalski Paweł
  • 594
  • 1
  • 6
  • 27
1
vote
1 answer

Detect when a keyframe is set on an attribute in Maya?

I'm trying to trigger a script to run when a keyframe is set in Maya. I'm currently using scriptJob's to trigger scripts on the timeChanged event and when certain attributes change, but I've not found an event for when a keyframe is set. Is there a…
Brendan Abel
  • 35,343
  • 14
  • 88
  • 118
1
vote
1 answer

Why is exportSelected exporting non-selected nodes?

My goal is to export the root node, all children and everything required to recreate an asset (for example, materials), but not include anything extraneous (for example, a lighting rig used to demo the asset, but that is logically not part of the…
lofidevops
  • 15,528
  • 14
  • 79
  • 119
1
vote
1 answer

How can I find points at an equal distance between 2 objects?

I'm trying to find points at an equal distance between 2 other points in 3D space. For example, I have 2 cubes in my scene. I want to add 5 (or 3, or 80...) locators at an equal distance between these two spheres with Pymel. I can easily find the…
applepie
  • 133
  • 1
  • 13
1
vote
2 answers

Maya Pymel: pass fileDialog2's return to a UI textfield

I'm having trouble understanding how to use fileDialog2's "optionsUICommit" flag. When the user hit's "save" in the file dialog box, I want to run the command on_save_dialog_file. But from the help file, it seems to want me to use a MEL command.…
john
  • 408
  • 9
  • 30
1
vote
1 answer

Why when printing a vector is str(vector) implicitly called?

Everything below this paragraph is from the book Practical Maya Programming. In the second to last line the author says that the print statement with argument t implicitly calls str(t), I'd like to know why, also in the second block of code the…
shfury
  • 389
  • 1
  • 5
  • 15
1 2
3
12 13