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

Using fileDialog2 to open files in Maya

In the documentation for fileDialog2 (http://download.autodesk.com/us/maya/2011help/pymel/generated/functions/pymel.core.system/pymel.core.system.fileDialog2.html), it says acceptMode (am) can be set to 0 or 1 to tell it if it should be opening or…
Peter
  • 3,186
  • 3
  • 26
  • 59
0
votes
1 answer

Raname script for Python in Maya

I have this script and I want to parent the controls together and rename the icons. Right now it names the groups, but doesn't name the controls or parents them. Can anyone help me? def priming(*args): jointChain = pm.ls(sl = True, dag =…
0
votes
1 answer

Effective While Loop for next object in a chain

I'm trying to make a while loop in Python to find the next item in a chain in Autodesk Maya. It cycles up through a hierarchy of objects until it finds the object with a certain attribute. Currently it first checks if the current object doesn't have…
Neo Conker
  • 169
  • 1
  • 13
0
votes
1 answer

How to identify the resulting meshes after separating an object

So I have a list of faces from a single mesh. That mesh (lets call it "A") is the result of combining an unknown number of meshes (you can assume that the list of faces equals one or more whole meshes that make up "A"). I then use separate on the…
TheBeardedBerry
  • 1,636
  • 5
  • 20
  • 30
0
votes
1 answer

Read NURBS control points in Maya from an ASC file

Say I have an ASC file with 100 (x,y,z) coordinates (representing a helix-like world line trajectory). I want to import that file in Maya and create a NURBS with each of the coordinate from my ASC file as a control point. I know how to import asc…
KPJ
  • 25
  • 1
  • 4
0
votes
4 answers

Maya Python: cmds.button( ) with UI passing variables and calling a function?

First of all, this seems to be a great place to learn more about programming. I've written a maya python script, where both functions work, I'm having trouble getting the UI button to call the superExtrude() function, though. The first function does…
St4rb0y
  • 317
  • 3
  • 5
  • 22
0
votes
2 answers

Python - Change the textField after browsing - MAYA

I've got the most annoying problem with my GUI Exporter in Maya. I've made the textField etc. work, but I can't change the value of the textField after it's created, which is what I need to do. What I want to do for example is, let's say the…
user3693306
0
votes
1 answer

Python Command to render vray

Making a small script to write out .vrscenes for me, however I'm a little stick with getting them to render. I'm using the pymel render command, which seems to call the maya software renderer rather than vray itself ignoring all the rendersettings I…
ABCheshire
  • 23
  • 1
  • 6
0
votes
1 answer

Error with simple UI script

I have this error message: # Error: IndentationError: unindent does not match any outer indentation level # I have tried to delete all indentations and replace the, with four spaces for each indentation, but I still get this error. What should I…
Bjørn
  • 71
  • 1
  • 12
0
votes
1 answer

Setting up a hotkey in maya with python

I was looking into making new hotkeys for some custom scripts in python and wanted to use the pm.nameCommand and pm.hotkey commands. The issue is that when I run the following code from the script editor it runs fine and everything is dandy but when…
TheBeardedBerry
  • 1,636
  • 5
  • 20
  • 30
0
votes
1 answer

pymel getArea() doesnt return real world units

correct me if I am wrong but when you use call getArea() from a meshFace node it doesn't return the area relative to the current scene units but rather relative to its own scale. For example: If I create a box with the scene units set to Meters,…
TheBeardedBerry
  • 1,636
  • 5
  • 20
  • 30
0
votes
2 answers

Convert percentage to proper UV scale value

I am trying to scale UVs. I have the percentage of the 0-1 UV space that the current UV shell takes up and the percentage that I need the shell to take up. What is the best way to do that? I have tried using pm.polyEditUVs() but I can't come up with…
TheBeardedBerry
  • 1,636
  • 5
  • 20
  • 30
0
votes
1 answer

Selecting bindpose nodes

I am having issues selecting all of the bindpose nodes in a scene. How can I get them? I am using PyMEL for this particular script.
TheBeardedBerry
  • 1,636
  • 5
  • 20
  • 30
0
votes
1 answer

Using PyMEL to set the "Alpha to Use" attribute in an object of class psdFileTex

I am using Maya to do some procedural work, and I have a lot of textures that I need to load into Maya, and they all have transparencies (alpha channels). I would very much like to be able to automate this process. Using PyMEL, I can create my…
Gavin
  • 1
  • 1
0
votes
2 answers

Get Shape from selected Edges

Im using Maya to perform a certain task on selected edges. Let's say I save these edges like this: edges = pm.filterExpand(sm=32) From here, I can just select the first edge, and get the object by splitting the unicode…
Shannon Hochkins
  • 11,763
  • 15
  • 62
  • 95