Hey - I was wondering if anyone here has tried to set a 'nurbsCurve'
attribute using setAttr (or, really, any of the shape attribute types
- I assume the syntax will be similar between them).

Ie, the docs have this example for mel:

createNode nurbsCurve -n "myNurbsCurveShape";
setAttr myNurbsCurveShape.cc -type nurbsCurve 3 1 0 no 3
6 0 0 0 1 1 1
4 -2 3 0 -2 1 0 -2 -1 0 -2 -3 0;

I would think that the python conversion would be:

import maya.cmds as cmds
cmds.createNode('nurbsCurve',n="myNurbsCurveShape")
cmds.setAttr('myNurbsCurveShape.cc',3,1,0,
        False,
        3,6,0,0,0,1,1,
        1,4,-2,3,0,-2,1,0,-2,-1,0,-2,-3,0,
        type='nurbsCurve')

but this results in:

# RuntimeError: Error reading data element number 7: 0

These don't work either:

import maya.cmds as cmds
cmds.createNode('nurbsCurve',n="myNurbsCurveShape")
cmds.setAttr('myNurbsCurveShape.cc', """3 1 0 no 3
6 0 0 0 1 1 1
4 -2 3 0 -2 1 0 -2 -1 0 -2 -3 0""",
        type='nurbsCurve')


import maya.cmds as cmds
cmds.createNode('nurbsCurve',n="myNurbsCurveShape")
cmds.setAttr('myNurbsCurveShape.cc', (3,1,0,
        False,
        3,6,0,0,0,1,1,
        1,4,-2,3,0,-2,1,0,-2,-1,0,-2,-3,0),
        type='nurbsCurve')


import maya.cmds as cmds
cmds.createNode('nurbsCurve',n="myNurbsCurveShape")
cmds.setAttr('myNurbsCurveShape.cc', [3,1,0,
        False,
        3,6,0,0,0,1,1,
        1,4,-2,3,0,-2,1,0,-2,-1,0,-2,-3,0],
        type='nurbsCurve')

...any ideas on how to get this to work in python?
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/python_inside_maya
-~----------~----~----~----~------~----~------~--~---

Reply via email to