In the wonderful world of iterative looping Genome flows, I am wondering if it is possible to iteration through a routine that runs sequentially through an objects elements?
Can an element interrogate/be affected by neighboring elements in the same object?
For example (check out the attached screengrab) I want to create a explicit element Inflate mod:
Say I have an object with 7 elements – Can Genome select the first element and apply something akin to the limited push flow checking against all of the un-selected geometry?
In the second iteration, the second element runs the same deformation against a slightly different shaped object (the first element has been limited pushed against the remaining element).
So on and so fourth until it has cycled through all the elements.
Does this sound do-able? Or perhaps there is another way to accomplish the same effect?
In the attached screengrab, I basically did what I am describing ‘manually’ - I am hoping we could build a Genome mod that automates it.
This ALMOST works, but right now it is missing one detail.
If you create a flow that pushes by a small step and stops if it reaches another part of the mesh, then clone that Genome N times on the stack (similar to N iterations, but using independent cloned modifiers), it works nicely.
If you try to do a single modifier and set N iterations, it does not produce the correct result because the CurrentMesh node does not update between iterations in the current version of Genome. I have logged it as a bug/WishList item since it would be quite powerful. I think it should be optional so you can switch between updating once in the beginning and updating once per iteration (rebuilding the kd-tree with a very heavy mesh would be slow).
Very cool! Could you save back to max 2013 and post a scene file? Multiple iterations / versions of the genome mod in the stack woks better than the manual method I was using.
That is really cool. Can this same style of setup be used to soft-select when elements intersect? Bulge?
I’ve always thought that genome needed a separate object to test against - this opens some doors for sure!
Check out the attached video clip:
I took your flow and applied to a mesher pointing at a massFX Pflow with some spherical gravity and a little turbulence for churn.
This has 3 instances of that Genome Mod in the stack - Works like a charm!
In theory, anything you could do with multiple Genome instances on the stack should be doable with one modifier + iterations. CurrentMesh is, I think, and exception because it relies on a kd-tree of the mesh which is built only once in the beginning. Anything operating on actual channels though (Position, Selection etc.) would work. So soft-selection would probably work (but I am not sure what you are trying to do). This setup works because the vertices are NOT intersecting before we start. If they were already intersecting, it would be quite difficult to figure out what is where because it is hard to do a nearest point to a Vertex - it would find itself. IntersectRay works because I offset the initial ray position slightly off-surface along the normal to avoid self-intersection false positives.
Here is another example of how Stoke Genome Limited Push Same Mesh can do some pretty cool stuff to elements. Using massFX, I sim’d some shapes to get them packed together, then pushed them back against the current mesh. Very cool modeling tool for organic surfaces.
Try adding a Relax modifier on top to smooth it out a bit.
We are considering the inability to update the kd-tree between Iterations a bug and will try to fix it before release (which is scheduled for next week!)
I’m ‘Stoked’ to hear that the ability to update the dk-tree between iteration is on the short list. Sounds like it could open up some powerful possibilities!
I’m trying to build a flow that checks and selects verts that are ‘inside’ the volume of other elements within that same mesh. If you attached 2 geospheres that intersected, I want Genome to select (soft select) all of the verts that are inside/within the volume of another element.
Can Genome access or create a bounding box around elements - and then check if elements intersect?
Could you then test with intersectRay shooting from the normal and see if it crosses one vs. two faces on a neighboring element? (one meaning that vert is inside the other element -two meaning that it’s outside?)
If you shoot an IntersectRay and the Distance value has a negative sign, it means you hit a surface from the inside. So no need to shoot twice - just use < 0.0 on the Distance. There is also the InVolume operator that was meant to figure that out (but it does more tests and is thus slower).
Don’t forget to offset the Lookup Point slightly along the Normal, otherwise the vertex might find itself…
Right on - Thanks! I really appreciate you taking the time to make these flows.
Question - Could a loop be added to these flows that would ‘grow’ the selection outward? Would you put that loop at the very end of the flow, right before the output?
I’ve created a face growing flow from your tutorial, but have not tried it on the vertex level. Basically the same loop with a VertexLoopByFace?
Do you mean growing on vertices that are NOT inside the intersection?
Growing selections is possible with a separate Genome on top of your current Genome. Basically you iterate over the neighbor vertices with a VertexLoopByEdge and propagate the selection as needed. Then increase the modifier’s iterations to define how far you want to grow. Making it fall off as a soft-selection is slightly tricky, but doable.
I mean growing the vertices that are being selected by the element intersection flow.
So you’re suggesting that I add a second Genome mod to grow the selection rather than trying to pack it all into a single flow?
Check the attached vertex ‘grow’ flow - what am I doing wrong here?
Also - Could a flow be made to take an existing vert (or face) selection and add controllable / animate-able softselection from that selection?
It would be cool to have a flow that could grow/shrink selections that it receives from the stack AND you could turn on and adjust soft selections.
Yes, I don’t think you can do it in one flow because the flow you have does the selection, and you cannot have two different passes within the same iteration. You have an explicit loop over all vertices in the Genome modifier. If you would try to grow a selection, the intersection selection data wouldn’t be there yet to grow when you try to grow it. Thus the requirement for a separate “GrowSelection” modifier on top.
When inside a Loop, you MUST use the LoopChannel input node instead of the InputChannel node. The LoopChannel node explicitly looks at the data of the neighbor element being looped over as opposed to the vertex that initiated the loop.
Yes, it would be possible, and I am pretty sure I have posted that example before. Will see if I can post it again.
Hi Bobo - Was the ability to update the kd-tree between iterations ever fixed? I have been playing with the ‘limited push same mesh’ flow using Frost to place instanced geo at vert point and I’d love to have a limited push same mesh that could be set to a small about, then looped a few iterations.