python,maya
So I'm basically trying to create a textField in which users type in a startFrame and endFrame and it scales it by the value in the slider. So, I have this, for the floatFields. cmds.text( label='Start Frame' ) startFrame = cmds.floatField() cmds.text( label='End Frame' ) endFrame = cmds.floatField() So, from...

syntax-error,maya,mel
i don't normally script in mel as my knowledge on it is very limited. I have made a expression however it keeps coming back with // Error: Line 7.1: Syntax error // Here is the expression: if (global_IkFk_Ctr.L_Arm == 0){ l_Bn_ShoulderJnt_01.scaleX == l_Ik_ShoulderJnt_01.scaleX; l_Bn_ElbowJnt_01.scaleX == l_Ik_ElbowJnt_01.scaleX; } else (global_IkFk_Ctr.L_Arm ==...

python,nodes,maya
I'm trying to update some attribute values in Maya via code and I'm having a really tough time accessing them. I need the attributes displayed name, (I'm pretty sure this is supposed to be their 'Nice Name'), but I can't seem to get them in any way. Using listAttr or...

python,maya
I am currently having a problem where i want to query the 'inputX' of a multiplyDivide Node in maya and put the queried number into the 'inputX' of another multiplyDivide node. The script currently makes an stretchy IK set up for an arm. Using a distanceBetween the shoulder and the...

python-2.7,textfield,maya,pymel
I've realized that there were similar questions located here: textfield query and prefix replacing and here: Python - Change the textField after browsing - MAYA However, these do not address the issue if you have two definitions and need the text in the textField to be queried (actually CHANGE the...

python,python-2.7,maya
This is a naming script that i use to name nodes in Autodesk Maya. This particular script however doesnt use anything maya specific. I had asked a while ago how I would go about doing something like this, where a variable convention could be used, and templating came up. So...

c++,plugins,nodes,maya
In a cpp plugin I am developing in Maya API, I register a custom MPxTransform Node in the initializePlugin function: status=pluginFn.registerTransform("mympxtransform", myMPxTransformClass::id, &myMPxTransformClass::creator, &myMPxTransformClass::initialize, &myMPxTransformMatrixClass::creator, myMPxTransformMatrixClass::id); And then create the node programmatically: MDagModifier mdagmod; MObject MyMObject; MyMObject=mdagmod.createNode("mympxtransform",MObject::kNullObj,&status); I can see the node properly created in the...

python,maya
The Plan: I've been working on a script for measuring the distance between 2 vertices that the user selects and scaling up or down that the object based on a desired length between those vertices. The Problem: Error states that it cannot locate the textFieldButtonGrp object that I create in...

python,maya,attributeerror
I'm getting this error for line 65 of my Python code in Maya within the pasteTheseKeys method: self.offsetVal = mc.intFieldGrp(self.int_offset, q=True, value1=True) pasteTheseKeys is called when the "Paste Keys" button is pressed. That relationship is defined in the commonButtons method. The complete code: # Animation Copy Tool # Bakari Holmes...

python,string,list,unicode,maya
I'm starting to use objects a bit more to store Maya commands in Python. This is super useful! But I've run into a problem. Sometimes objects get commands that return Unicode lists rather than a string. Even using str() doesn't work. Code: cubeParent = cmds.polyCube(sx=10, sy=15, sz=5, h=20) print cubeParent...

variables,maya,mel
Is it obligatory in MEL to initialize variables and especially strings when you declare them? I know that it is not necessary to initialize string arrays: string $buffer[]; $buffer[0] = "abc"; But what about strings and other variable types? Is it acceptably: string $str; $str = "abc"; Or should always...

python,python-2.7,polygon,maya,pymel
I'm trying to figure out a way to create an auto-completing "Create Polygon Tool" in Maya, in Python. It's so when you build geometry, it will select the previous geometry, and the current one you made, and run a line of commands. I've run into a snag, though, in which...

python,maya,mel
I'm new to MEL script and working on dealing with batch render of massive files(over 10000) with MAYA, the basic prototype is like this: import maya.mel as mel import maya.cmds as mc mc.file("D:/render/abc.mb",i=True) mel.eval('RenderIntoNewWindow;') mc.renderWindowEditor('renderView' , e=True , wi='D:/render/abc') This is a simple script which contains three commands: import, render,...

python,maya
I am trying to import multiple object files in maya using python and use the file name as object name in maya. I have managed to import the objects, but I have only been able to use the file name as a namespace and not as a object name. import...

c++,plugins,mesh,maya
I want to get a shape/mesh object under a transform node active in Maya. If I select and object (e.g. a poly sphere) in Maya, when calling getActiveSelectionList method, it returns a transform node, not a shape/mesh one. I'm getting crazy reading the API classes (MDagPath, MSelectionList, MFnDependencyNode) and methods...

python,expression,maya
In this maya scene file of mine, when scrubbing through the time slider, I keep getting the following error: // Error: An execution error occured in the expression stabilizator_expression_mom_bq01_v2_original_2Shape6. // Upon opening the editor, this is the full error: # Error: line 0: No module named mmTools.v1_0.ford_stabilizerStereo # Traceback (most...

python,maya
I am writing unit tests for a script that sends python code to Autodesk Maya trough the commandPort. The script works; it sends code fine to Maya which executes it. For testing purposes however, I want to write a unit test that in its setUp() opens a standalone (commandline) Maya...

python,animation,scripting,maya,keyframe
I need help doing the following: Using the keyframe method (and flags) to extract information from a selected set of keys to store them in a nested dictionary. These keyframes correspond to an animation that has the all the keyframes copied for pasting onto other joints as needed. I've been...

python-2.7,maya,xlrd,xlwt,pymel
Good evening SE'ers, I've got a question that has been bugging me for the last twenty-four hours. I've read up on the issue and my issue seems to be just plain stupid. So, I must be doing something wrong. FIRST I'm using xlrd, xlwt and xlutils to create an excel...

python,maya
I would like to know how I can get the line of the warning when I use pymel.core.warning() (or maya.cmds.warning()). I try to add the argument showLineNumber = True but nothing changed. I only have got this warning : # Warning: The 'showLineNumbers' flag is obsolete and will be removed...

python,maya
I get info that reads like this xy123, xy0123, xyz_123, and xy01 XYZ being different letters and 123 being different numbers. For example QWA_0230. I get letters and numbers any amount seperated by a _ sometimes. I'm interested in a line of code that will find the letters at the...

qt,signals,pyside,maya,slot
I'm about 2 weeks into PySide and I'm loving it, but I'm having trouble understanding some of the more intermediate concepts. Any help would be greatly appreciated. I'm trying to get a few custom QEvents working in PySide with QLineEdit and QCompleter. I'm using the old style for signal/slot connections...

python-2.7,subprocess,stdout,maya
in python 2.7 i try this code to get data from Deadline software. Its return some data from server... import subprocess path = 'C:/Program Files/Thinkbox/Deadline7/bin/' p1 = subprocess.Popen([path + 'deadlinecommand.exe', 'pools'], stdout=subprocess.PIPE) p1.communicate() and see result: ('none\r\npool_01\r\npool_02\r\npool_03\r\npool_04\r\npool_05\r\npoolhalf\r\n', None) but when i copy that code to python in maya 2014 i...

python,maya
I would like to know if there is a way to get the list of attributes that we can get with pymel.core.getAttr() (or maya.cmds.getAttr() for cmds users). __dict__ doesn't give that list. import pymel.core as pmc myCubeTrans, myCubeShape = pmc.polyCube() >>> print myCubeTrans.__dict__ {'__apiobjects__': {'MDagPath': <maya.OpenMaya.MDagPath; proxy of <Swig Object...

python,maya,mel
I have a button which imports a module with a class. The class (varClass) creates a window. If i click the button once again, i try this: if var: var.toggleUI() else : var = varClass() But var doesn' exist the first time you create the window after opening Maya. How...

maya,autodesk
What I have been researching with no luck, is how to get Autodesk Maya to communicate though the web on the localhost ip (preferably TCP). My goal is to control maya with a quick java application I wrote to manipulate curve selecting and such. If there is a way to...

python,graphics,3d,maya,maya-api
I am trying to write a python script for Maya that will copy keyframes from one rig to another. I have found objects and matched them up. What I am trying to do now is copy the keys from the original objects if the original objects have keys to be...

python,decimal,scale,maya,arbitrary-precision
Maya commands library seems to dislike working with the built in decimal module in python. I am trying to scale an object by an arbitrarily large float for precision. As far as understanding that you can't scale by a decimal 'object' is clear. ive been trouble shooting the math and...

python,save,maya
I am trying to write up a script on incremental saves but there are a few hiccups that I am running into. If the file name is "aaa.ma", I will get the following error - ValueError: invalid literal for int() with base 10: 'aaa' # and it does not happens...

python,matrix,maya
Does anyone know how to calculate maya's roll matrix with pivot (post projection matrix)? The best I can get at the moment is this: import math import maya.cmds as cmds import maya.OpenMaya as OpenMaya import maya.OpenMayaUI as OpenMayaUI # Get active view. view = OpenMayaUI.M3dView.active3dView() # Get camera MFnDagPath. dagCam...

c++,events,callback,message,maya
I am currently developing a Maya plugin. How can I set-up a callback that gets fired each time the frame number / current time is changed in the scene ? I had a look at the MSceneMessage Class, but it doesn't seem to contain what I am looking for....

python,function,user-interface,maya
I am working on creating a little Bullet Spray Generator to be run in maya using Python and I'm stuck on how to take the values inputted by the user in the UI and use them in functions. The bulletSpread function needs to take the value from createGunUI, specifically the...

python,nodes,maya,mel,addattribute
I've been looking around the internet for a solution but to no avail. I am currently trying to add a compound attribute that is index based (i.e. "object.attribute[0], object.attribute[1], object.attribute[2], etc...) similar to how vertex and uv attributes are used. Looking through the documentation it seems that there is no...

python,maya,qtreewidget
sorry if my following question sounds stupid but I am pretty much in a lost, big way! I have created 2 UIs using the Qt-Designer. Main UI (anmgToolUI) - http://pastebin.com/raw.php?i=eXVWj99Q Sub UI (publishInfoUI) - http://pastebin.com/raw.php?i=KsnJC8wR And the following is the main code: Main Code - http://pastebin.com/mbg2fuvh And I am using...

python,maya,pymel
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 nicely when...

python-2.7,pyside,maya,super
Ok so I'm having a bit of a problem with the code below. It works as is but if I try to change the part with the comment about me not being able to get super to work correctly to. pipeline_class_call = super(Error_Popup,self) broken_file_w_whats_wrong = pipeline_class_call.whats_wrong_with_file() or to broken_file_w_whats_wrong =...

python,list,indexing,maya,vertices
I got the code working like this until i realized that the vertex index changes for geometry with over 100 vertices... I assumed i could just split the string and everything would be dandy import maya.cmds as mc selPoints = mc.ls(sl = True) # list of names of selected vertices...

python,user-interface,maya
The Problem: I don't get any syntax errors when i run the script up until i try to build the UI. Everything seems fine until i run the last 2 lines of code. I get the following error : Error: RuntimeError: file line 41: Object's name 'mst_txtfld_x_value' is not unique....

python,python-2.7,methods,maya
I know there is a lot of topics on this subject, and I've looked at many. However it is still confusing to me when its appropriate to use static and class methods in place of an instance method. In my example, I'm making a script for the autodesk program maya....

python,list,maya,deselect
how do i deselect all objects except for my last selection? When I'm working with 2 objects there's no problem because all i have to do is toggle list[0] which would be first object that i selected (this is how i have it working below). import maya.cmds as mc sel_objs...