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
2 answers

Center Pivot without xform

Is there a way to center the pivot of an object without the use of xform? I really would like to try and find a pyMel version of this, or the maya api, as xform is generally 10x slower than a pymel or api solution. Obviously you can achieve it with…
Shannon Hochkins
  • 11,763
  • 15
  • 62
  • 95
0
votes
1 answer

How do I use the GeometryConstraint class?

I've been trying to get this to work for so long now, I've read the docs here, but I can't seem to understand how to implement the GeometryConstraint. Normally, the derivative version of this would be: geometryConstraintNode =…
Shannon Hochkins
  • 11,763
  • 15
  • 62
  • 95
0
votes
3 answers

How do I create an OpenMaya UI?

I don't know how to create a UI with MayaApi, all I have done in the past is something like this: import pymel.core as pm winWidth = 400 if pm.window("window", exists=1): pm.deleteUI("window") pm.window("window", w=winWidth) with…
Shannon Hochkins
  • 11,763
  • 15
  • 62
  • 95
0
votes
1 answer

Using ProgressBar class

I'm not following how to use the UI type ProgressBar in pyMel. The old way, or the derivative of this was to do this: cmds.progressBar('barName', edit=1, progress=50) However I can't seem to figure out how to use the pymel version of this. This is…
Shannon Hochkins
  • 11,763
  • 15
  • 62
  • 95
0
votes
2 answers

Converting 2 point coords to vector coords for angleBetween()?

I'm working on a PyMEL script that allows the user to duplicate a selected object multiple times, using a CV curve and its points coordinates to transform & rotate each copy to a certain point in space. In order to achieve this, Im using the…
gh057
  • 3
  • 5
0
votes
2 answers

How to query Maya in script for supported file translator plugins?

I'm trying to specify an FBX file in MEL using the command file -f -pmt 0 -options "v=0;" -typ "FBX" -o on one computer this works great. On another, it fails but DOES work if I use -typ "Fbx" I think I'd like to query for the supported…
0
votes
1 answer

PyMel in Sublime Text 2 on Mac

I want to start programming for Maya and I want to setup Sublime Text 2 for PyMel on my Mac. I tried a few tutorials, but it hasn't worked yet. I installed SublimeCodeIntel and get familiar with it, but I don't know exactly how to add a new…
Protothomas
  • 79
  • 10
0
votes
2 answers

runtime error in pymel

import maya.cmds as cm import random as random myList = cm.ls (sl = True) class MovingObjects: def up(*arg): for objects in myList: cm.move(0,0.5,0 ,r = True) def down(*arg): for objects in myList: …
Amin Khormaei
  • 379
  • 3
  • 8
  • 23
0
votes
1 answer

Trying to create a bake substance script in maya pymel

I have been trying to figure out how to script my own bake script for substance materials to files in maya, or find some documentation somewhere that gives me the commands and the format it should be used in. Has anyone made a script using the…
Daniel
  • 295
  • 1
  • 3
  • 5
0
votes
2 answers

Error Using aimConstraint Maya Python Pymel

I have a field of Spot Lights and am trying to use pm.aimConstraint to link their target to a locator (called "Light Point"). Here's the section that I'm struggling with and the error it gives me: import pymel.core as pm aimTarget = "Light…
0
votes
2 answers

import python into pymel

I was working on my Auto-Rig script and noticed that the code was getting long making it hard to read and focus on one part. I was looking into importing a python file and call the functions inside the python file that was imported. Can't seem to…
0
votes
2 answers

Calculating the rotation axis of Sphere faces

I'm building a Sphere from scratch in Maya, rather than creating faces using the spheres vertex list I need to make a plane and rotate it so it would match a regular spheres face. My idea was to get the center angle between the Sphere's face…
David
  • 33
  • 4
0
votes
3 answers

PyMel Rotate Raises Error

I want to randomly rotate a list of objects on a given axis with a random amount retrieved from a specified range. This is what I came up with: import pymel.core as pm import random as rndm def rndmRotateX(targets, axisType, range=[0,180]): for…
0
votes
1 answer

Fixing PyMel import error "pop from empty list"?

Im using PyMel to write up some tools, but as of yesterday my PyMel modules won't source, due to an error that I get during import: import pymel.core as pm # pymel.core : Updating pymel with pre-loaded plugins: OpenEXRLoader, DirectConnect,…
-1
votes
1 answer

How are attributes accessed in PyMEL?

There are multiple ways to access attributes of a PyNode such as Transform, which has the attributes translation, rotation and so on. import pymel.core as pm cube =…
akuzminykh
  • 4,522
  • 4
  • 15
  • 36
1 2 3
12
13