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

MAYA - Convert joints into locators and groups

I'm looking to set up two scripts (python or MEL) that convert joints to locators and joints to groups. However, once transformed, they must have kept their hierarchical position in the outliner, the same names, the same positions and the same…
Loïc
  • 1
0
votes
1 answer

Count the number of prints from a function on Maya 2020

So I am making a few scripts on Maya 2020 (python 2.7). At some point I need to run some functions that do bulk operations on different assets, and they all output what they do in the script editor. I.E when deleting unused materials, I use this…
L0Lock
  • 147
  • 13
0
votes
0 answers

ERROR in maya python code - empty separator

I'm working on a script that would export the file as an fbx. This script is a part of a python package. When I'm launching it, it errors out with a message: Error: ValueError: file…
0
votes
2 answers

Display selected object in UI

I'm a novice programmer and currently working on a script as a little task for myself. I'm stuck with a part of a script. I need to display the selected object name in a text field (https://i.stack.imgur.com/wbuIS.jpg) With the first button, you are…
0
votes
1 answer

Maya 2022 crashes while i run a python script

I am trying to create a menu, a submenu and an optionBox which lets the submenu item to create and remove itself from main menu. when I continuously try to add and remove the item from the main menu maya crashes with the message Fatal Error.…
aNup
  • 281
  • 1
  • 3
  • 14
0
votes
0 answers

Maya FBXImport replace certain string when importing FBX

I'm trying to import FBX to apply its animations onto the rig already in the scene. options = "targetTime=3;option=insert;match=string;selected=childrenToo;search=XXX;replace={};".format(prefix) …
0
votes
1 answer

How can I change the textScrollList depending upon the options I have selected in optionMenu in Maya?

` This is the function that i wrote the operation, where om = optionMenu def selection(*args): selected = cmds.optionMenu(om,sl=True, q=True) cmds.textScrollList(tsl, e=True, removeAll=True) for item in…
0
votes
0 answers

How are the world space coordinates of objects calculated in maya?

Now I have two objects, "A" and "B", and "A" is copy from "B" use "A = pm.duplicate(B)[0]", then I did connect attribute like: pm.connectAttr(someBSNode.outputGeometry[0], A.getShape().inMesh) and "A" somehow moved a little bit in my view ( I…
0
votes
2 answers

How to make cmds.duplicate() execute immediately when called in maya

How to make cmds.duplicate execute immediately when called in maya? Instead of waiting for the entire script to run and then executing it in batches. For example, for this script below, all execution results will appear immediately after the entire…
0
votes
2 answers

Convert MEL to python command

I am looking for a way to convert this MEL line mel.eval('cameraMakeNode 2 "";') into Python. I can't find anything in the documentation, is used to convert a camera to camera aim.
0
votes
3 answers

Maya 2023 pymel I can't access mel2py with python3

I get this error and I think it's because of python3 Error: AttributeError: file C:\Program Files\Autodesk\Maya2023\Python\lib\site-packages\pymel\tools\mel2py\melparse.py line 438: 'str' object has no attribute 'lineno' import pymel.tools.mel2py as…
teddude75
  • 33
  • 7
0
votes
1 answer

Query all object and attributes associated with Maya AnimLayers?

I can't seem to find a way to query all the attributes objects in animLayers using pymel in Maya. All avenues I've explored only output attributes or the layer names. I'm not very new to pymel but this is stumping me. I'm expecting to find the…
0
votes
0 answers

polyListComponentConversion in OpenMaya

I'm poking around in PyMel and OpenMaya trying to convert some pymel code. I was wondering if there is an OpenMaya equivalent of polyListComponentConversion from Pymel? Ultimately, I'm trying to convert my collected UV shells to faces like so. But…
0
votes
2 answers

Can't import pymel in Maya

I'm trying to import pymel from the script editor in Maya and since this morning it doesn't work. I've tried to do a clean uninstall for all Autodesk products and then re-install Maya again but it didn't solve the issue. When I'm trying to import…
0
votes
1 answer

Maya Python: TypeError: Object is invalid

So I have this code where I try to find if two meshes intersect or not: import maya.cmds as cmds import pymel.core as pmc mesh_list = pmc.ls(type="mesh") char_transform = pmc.listRelatives(mesh_list,parent=True) def vtxPose(mesh): …
galaxy
  • 53
  • 1
  • 1
  • 15