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

How to create a .bat file that starts Maya and calls a python script at startup using evalDeferred?

I'm attempting to run a python script that creates a custom menu inside Maya when a .bat file is opened to start Maya. The python script is not inside the Maya project and I wanted to add the path in the batch file. I have this in the .bat…
0
votes
1 answer

convert mel curve script into python

hello I want to convert this Mel script into a python script so I can build on top of it. global proc motionTrailToCurve() { $selected=`ls -dag -et snapshotShape`; for ($obj in $selected) { $pts=(getAttr($obj+".pts")); …
NinjaBX
  • 11
  • 2
0
votes
1 answer

How can i query the undoInfo in a python string in maya?

I'm developing a tool for maya and would like to query the undo history in a python string to process it. I've found that undoInfo( q=True, pq=True ) displays the undo history in maya's script console, but doesn't return anything so i can't store…
0
votes
1 answer

Python parent objects within 1 list

I have a bit of an issue with parenting joints which are in one list. spineJn = ['spine_IK_Jnt_A', 'spine_IK_Jnt_B', 'spine_IK_Jnt_C', 'spine_IK_Jnt_D', 'spine_IK_Jnt_E', 'spine_IK_Jnt_F', 'spine_IK_Jnt_G'] So, i need to make a joint chain out of…
Val
  • 11
  • 4
0
votes
1 answer

Add object to an existing lattice deformer Maya

I’m currently stuck with as silly problem. I’m writing a re-build script for one of the characters and I need to write a command in python Maya to add a model to already existing lattice deformer. Is there a way to do this? I know that if I were to…
Val
  • 11
  • 4
0
votes
1 answer

(Maya Python) How do I run radio option buttons through a GUI function?

Normally when I run a script with radio button options you select a radio button option and then you activate it with the button. I used to leave my menu gui outside of a function: but ever since I learned importing maya scripts I started wrapping…
Dasteel
  • 101
  • 18
0
votes
1 answer

I am having trouble rotating an object in my Pymel code

I am writing a python program to replace all the walls I currently have in a Maya scene. The program should duplicate an existing wall I have in the scene, then replace every wall in the scene with it. The script properly duplicates the desired wall…
0
votes
1 answer

pymel how to get right type of selected node

I'm starting exploring python in maya (pymel) and I have a problem with getting right type of selected object. In outliner I have selected camera but when I'm executing code below it's returning type "transform". How to get right type…
Websterek
  • 39
  • 5
0
votes
3 answers

Transferring a mesh from one process to another in PYTHON

I've been cracking my head over this but nothing comes to my mind yet. I want my script to execute a .py file inside of another already started process. I have a maya process opened, and inside for example modo I want to start file hello.py (print…
0
votes
1 answer

how do i link the UVs from a custom UVset to a texture in Maya using pymel (or maya.cmds)

I'm writing a tool that will help make me make custom uvSets on a model that will be linked to ramps(no interpolation) that will be sent to vray_extraTex render elements. these will become mattes and used in the same way as vRay multi mattes.…
mr.matt
  • 51
  • 3
0
votes
1 answer

How "pickle" works on py-mel?

I'm trying to store some variables with pickle using python on Maya, but I'm having some problem. The error that shows up is: # Error: IOError: file -maya console- line 6: 13 # that's what I've tried: import maya.cmds as mc import pickle names…
0
votes
1 answer

Is there any way to export the specific object based on its name with Python in Maya?

Working on a batch exporter that is able to export different objects into different files at the same time (with one button). I am using cmds.file or mel.eval('FBXExport') to export the fbx files. I got trouble with exporting a specific object…
ZTZML
  • 11
  • 1
  • 5
0
votes
1 answer

MItSurfaceCV, how to get Indices?

I'm trying to get the SurfaceCV indices from a NurbsSurface. When I use the MItSurfaceCV class I get too few indices. My Code till now, with a NurbsSphere selected: sel = om.MSelectionList() om.MGlobal.getActiveSelectionList(sel, 0) dg =…
FzudemAA
  • 3
  • 4
0
votes
0 answers

Is there a way to analyse and print objects' inputs in maya?

I want to write a tool that would analyze selected mesh to see whether they have deformer inputs, and then print the result. To be honest, I'm not quite sure as to how to approach this. I had an idea of checking objects inputs. Then I'm not sure…
Val
  • 11
  • 4
0
votes
1 answer

maya.cmds Dialog to end script

I would like to end an entire script once an attribute has not been found. Currently, I have the following code. I display a dialog and use sys.exit() to end the script but I m wondering if there is a cmds dialog that does this automatically for you…
burned_fenrir
  • 138
  • 2
  • 13