Maya Python Bug Tracker
Comments
 Share
The version of the browser you are using is no longer supported. Please upgrade to a supported browser.Dismiss

 
$
%
123
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
|
 
Still loading...
ABCDEFGHIJKLMNOPQRSTUV
1
CommandDescriptionStatusDetailsCategoryNotesLink
2
295014pointLight, spotLight, directionalLight, ambientLightreturned name of the light incorrect when using name flagreturned name of the light incorrect when using name flagreturned name of the light incorrect when using name flagprint cmds.pointLight(name='foo')maya.cmds
3
378192MFnNurbsCurveMFnNurbsCurve fails with an empty curve objectNot Fixed2011cmds.file(new=1, f=1)
shapeStr = cmds.createNode('nurbsCurve', n="RigWorldShape")
selList = om.MSelectionList()
selList.add(shapeStr)
node = om.MObject()
selList.getDependNode(0, node)

mnc = om.MFnNurbsCurve()
assert mnc.hasObj(node)
mnc.setObject(node)
maya.OpenMaya
4
378211orientConstraintNot Fixed2011import maya.cmds as cmds

cube1 = cmds.polyCube()[0]
cube2 = cmds.polyCube()[0]

oc = cmds.orientConstraint(cube1, cube2)[0]
cmds.orientConstraint(oc, q=1, offset=1)

newOff = (12, 8, 7)
cmds.orientConstraint(oc, e=1, offset=newOff)
print "newOff :", newOff
queriedOff = tuple(cmds.orientConstraint(oc, q=1, offset=1))
print "queriedOff:", queriedOff
assert tuple(newOff) == tuple(queriedOff)
maya.cmds
5
344037selectselecting .uv[*][*] returns the incorrect rangeNot Fixed2010Running:

import maya.cmds as cmds
cmds.sphere()
cmds.select('nurbsSphere1.uv[*][*]')
print cmds.ls(sl=1)
cmds.select('nurbsSphere1.u[*][*]')
print cmds.ls(sl=1)

Gives two different results:
[u'nurbsSphere1.u[0:4][0:1]']
[u'nurbsSphere1.u[0:4][0:8]']
maya.cmds
6
285661connectAttrforce flag ignoredNot Fixed2009, 2011cmds.connectAttr( 'persp.tx', 'persp.ty' );cmds.connectAttr( 'persp.tx', 'persp.ty', f=1 )maya.cmds
7
285853getAttrmaya returns vector results as a tuple in a list ( ex. '[(1,2,3)]' )Not Fixed2009, 2011print cmds.getAttr( 'persp.translate' )maya.cmds
8
295052jointwhen queried, stiffness*, and angle* flags return lists instead of single valuesNot Fixed2009, 2011cmds.joint(n='joint1'); cmds.joint(n='joint2'); print cmds.joint( 'joint2', q=1, stiffnessX=1 )maya.cmds
9
addAttr / setAttrnon-storable attributes on referenced files have values storedNot Fixed20091. Create a non-storable attribute on a node
2. Save the file, then in a new scene, reference it in
3. Alter the value of the non-storable, referenced attribute
4. Save the referencing file, re-open it
5. The altered value of the non-storable attribute is saved
http://groups.google.com/group/python_inside_maya/browse_thread/thread/e14d126692f674aa/cf98c48831a9e3f4?lnk=gst&q=storable#cf98c48831a9e3f4
10
286169aimConstraint, normalConstraint, etc when queried, upVector, worldUpVector, and aimVector return the name of the constraint instead of the desired valuesFixed2009cmds.aimConstraint( 'persp', 'top' );print cmds.aimConstraint('top',q=1,upVector = True)maya.cmds
11
296039All UI Commands with callbacksui callbacks are passed strings instead of proper types (bool, int, float...)Not Fixed2009maya.cmdsFixed in 2011
12
any command when fed the name of a manipulatorTrying to execute a script command on a manipulator will give a "delayed" TypeError
(see 'link' column for details)
Not Fixed2009cmds.createNode("textButtonManip")
# Result: Manipulator2#
cmds.nodeType("Manipulator2") # This causes the error...
import sys # ...but it's not triggered until the next statement!
maya.cmdsunconfirmed; maya 2009 unknownPython_inside_maya post
13
347571bakeResultsbakeResults crashes if it tries to bake refNode.placeHolderList[x] attrNot Fixed2009import maya.cmds as cmds
import os

