So I almost have a simple plane created. It just isn't visible yet. I have it attached to the initial shading group so I don't think it is a light linking issue. Just not sure. As far as how node networks work,, hmm . I am concentrating on node networks that I have used regularly for a few years. And it is me learning the nuiances of this API.
So to interest you in my uninteresting work.. I am coding in python. (Badly of course, no undo or error checking).
import maya.OpenMaya as OM
dgModifier=OM.MDGModifier()
MESH=OM.MFnMesh()
FACECOUNTS=OM.MIntArray()
FACECONNECTS=OM.MIntArray()
FPA=OM.MFloatPointArray()
THISOBJECT=OM.MObject()
NV=4
NF=0
XPOINTS=[-1,1]
ZPOINTS=[-1,1]
for x in XPOINTS:
for z in ZPOINTS:
POINT=OM.MFloatPoint(x,0,z)
FPA.append(POINT)
TRANSFORM=MESH.create(NV,NF,FPA,FACECOUNTS,FACECONNECTS,THISOBJECT)
MESH.updateSurface()
dgModifier.renameNode(TRANSFORM,"MY_GEOMETRY")
dgModifier.doIt()
this_command ="sets -e -fe initialShadingGroup "
namepart=MESH.name()
this_command+=namepart
dgModifier.commandToExecute(this_command)
dgModifier.doIt()
DAGNODE=OM.MFnDagNode(TRANSFORM)
next_command="select "
next_command+=DAGNODE.name()
dgModifier.commandToExecute(next_command)
dgModifier.doIt()
The nodes appear and the manipulator is holding space...
I have some idea that this should work somehow soon, as I found a few code examples that were of this type of design. Such as polyPrimitiveCmd.cpp...
And I think I just need to append in the right INTARRAY values for FACECOUNTS, and FACECONNECTS
[in] polygonCounts array of vertex counts for each polygon. SO FACECOUNTS=[4]
[in] polygonConnects array of vertex connections for each polygon.
so FACECONNECTS=[0,1,2,3]
This gives me a parameter out of range which I don't follow yet.