code-google-com / pymel

Automatically exported from code.google.com/p/pymel
0 stars 0 forks source link

setAttr on a curve attribute results in warning #79

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
shape = createNode('nurbsCurve', n="RigWorldShape")
shape.cc.set(3,1,0,
       False,3,
       (0,0,0,1,1,1),6,
    4,(-2,3,0),(),(2,1,0),(),(2,-3,0),(),(-2,-1,0),(),
        type='nurbsCurve')

gives:
pymel.general : WARNING : Could not create desired MFn. Defaulting to
MFnDagNode.

Original issue reported on code.google.com by elron...@gmail.com on 16 May 2009 at 12:50

GoogleCodeExporter commented 9 years ago
that should read:

shape = pm.createNode('nurbsCurve', n="RigWorldShape")
shape.cc.set(3,1,0,
       False,3,
       (0,0,0,1,1,1),6,
    4,(-2,3,0),(),(2,1,0),(),(2,-3,0), type='nurbsCurve')

...but it does still result in a warning

Original comment by elron...@gmail.com on 13 Dec 2010 at 4:34

GoogleCodeExporter commented 9 years ago
This is due to a bug in maya - you cannot create an MFnNurbsCurve with and 
empty curve.

Reported as bug 378192

Example:

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

Going to set this as 'hold', as currently there is no damage done (an 
MFnDagNode is returned instead, but not saved), so a warning seems 
'appropriate' until autodesk fixes the bug.

Original comment by elron...@gmail.com on 18 Jan 2011 at 10:24