refFile = os.tempnam(None, 'tempRef') + '.mb'
cmds.file(new=1, f=1)
cmds.polyCube()
cmds.file(rename=refFile)
cmds.file(save=1, type='mayaBinary')
try:
cmds.file(new=1, f=1)
cmds.file(refFile, r=True, type='mayaBinary', namespace='ref' )
ref = cmds.file(refFile, q=1, referenceNode=True)
attr = 'ref:pCube1.tx'
lyr = cmds.animLayer('testLayer', attribute=(attr))
cmds.file(unloadReference=ref)
print cmds.animLayer(lyr, q=1, attribute=True)
finally:
os.remove(refFile)

cmds.bakeResults(cmds.animLayer(lyr, q=1, attribute=True),
simulation=True, bakeOnOverrideLayer=True, sampleBy=1, time=(1,24))
maya.cmds
14
295018instancername of newly created instancer is not returnedFixed2009print cmds.instancer()maya.cmds
15
M*Message.add*Callback"swig/python detected a memory leak of type 'MCallbackId *', no destructor found." appears whenever adding a callback from pythonNot Fixed2009id = MNodeMessage.addNodeAboutToDeleteCallback(getMobj('bornToDie'), pythonCallback, None)
# call id.disown() to fix
maya.OpenMayaconfirmed. Fixed in 2011http://groups.google.com/group/python_inside_maya/browse_thread/thread/31a9100785d1f206
16
340484MDagPathArray iterator doesn't terminateMDagPathArray iterator doesn't terminateNot Fixed2009import maya.OpenMaya as om
sel = om.MSelectionList()
sel.append('persp')
sel.add('persp')
dag = om.MDagPath()
comp = om.MObject()
sel.getDagPath(0, dag, comp)
dagArray = om.MDagPathArray()
dagArray.append(dag)
dagArray.append(dag)

numElements = 0
for dag in dagArray:
numElements += 1
if numElements > 10:
print "Oh noes!"
break
maya.OpenMaya
17
331854MFnDoubleIndexedComponent.create kSurfaceFaceComponent not compatible with MFnDoubleIndexedComponent.create Not Fixed2009import maya.OpenMaya as api

dubComp = api.MFnDoubleIndexedComponent()
if dubComp.hasObj(api.MFn.kSurfaceFaceComponent):
print "MFnDoubleIndexedComponent COMPATIBLE with kSurfaceFaceComponent"
else:
print "MFnDoubleIndexedComponent NOT compatible with kSurfaceFaceComponent"

# Fails even though it's compatible...
dubComp.create(api.MFn.kSurfaceFaceComponent)
maya.OpenMaya
18
MFnPlugin.registerTransformwhen calling registerTransform, cannot use the default transformation matrix - must always derive a custom MPxTransformationMatrixNot Fixed2009
matrixID = MPxTransformationMatrix.baseTransformationMatrixId.fget()
mplugin.registerTransform( name, nodeID, creator, initializer, MPxTransformationMatrix.creator, matrixID)
maya.OpenMayaMPxconfirmed; maya 2009 unknownPython_inside_maya post
19
331947MFnUInt64ArrayData.createMFnUInt64ArrayData.create returns kIntArrayData obj, not kUInt64ArrayNot Fixed2009import maya.OpenMaya as api

myInt64ArrayData = api.MFnUInt64ArrayData()

# Try create with no args:
mobj = myInt64ArrayData.create()

# Will print kIntArrayData, not kUInt64Array
print mobj.apiTypeStr()
# Fails, because mobj isn't kUInt64Array
try:
myOtherInt64ArrayData = api.MFnUInt64ArrayData(mobj)
except:
print ".create() failed!"

# Try create with MUint64Array arg:
myInt64Array = api.MUint64Array()
mobj = myInt64ArrayData.create(myInt64Array)

# Will print kIntArrayData, not kUInt64Array
print mobj.apiTypeStr()
# Fails, because mobj isn't kUInt64Array
try:
myOtherInt64ArrayData = api.MFnUInt64ArrayData(mobj)
except:
print ".create(MUint64Array) failed!"
maya.OpenMaya
20
MNodeMessage.addNodeDirtyPlugCallbackunable to add a callbackFixed2009api.MNodeMessage.addNodeDirtyPlugCallback(getMobj(nodeName), plugDirtyCallback, None)maya.OpenMayahttp://groups.google.com/group/python_inside_maya/browse_thread/thread/7c672343fddd36ce
21
redo / autoKeyframecannot redo past an undone autoKeyframeNot Fixed20091. Make a cube (or any object, really)
2. Set a keyframe on it
3. Make sure autokey is on
3. Rotate the cube
4. Translate the cube
5. Undo 4 times (since autoKey is it's own undo operation, this is
the number to restore the state before the first rotate - ie, undo
the autoKey, undo the translate, undo autoKey, undo rotate)
6. Redo until you can't
maya.cmds
22
315533scriptJobscriptJob with runOnce and parent flags will crash if script deletes ui that scriptJob is parented toFixed in 20112009cmds.window("theWindow")
def deleteWindow():
cmds.deleteUI("theWindow")
cmds.scriptJob(idleEvent=deleteWindow, parent="theWindow", runOnce=True)
maya.cmdsuncomfirmed
23
296178scriptTablegetCellCmd does not work with python object as callbacksNot Fixed2009maya.cmds
24
331663selectselecting all the edges of a freshly made subd causes a crashNot Fixed2009# Note - the following commands must be executed all at once in order to cause a
# crash. If you execute each command one at a time, no crash will occur.
import maya.cmds as cmds

polyCube = cmds.polyCube()[0]
subd = cmds.polyToSubdiv(polyCube)[0]
select(subd + '.sme[*][*]')
maya.cmds
maya.OpenMaya
# Crashes on adding subd to ANY MSelectionList...

import maya.cmds as cmds
import maya.OpenMaya as om

polyCube = cmds.polyCube()[0]
subd = cmds.polyToSubdiv(polyCube)[0]
selList = om.MSelectionList()
selList.add(subd + '.sme[*][*]')
25
329158shapeCompare shapeCompare will always return '1' when fed nurbs curves (and raises no exception, unlike subdivs)Not Fixed2009import maya.cmds as cmds
cube1 = cmds.polyCube()[0]
cube2 = cmds.polyCube()[0]
print "Cubes same?", cmds.shapeCompare(cube1, cube2)==0

circle1 = cmds.circle()[0]
circle2 = cmds.circle()[0]
print "Circles same?", cmds.shapeCompare(circle1, circle2)==0

subdiv1 = cmds.polyToSubdiv(cube1)[0]
subdiv2 = cmds.polyToSubdiv(cube1)[0]
print "Subdivs same?", cmds.shapeCompare(subdiv1, subdiv2)==0
maya.cmds
26
296041skinPercentquerying transform is brokenNot Fixed2009cmds.skinPercent("skinCluster1","pSphere1.vtx[200]", q=True,t=True); cmds.skinPercent("skinCluster1",q=True,t="pSphere1.vtx[200]")maya.cmds
27
300940unloadPluginaddCallback does not work with python object as callbacksNot Fixed2009def unloadCB( pluginName) : print "unloading", pluginName
cmds.unloadPlugin( addCallback=unloadCB )
cmds.unloadPlugin( 'rotateHelper' )
maya.cmdsFixed in 2011
28
os.environ not updated with maya
environment variables when using maya.standalone
Not Fixed2009

