Jump to content

Deleting DOP objects in-sim


Neronie

Recommended Posts

Hey peeps! Sorry for the long post.

Does anyone know how to delete DOP objects dynamically while the simulation is running?
I have a dopnet with a Vellum Object and a Vellum Source attached to a Vellum Solver. The Vellum Source is set to Continuous Emission and I have an expression on the Activation parameter that spawns a Vellum Object every n frames. This works, but the sim obviously gets heavier and heavier as time goes on and more objects are emitted into the simulation. Since the objects are only briefly passing by the camera never to be seen again, I'd like to remove them to free up precious simulation resources once they're out of view.

I tried setting up a SOP Solver with a wrangle that tracks an age attribute and deletes it once it has passed a certain threshold. However, it seems as if Vellum doesn't really like geometry to be deleted on the fly like that (the sim just drags to a halt and then Houdini crashes).

(This is unless I missed an obvious way to remove an object from the simulation calculations, perhaps through the usage of an attribute. Setting the mass to 0 still seems to be contributing to the overall performance.)

I'd like to delete the DOP object 'properly', i.e. using the Delete DOP node. I can't seem to figure how this guy works, though. I read both on the documentation and on this thread (https://forums.odforce.net/topic/25361-delete-dop/) that I'm supposed to be using dopoption expressions, which I'm really just not well versed in at all. On the forum thread anim kindly suggests comparing the y value for the DOP Object and deleting based on that. I can't wrap my head around this one, though. How does a DOP Object even have an intrinsic position? Is it its centroid, or something else? I tried giving it a shot but I can't even figure out how to give a unique name to each object, let alone masks and groups and all that nonsense. Even guru Johnny Farmfield was stumped on this one topic at the time, how am I supposed to even get close?!?

Can anyone point me to a potential solution? How would you approach such a problem?

[In addition, can anyone suggest a relatively recent tutorial for getting a good grasp on the interiors of DOP Networks? Stuff like the things I asked above: handling fields, dop objects, streams and other 'advanced' nonsense like that. How do you even learn this stuff?!?]

Any suggestion is appreciated.
Thanks everyone for the attention.
Happy Houdining!

dopnet_delete_question.PNG

Edited by Neronie
  • Like 1
Link to comment
Share on other sites

Keep in mind that everything in your example DOPnet is a single Vellum object, not multiple objects. You can emit more points and constraints into the simulation if you like, but it's all data that's being added to a single Vellum object, "vellumobject1".

There's a couple things that will make Houdini very angry when deleting geometry from a Vellum object. First, from my testing it seems that you don't want to delete individual points/prims from a Vellum patch... you want to delete the whole patch at once if you're going to take that route mid-simulation. Second, you absolutely need to delete the associated constraints as well. In DOPs, the actual Vellum mesh is "Geometry" data, but the constraints are "ConstraintGeometry". This means that you need a SOP Solver (or Geometry wrangle, depending on what you like to work with) for both of these data names to delete both the Geometry and the ConstraintGeometry so that you don't end up with constraints that no longer have anything to constrain.

I'm attaching an example here... I modified the Vellum Source to change the Patch Name so that each generated sphere has a unique name (based on the frame number when they're emitted), then in the Solver SOPs I run a for/each over each patch, get the minimum P.y position, and delete entire patches at once when their minimum P.y is less than zero.

vellum_culling_toadstorm.hip

  • Like 2
  • Thanks 7
Link to comment
Share on other sites

  • 3 weeks later...
  • 6 months later...

Great technique with the solver SOP! I just found that if you're emitting multiple objects per frame, instead of creating the patch name in the Vellum source, you can stick an Assemble in the Solver SOPs to create a piece attribute & do the for/each by piece. Very helpful when you have over a thousand objects to keep track of. 

  • Like 3
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...