Hey Guys, I am updating my rigging modules so that all (or most) of the "maya.cmds" are replaced with "maya.OpenMaya" functions.
So far so good...
Though I find myself stuck on 2d nurbsCurves
All of my bendyArms, Muscles and faces involve using the command
"DuplicateSurfaceCurve" to create curves that live permanently within the 2d space of a nurbs surface
This has worked wonderfully up until now, but I would really like to learn how to build 2d "surface space" curves without resorting to the maya.cmds module..
Heres is my exploration of this topic un until now..
import maya.OpenMaya as om
#transform!
t = om.MFnDagNode().create('transform', 'i_am_a_thing')
#Plane!
point_array = om.MPointArray()
point_array.append(om.MPoint(*[-1.0,0.0,-1.0]))
point_array.append(om.MPoint(*[1.0,0.0,-1.0]))
point_array.append(om.MPoint(*[-1.0,0.0,1.0]))
point_array.append(om.MPoint(*[1.0,0.0,1.0]))
knot_aray_u = om.MDoubleArray()
knot_aray_u.append(0)
knot_aray_u.append(1)
knot_aray_v = om.MDoubleArray()
knot_aray_v.append(0)
knot_aray_v.append(1)
degree_u = 1
degree_v = 1
form_u = 1
form_v = 1
rational = False
s = om.MFnNurbsSurface().create(point_array, knot_aray_u, knot_aray_v, degree_u, degree_v, form_u, form_v, rational, t)
#Curve!
point_array = om.MPointArray()
point_array.append(om.MPoint(*[0.0, 1.0]))
point_array.append(om.MPoint(*[1.0, 1.0]))
knot_aray = om.MDoubleArray()
knot_aray.append(0)
knot_aray.append(1)
#Next line is where problems happen.
#I assume I should pass the MObject of the shape node as the parent
#and set "create2D" to True..
#Yet, no luck.... Parent seems to be invalid :(
curve = om.MFnNurbsCurve().create(point_array, knot_aray, degree_u, form_u, True, False, s)
Any insight would be valuable as f*&%K
thanks,
-Paxton