Hey guys,
I'm fiddling around with creating a custom node with the Python API that creates a polygon mesh like polyCube/polySphere does.
I surely can create Shapes within a command, but I can't get it to work as a DG node (at the beginning of the chain).
I simple example would be sufficient. The whole kMeshGeom, kMeshData stuff makes me suffer, the API Docs aren't really covering this stuff in a way I can follow it.
What I did so far is:
create a DG Node with a single float input value
i added an output value (kMesh)
in compute() I use MFnMesh to create a Mesh (based on the input value).
mesh = mf.create ( 3 , 1 , vtxArray, polygonCounts, polygonConnects )
mesh.updateSurface();
meshData=OpenMaya.MFnMeshData(mesh)
outputHandle.setMObject( meshData )
it kinda works, but always creates a new shape with a new transform.
do i have to get the "target" shape node from the plug to modify its data?
any help would be widely appreciated.
cheers,
Johannes