Arrays vs components vs dynArrays etc
This is still a bit murky, but its becoming a little clearer.
From what I remember of houdini, points are points are points. Maya and soup are a little more complex.
Components are sub objects like verts, faces, edges, CV's. , if you want to drive deformer membership, or a delete component node, or things that feed back into the maya domain, you're talking components.
Arrays are a soup specific thing. They're like per-particle attributes, but soupy.
DynArrays are maya dynamics, per-particle arrays. If you're fiddling with stuff to feed back into a particle system or nucleus, you'll be using one of these at the end of your soup network.
Where it gets confusing is starting with one thing, converting it to something else, then converting it back again.
Eg, I wanted to drive a copier node, but only make copies onto a few vertices, not the entire mesh. The copier input expects arrays. However to do selections you use a group, and groups use components. What to do?
A pointAttributeToArray node lets you take components and convert it to an array. So in this case the flow was
( mesh + boundingObject ) -> group -> pointAttributeToArray -> copier
I tried a simple thing of having a plane, and use a boundingObject to define a region, then use a displayComponents to see my selection. Took me ages to work out what I was doing wrong, here's the steps:
- Create your mesh
- Create a boundinObject, intersect it with the mesh
- Create a group node
- Create a displayComponents node (make sure the group node is NOT selected, otherwise it won't make the node)
- Connect plane.outMesh -> group1.inGeometry
- Connect boundinObject -> group1 (soup knows the connections to make
- Connect group1.outGeometry -> displayComponent.inGeometry
- Connect group1.outComponents -> displayComponent.inComponents
- You should now see all the components highlighted, but we just want the ones within the boundingObject. To do that...
- On the displayComponents node, change 'use components' to 'input component list'. Much better!
Group node to delete components
Another simple one, made sense in hindsight, but took a while until the 'aha' moment clicked.
- In a mel window, run 'createNode deleteComponent'. This'll do the delete operation, obviously.
- Run 'createNode mesh', to create an empty mesh that we'll use for output
- Connect group1.outGeometry -> deleteComponent.inputGeometry
- Connect group1.outComponents -> deleteComponent.deleteComponents
- Connect deleteComponent.outputGeometry -> polySurfaceShape.inMesh
- Hmm, no change. Maybe the other mesh and display nodes are getting in the way?
- Hide the original plane and the displayComponent node
- Still nothing. Turns out you can't delete verts, but you can delete edges and faces.
- On the group node, change 'component type' to mesh edges or mesh faces
- Success! You can scroll down on the group node and flip the 'invert' toggle to invert the delete.
- Move the boundingObject around, feel clever.