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
0
votes
1 answer

Maya: Python script works in some scenes, but not in others

I can find one other place where this problem is specifically addressed, but it seems to be even more personal in nature and the other thread provided no help. This is the error: # Error: Maya command error # Traceback (most recent call last): # …
ninthtale
  • 3
  • 3
0
votes
1 answer

How to get the swapNamespace flag to work with cmds file import in Maya

According to the documentation - https://download.autodesk.com/us/maya/2011help/CommandsPython/file.html#flagswapNamespace ..The command should look something like this, cmds.file('E:\Stuff\ASSET.FBX', i=True, swapNamespace=['ASSET','Taco']) It…
Johnny Bravo
  • 163
  • 11
0
votes
1 answer

Getting rotation from matrix, OpenMaya

I'm working with OpenMaya and I need to get the Euler rotation from a matrix but i'm getting an error while I launch this simple code: code: import maya.OpenMaya as OpenMaya import maya.cmds as…
0
votes
1 answer

PyMel duplicate and reparent preserving hierarchy

Is there a way to preserve a parented hierarchy when duplicating and reparenting with PyMel? I have a nested hierarchy of nodes that I want to duplicate and parent under a new group node. My selection of the top node of the hierarchy has hi=True set…
scofra
  • 3
  • 1
0
votes
1 answer

PyMEL embedding layouts

what's the best way to embed multiple PyMEL layouts in a single form? For example, for each row of a form, I want to specify that: row one uses a 2-column layout for label+textField pair row two uses a 1-column layout for a menu item that has its…
scofra
  • 3
  • 1
0
votes
1 answer

Is there a way to get an average "range" between two points in pymel?

The title may be a bit confusing, so let me put it this way: I have a polygon strip at a tilted angle, I want to add a curve(in a straight line) that goes through the strip, from start to end, and stays centered in the strip. I can get the starting…
Fozze
  • 1
  • 1
0
votes
1 answer

Maya PyMel iterating through layers in a scene and creating groups from the contents

I am having trouble understanding how to: iterate through the layers in a scene, select the contents of each layer, group all of the contents of the layer into one group rename the group based on the name of the first obj in the layer +_'grp' I…
lupin4
  • 15
  • 9
0
votes
1 answer

Get the parameter flags and default values for a Maya command

I am trying to get the flags and default values for any given maya command. In python I would generally use the inspect module, but as pymel is only a wrapper I don't see that as an option here. I was hoping the api would have something that could…
m3trik
  • 333
  • 2
  • 13
0
votes
1 answer

how to draw curves from vertex to vertex in MEL

I'm trying to write a simple script that draws curves between selected vertices. Right now I'm just trying to get it so you highlight the vertices of an object, run the script and it creates curves that start at the vertices and end at (0,0,0). I'm…
ryan
  • 11
  • 2
0
votes
0 answers

Maya Standalone, PyMel and attribute accessibility

This problem in happening while using Maya Standalone in conjunction with PyMel. I am trying to load FBX files into Maya scenes, and assign Stingray PBS materials to them with connected file textures. I'm able to assign the Stingray materials, but…
bblack
  • 33
  • 2
  • 5
0
votes
1 answer

Duplicate a nurbs curve along a curve to perform a loft

I have put together a script that creates the following; A start and end curve shape and a linear curve between. Now what I'm wanting to do is to duplicate and transform the starting curve shape along the path (as depicted by the image), and perform…
m3trik
  • 333
  • 2
  • 13
0
votes
0 answers

Export hierarchy as xml in maya

I have a maya scene file with the hierarchy Wheels_GRP FrontWheels_GRP Wheel_Front_L_GRP Wheel_Rim_Front_L_MSH Wheel_Rim_Front_L_MSHShape Wheel_Front_R_GRP Wheel_Rim_Front_R_MSH …
0
votes
1 answer

Create a recursive function to get hierarchy in maya

Hi i am trying to get the hierarchy of the scene file in maya as a dictionary. For example enter image description here I want this data as a dictionary tree = {"group5": {"group4": {"group3": {"group2": {"group1": {"pSphere1": "pSphere1Shape"}}, …
0
votes
2 answers

Get Animation start and end keyframes in Maya Standalone (No User Interface)

I'm trying to get the first and last keyframes of an animation using Maya Standalone. If you're unsure, Maya Standalone means no User Interface. This is all purely command line and Maya is not running; which means that certain things you can…
Adam Benson
  • 11
  • 1
  • 4
0
votes
1 answer

Maya Python: Button always at the center of the window

I'm starting experimenting with Maya python, and I'm trying to do some UI. I came across to a really strange problem, I can't get a button to stay in the center of the windows. I've tried different things but nothing seems to work, here is the…