maya.standaloneconfirmed; Fixed in 2009 sp1
29
by default, cannot place python scripts in (for instance) ...\maya\2008\scripts, as sys.path does not have correct versioned user script dir addedNot Fixed2008 sp1/ext2 on Windows platformssys.path contains "[USERPROFILE]/My Documents/maya/2008-x64/scripts/"
should be ""[USERPROFILE]/My Documents/maya/2008-x64/scripts"
(note extra trailing slash)
Initializationunconfirmed; maya 2009 unknown; status on non-windows platforms unknown
30
315532scriptNodescriptNodes cannot be used with python callablesscriptNodes cannot be used with python callablessn = scriptNode( st=0, bs=lambda: 1 ); scriptNode( sn, eb=1)
31
BSPR-2547skinClusterinfluences list created in reverse order in maya 2013Not Fixed2013import maya.cmds as cmds
cmds.file(new=1, force=1)
sphere = cmds.polySphere()[0]
jnt1 = cmds.createNode('joint')
jnt2 = cmds.createNode('joint')
cmds.setAttr(jnt2 + '.translate', 1,0,0)
skinName = 'skinCluster1'
bones = [jnt1, jnt2]
newSkin = cmds.skinCluster(sphere, name=skinName, maximumInfluences=1, obeyMaxInfluences= False, toSelectedBones=True, *bones)
current = cmds.skinCluster(skinName,query=True,inf=True)

print "Influence lists same: ", bones == current
print "Influence lists reversed: ", bones == list(reversed(current))

maya.cmds
32
BSPR-2583fbx exportin some situations, when a scene has a nucleus node in it, it will fail to export a camera.

See the python code below to reproduce
2012# When the code below was run on a Linux box (other OSes behavior unknown), the camera would not be
# exported. However, if the line creating the nucleus node is removed, it works...

import os
import tempfile
import maya.cmds as cmds

if not hasattr(cmds, 'ls'):
import maya.standalone
maya.standalone.initialize()

import maya.mel as mel
if not cmds.pluginInfo('fbxmaya', q=1, loaded=1):
cmds.loadPlugin('fbxmaya')

fpath = os.path.join(tempfile.gettempdir(), 'cameraExportFbx.fbx')
cmds.file(new=1, f=1)
cmds.createNode('nucleus')
cam = cmds.createNode('camera')

cmds.select(cam)
melString = 'FBXExport -s -f "' + fpath.replace('\\', '/') + '"'
print melString
mel.eval(melString)

print "exported fbx to", fpath

cmds.file(fpath, open=1, f=1)

print "camera was exported?", cmds.objExists(cam)

33
Python Importing ModuleUsing script editor with python, and error is returned when trying to import python modules such as numpy.2013In order to instal numpy, you will need to do the following:

a) Edit distutils/msvc9compiler from python2.6.zip to add a ld_args.append('/MANIFEST') line
(Solution found on Google... This is probably due to Maya shipping a version of distutils that pre-dates MSVC 2010.)
b) Distutils was looking in the wrong path for Python's includes and libraries, so you need to manually copy them to the correct location (under runtime/Python/include and runtime/Python/libs)
c) Python2.6.lib didn't have read permissions. You have to manually set them.

d) It seems that we might have modified the file pyconfig.h in a non-standard way. Pyconfig.h indicates the python library provides replacement functions for asinh, acosh, atanh and log1p and yet, the python2.6.dll does not export such symbols leading to linking errors when compiling numpy.

Extract from Maya's provided pyconfig.h:
// Maya doesn't like a couple of these, as we have our own
//typedef int pid_t;

/* Define to 1 if you have the `log1p' function. */
#define HAVE_LOG1P 1
/* Define to 1 if you have the `acosh' function. */
#define HAVE_ACOSH 1
/* Define to 1 if you have the `asinh' function. */
#define HAVE_ASINH 1
/* Define to 1 if you have the `atanh' function. */
#define HAVE_ATANH 1

You then need to edit numpy source code to manually undefined these macros after including Maya's pyconfig.h file. You then need to recompile using VS2010sp1.
34
BSPR-5328nucleusnucleus node inherits from transform and dagNode, but is not compatible with MFnTransform or MFnDagNodeNot Fixed2012 (confirmed not working - 201217)
2013 (confirmed not working - 201300)
import maya.cmds as cmds
import maya.OpenMaya as om
nucleusName = cmds.createNode('nucleus')
sel = om.MSelectionList()
sel.add(nucleusName)
mobj = om.MObject()
nucObj = sel.getDependNode(0, mobj)

