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

What does this PyMEL statment do?

This statment is from the book practical maya programming. The author later goes on to use xform and shape as arguments in type() and dir() functions which I understand. >>> xform, shape = pmc.polySphere() Why / how are both xform and shape…
shfury
  • 389
  • 1
  • 5
  • 15
1
vote
2 answers

How do I import PyMEL core?

I am importing maya.standalone, initializing it, and then importing pymel.core as pmc into my Maya Python interpreter, which is running in powershell. At this point I get a lot of warnings. After when I call: xform, shape = pmc.polysphere(), I get…
shfury
  • 389
  • 1
  • 5
  • 15
1
vote
1 answer

Create dynamic buttons in window

I'm trying to create buttons in a window depending on the number of lights that exist on the scene. When I press the create button I get this error ( # RuntimeError: No object name specified. # ) : Traceback (most recent call last): File…
Urd
  • 23
  • 5
1
vote
1 answer

Autodesk Maya project changed event (signal)

I am writing a project manager for Maya in PySide. It's purpose is to navigate through projects contents for quick accessibility. So I would like it to rescan newly set project directory automaticaly. As far as I know, there is no event like…
Kupnu4
  • 103
  • 1
  • 6
1
vote
1 answer

Creating own .obj exporter for maya

I am creating my own .obj exporter for maya. When i'm exporting just one mesh my code works just fine but when exporting several meshes / objects it fails to create the complete meshes. I'm pretty sure that the problem is when i'm getting the…
Rickard
  • 33
  • 7
1
vote
1 answer

How to find separate objects in a list of 3D coordinates

I started giving a basic voxel type script a shot, where it'll look in the 6 directions adjancent to a point n draw a plane across any side that doesn't have anything next to it. Then I can combine the planes and it'll make an object. This works…
Peter
  • 3,186
  • 3
  • 26
  • 59
1
vote
1 answer

Find closest point on mesh in specific axis (maya)

Let's say I have one locator above a polyPlane. What I want to do is a lookup or trace from the locator in negative or positive y until it hits the polyPlane and return the position of the closest point/vertex/uv/ I imagine this have been done one…
user2832718
  • 69
  • 3
  • 11
1
vote
2 answers

How to select geo when you have a component of that geo?

How do you get the name of a piece of geo when all you have is a component of that geo (uvs, faces, verts, edges)? so for example I have: MeshVertex(u'pCubeShape1.vtx[0]') #replace that with any of the following (uvs, faces, edges) and what I…
TheBeardedBerry
  • 1,636
  • 5
  • 20
  • 30
1
vote
2 answers

How to removeUnusedInfluences in pymel

I can't seem to find the command in PyMEL. How do you trigger the removeUnusedInfluences command on a mesh you have selected using PyMEL?
TheBeardedBerry
  • 1,636
  • 5
  • 20
  • 30
1
vote
2 answers

How to get edge indices from selection?

Is there's a way to get the indices properly from a Pymel/Maya API function? I know Pymel has a function called getEdges() however according to their docs this get's them from the selected face, however I just need them from the selected edges. Is…
Shannon Hochkins
  • 11,763
  • 15
  • 62
  • 95
1
vote
1 answer

Object starts with?

Is there a way to see if an object exists in Maya, but only search for a partial object name? Example, search for an object that starts with object, but it's actual name is object_001. Is there a way to do this? As it stands I only know how to…
Shannon Hochkins
  • 11,763
  • 15
  • 62
  • 95
1
vote
5 answers

Set attribute without string concatination

I'm wondering if there is a way to perform the following, I'm aware that to set say the translation of an object, in pymel it's as simple as this: object.translateX.set(1.5) and you can also set this using the 'setAttr' command: setAttr(object +…
Shannon Hochkins
  • 11,763
  • 15
  • 62
  • 95
1
vote
1 answer

Converting a string into a command using Pymel

I currently have a list of strings in which I need to convert into a command. IE: "checkerText.outAlpha" needs to be checkerText.outAlpha Is there a command that will convert a string into a command for pymel? I need this so I can connect two…
1
vote
1 answer

My .bat file wont read the lines after using `python`

I need to create a .bat file that a pymel script calls, I currently have this as my bat file: PATH C:\Python26 python from PIL import ImageGrab import time time.sleep(5) ImageGrab.grab().save("screen_capture.jpg", "JPEG") It stops reading the bat…
Daniel
  • 295
  • 1
  • 3
  • 5
1
vote
2 answers

How do I Get The Selected Object type

I need to basically query and perform a few tasks based on the current selection with PYMEL, example: from pymel.core import * s = selected() if (s.selType() == 'poly'): #do something if (s.selType() == 'surface'): #do something …
Shannon Hochkins
  • 11,763
  • 15
  • 62
  • 95