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
58
votes
13 answers

Convert pyQt UI to python

Is there a way to convert a ui formed with qtDesigner to a python version to use without having an extra file? I'm using Maya for this UI, and converting this UI file to a readable python version to implement would be really great!
Shannon Hochkins
  • 11,763
  • 15
  • 62
  • 95
8
votes
2 answers

use external python script to open maya and run another script inside maya

Is it possible to call a script from the command prompt in windows (or bash in linux) to open Maya and then subsequently run a custom script (possibly changing each time its run) inside Maya? I am searching for something a bit more elegant than…
TheBeardedBerry
  • 1,636
  • 5
  • 20
  • 30
5
votes
1 answer

How can I clear the Maya Script Editor programatically?

While creating and debugging scripts, I generate lots of feedback for myself, but if I don't clear the Script Editor, I can get confused about which attempt the feedback I'm looking at came from. Is there a way (preferably with PyMEL, but MEL is ok)…
lofidevops
  • 15,528
  • 14
  • 79
  • 119
4
votes
3 answers

Maya – Why Print method can't be executed after Clear History command?

cmds.scriptEditorInfo(clearHistory=True) print("hi") The top line clear's the Maya Script Output window, and then the line below that is supposed to print hi. But when you run this, it flashes the hi output, and then clears everything. So the…
Frank
  • 2,109
  • 7
  • 25
  • 48
4
votes
3 answers

How to isolate group nodes in maya with python

I have a selection that can reasonably contain most any node type. In python I need to filter out everything except the group nodes. The problem is that group nodes are read by maya as just transform nodes so its proving difficult to filter them out…
TheBeardedBerry
  • 1,636
  • 5
  • 20
  • 30
3
votes
2 answers

Can I pm.playblast from within mayabatch?

I am trying to playblast multiple Maya scenes in a folder, without bringing up the Maya GUI. I have successfully invoked a headless Maya instance with mayabatch.exe That instance calls a script that crawls a folder Each scene is opened But I cannot…
lofidevops
  • 15,528
  • 14
  • 79
  • 119
3
votes
1 answer

What is the difference between the Python type method and the type function on a Maya Transform Node?

Question in title Example code: >>> j.type() u'joint' >>> type(j)
shfury
  • 389
  • 1
  • 5
  • 15
3
votes
1 answer

Maya/Python: How do I scale multiple selected animation curves each from their own specific pivot point?

I'm trying to do a scale operation of multiple animation curves, each using its lowest key as the pivot point. I am thinking it should be a nested for loop structure but have not been able to get it working properly. The scaling is simple,…
isticism
  • 95
  • 7
3
votes
7 answers

Is there a way to indent Python without affecting the code

I'm trying to write a user interface in Maya, and it's getting incredibly confusing with multiple levels of parents and no indents. The basic code (without any functionality) is currently around 400 lines and it's taking a while to find the bits I…
Peter
  • 3,186
  • 3
  • 26
  • 59
3
votes
3 answers

How to query current viewport renderer in maya

Anyone have a good solution for querying the current maya viewport renderer (Viewport 2.0, Default Viewport, High Quality Viewport) in python?
TheBeardedBerry
  • 1,636
  • 5
  • 20
  • 30
3
votes
3 answers

Affine 3D transformation in Python

I'm programming a function in Python in Autodesk Maya (using PyMel for Maya) I have three 3D points; p0, p1, p2. Then they make a rigid transformation, so after the transformation (an affine transformation) I have their new positions; q0, q1, q2. I…
user1066278
  • 350
  • 1
  • 6
  • 16
2
votes
2 answers

How can I change the rotation values at different keys in playback bar in maya using python?

So I am trying to map all the rotation angles present into the range of 0
2
votes
1 answer

How to get Stereoscopic Camera Lens Lengths attribute via Python?

I have a Python script that stores the attributes of a stereoscopic camera into a json file and I am having trouble storing the lens Lengths attribute. I am new to Maya and this might be a very obvious thing to ask so I appreciate any input. This is…
burned_fenrir
  • 138
  • 2
  • 13
2
votes
3 answers

Should I be using abstract methods in this Python scenario?

I'm not sure my approach is good design and I'm hoping I can get a tip. I'm thinking somewhere along the lines of an abstract method, but in this case I want the method to be optional. This is how I'm doing it now... from pymel.core import * class…
jedmao
  • 10,224
  • 11
  • 59
  • 65
2
votes
3 answers

Set default logging level in python

I am having trouble with a module (specifically pymel.core in maya) which seems to change the default logging level. When I import pymel, all the different loggers in the modules I'm using suddenly get set to debug and start spewing out loads of…
ninhenzo64
  • 702
  • 1
  • 9
  • 23
1
2 3
12 13