print "inherits from transform: ", 'transform' in cmds.nodeType(nucleusName, inherited=True)
print "compatible with MFnTransform:",
try:
om.MFnDagNode(mobj)
print True
except Exception:
print False

print "inherits from dagNode: ", 'dagNode' in cmds.nodeType(nucleusName, inherited=True)
print "compatible with MFnDagNode:",
try:
om.MFnDagNode(mobj)
print True
except Exception:
print False
35
BSPR-7679MSelectionListMSelectionList sometimes won't merge nodes correctlyNot Fixed2012 (confirmed not working - 201217)
2013 (confirmed not working - 201300)
# Execute in a python script editor

import maya.cmds as cmds
import maya.OpenMaya as om

# create a scene with a cone
cmds.file(new=1, f=1)
cmds.polyCone()[0]

list1 = om.MSelectionList()
list2 = om.MSelectionList()
list_temp = om.MSelectionList()

obj1 = om.MObject()
obj2 = om.MObject()

# add 'pConeShape1' to list1
list1.add('pConeShape1')
list1.getDependNode(0, obj1)

# add 'pConeShape1.f[0]' to list_temp...
list_temp.add('pConeShape1.f[0]')

# ...then get the depend node from list_temp, and add that to list2
list_temp.getDependNode(0, obj2)
list2.add(obj2)

# now, print out the selection strings, to show that list1 and list2 are
# the same...
print '=' * 20
print
selStrings = []
list1.getSelectionStrings(selStrings)
print "list1:", selStrings
list2.getSelectionStrings(selStrings)
print "list2:", selStrings
print

# now, try merging the lists, and see if they change...
print "list1 length, initial :", list1.length()
list1.merge(list2, om.MSelectionList.kRemoveFromList)
print "list1 length, after remove:", list1.length()
list1.merge(list2, om.MSelectionList.kMergeNormal)
print "list1 length, after add :", list1.length()
print

# confirm that list1 now has 2 refs to the same object, and that the mobjs are equal
list1.getSelectionStrings(selStrings)
print "list1 (after merges):", selStrings
print "Objects in list1 and 2 equal?", obj1 == obj2
36
BSPR-8058symmetryConstraint / MFnDagNodesymmetryConstraint nodes not compatible with MFnDagNodeNot Fixed2014 (confirmed not working PR24)import maya.cmds as cmds
import maya.OpenMaya as om
nodeName = cmds.createNode('symmetryConstraint')
sel = om.MSelectionList()
sel.add(nodeName)
mobj = om.MObject()
nucObj = sel.getDependNode(0, mobj)

print "inherits from transform: ", 'transform' in cmds.nodeType(nodeName, inherited=True)
print "compatible with MFnTransform:",
try:
om.MFnDagNode(mobj)
print True
except Exception:
print False

print "inherits from dagNode: ", 'dagNode' in cmds.nodeType(nodeName, inherited=True)
print "compatible with MFnDagNode:",
try:
om.MFnDagNode(mobj)
print True
except Exception:
print False
37
BSPR-8059parentparenting of duplicated shape crashes mayaNot Fixed2014 (confirmed not working PR24)import maya.cmds as cmds
cmds.file(new=1, f=1)
poly = cmds.polyCube(name='singleShapePoly')[0]
origShape = cmds.listRelatives(poly, children=True)[0]
dupeTransform1 = cmds.duplicate(origShape, parentOnly=1)[0]
cmds.parent(origShape, dupeTransform1, shape=True, addObject=True, relative=True)
dupeTransform2 = cmds.duplicate(dupeTransform1)[0]
cmds.delete(dupeTransform1)
dupeShape2 = cmds.listRelatives(dupeTransform2, children=True)[0]
cmds.parent(dupeShape2, poly, shape=True, addObject=True, relative=True)
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
Loading...
 
 
 
Bugs
Sheet3
Api Versions