How to use python (maya) multithreading

I've been looking at examples from other people but I can't seem to get it to work properly. It'll either use a single core, or basically freeze up maya if given too much to process, but I never...

Convert pyQt UI to python

Is there a way to convert a ui formed with qtDesigner to a python version to use without having an extra file? I'm using Maya for this UI, and converting this UI file to a readable python version...

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...

Is there a way to indent Python without affecting the code

I'm trying to write a user interface in Maya, and it's getting incredibly confusing with multiple levels of parents and no indents. The basic code (without any functionality) is currently around...

Maya Python modules complete documentation?

I've started using Python to script Maya for a school projet but i'm facing a problem with the documentation : I can't find anywhere a complete documentation of all the modules classes and...

Extract information from Excel with python 2.7/ pyMel?

I know this is asking a lot, but I have researched quite a few ways on looking up a column or looking up a row using python within an excel document. However, these solutions require you to import...

You need a shiboken-based type

When i run the code i get the following error line 11: You need a shiboken-based type. Not sure what i am doing wrong here . When i run just the GetMayaWindow() its runs properly but when run it...

set render images path in maya by python

I want to render images in specific location in Maya 2015. for that i want to set the image output path by python (pymel or cmds). import maya.cmds as cmds import pymel.core as pm path = ...

PyMel - urllib2 400 Bad Request when calling from function

I apologise if the titles too vague. In Maya (PyMel) im calling a function below to draw a login screen def ms_ui(self): logged_in = False if not logged_in: login_col =...

Maya python FBX export?

I am trying to convert an .obj file to fbx with maya's python interpreter in a docker image. I have tried the following 3 commands and none seem to work. In the docker image I mayapy is the python...

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...

how can I stop "for loop" in the "run_script" file, when "file_a" doesn't open the file

i'm working on a "python script" in "MAYA", when i use "pm.fileDialog2" and when i click the exit button, the loop script is still running, i want when i open the file and click the close button...

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...

How to select a random value from a list?

I am trying to select one item from the list below but my list = RN.choice(xyz) currently selecting everything in xyz list so can you guys please give me a tip on how to solve it? import maya.cmds...

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...

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...

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...

get list of external files with maya

I am looking for a way to list every external file existing in my scene(already open) without the use of a reader. I've invastigate the pymel doc and could'nt find what i was looking for. I want...

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 =...

Setting a hotkey for a custom runTimeCommand in Maya

*My goal:* Set up a simple class to add some keyboard macros to Maya at startup. *My Issue:* The intended key mappings are not set in the hotkey editor. Editing them manually does work, but as...

(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...

Maya Python: Renaming object with for loops

so I've been watching the Josh Sobel Python Scripting tutorial and I've been trying to get For loops to work on certain functions: Like when you use nHair to create a ribbon spine using hair...

Maya Python // Error: No object matches name, result of For Loop

So I've been playing around with for loops in Maya: but I've run into a peculiar error: after I try to run my script apparently an error appears in line 72 saying "// Error: No object matches...

Pymel: How do I close For loop after deleting null groups?

As I continue to study For Loops: I've run into some annoying errors. The problem is the script does exactly what I want it to. It deletes the null groups under the demo joints: but unlike other...

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...

Unable to open scene with Mayapy using Maya2020

I'm having an issue concerning mayapy. I'm trying to open and tweak a scene using mayapy, but its coming up with a fatal error and crashing. The scene has Vray/Arnold/Bifrost plugins loaded....

Maya – Why Print method can't be executed after Clear History command?

cmds.scriptEditorInfo(clearHistory=True) print("hi") The top line clear's the Maya Script Output window, and then the line below that is supposed to print hi. But when you run this, it flashes...

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)...

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...

Get Animation start and end keyframes in Maya Standalone (No User Interface)

I'm trying to get the first and last keyframes of an animation using Maya Standalone. If you're unsure, Maya Standalone means no User Interface. This is all purely command line and Maya is not...