3
$\begingroup$

I'm trying to make pacman eat these balls permanently. I set up a simulation zone as you can see below to try to make the delete geometry permanent. That works but gives me two new issues:

  1. The animation I have on the ball collection items no longer works, the balls become static. I animated the original non instanced objects to move into that position. I want their animations to stay intact.

  2. The balls lose their materials. I know I could set the material via Geo nodes, but it is a multi material item and it would need a bunch of extra nodes to separate the geometry and re-set the materials. I am ok with this if it works but I'm trying to keep this speedy.

My question: How can I keep the animation of the original objects and how can I keep the material setup?

enter image description here

Balls animation doesn't match real objs. Material deleted:

Balls animation doesn't match, Material Deleted

$\endgroup$
2

1 Answer 1

6
+50
$\begingroup$

Pipe the instances in to your simulation zone. (As you did correctly.)

  1. Sample the distance between Pacman and the Spheres by using the Sample Index-node with the original animated instances. Since our instance count shall not change in the simulation zone, we can sample the indices directly.
  2. Using the attribute capture node transfer the sampled distance to the instances in the simulation zone.
  3. Store the distance as an attribute called mindist on the instances in the simulation zone. However, if the attribute exists from a previous iteration and is smaller, use the smaller value.
  4. We will ignore the output from the simulation except for the mindist attribute on the instance. Sample that (by index again) and compare it to your threshold. Then use the original animated instances and delete them as desired.

Completed Node Setup

Why don't we delete the actual instances in the sim zone?

You could. But if you would delete the instances in the simulation zone, you would have to resimulate the complete frame range when changing the deletion conditions. By storing the minimum distance as an attribute, you can cache the simulation zone once, and then adjust the distance (or other effects) later interactively.

Why is this helpful again?

Let's illustrate this with an example. Say you have cached the simulation to disk. But afterwards you realized you need to rescale the balls. Now the distance is off, the balls disappear to early or to late.

  • If you have implemented the deletion in the simulation, you would need to change the condition controling the deletion. Then you would have to redo the cache.
  • If you have only stored something like the minimum distance, and the deletion happens after the simulation zone, you can adjust that conditional value (distance threshold) and effectively change when the spheres disappear without redoing the cache.
$\endgroup$
3
  • $\begingroup$ Brilliant. It runs faster too! I'm trying to understand but this is a lot to take in. Does this mean that the position and index data are being fed into the sim zone, effectively animating the objs in the sim zone? Then we checking the distance to see if it's smaller than the threshold. Without ever displaying that animation data, we update the list we created of index items paired with "mindist" values. As that list gets updated within the simzone, the items are then switched to "deleted". I don't understand why deleting instances in the sim zone resimulates the entire frame range though. $\endgroup$
    – Black Fox
    Feb 21 at 21:59
  • 1
    $\begingroup$ We're not deleting anything in the simulation zone. We are storing the minimum distance only on indexed instances. The only relevant values in the sim zone are index and the custom minimum distance. Then comparing and deleting is done after the simzone. You are right: effectively we feed the position data into the simzone newly on each iteration. (We can do this because the indices stay the same.) $\endgroup$
    – Leander
    Feb 22 at 7:28
  • 1
    $\begingroup$ "I don't understand why deleting instances in the sim zone resimulates the entire frame range though." > Please check my edit and reply if it is not clear yet. $\endgroup$
    – Leander
    Feb 22 at 7:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .