Bullet Solver Instance trigger individual gravity by collision

I want to make an apple tree that you can touch each apples and they fall onto the ground with Bullet Solver.

So the apple’s initial state should be static on the tree.
Is it possible to trigger each instance’s gravity by collision?

Or any other idea that make this idea to work would be appreciated.

You can’t apply different gravities to specific apples, unless each apple is its own Actor COMP. The closest thing you get to apple-specific gravity for an Actor COMP containing apple instances would be to use the Feedback CHOP parameter. The Feedback CHOP accepts force[xyz] channels (in your case it would likely just be a forcey channel) that can be used to apply forces to specific bodies (ie. apples) within an Actor COMP.

A completely alternative solution is to use the Constraint COMP. Each apple can be held to the tree with a point to point constraint, and when the apple is clicked the constraint can be deactivated so that the apple falls to the ground. With this solution there would be a constant gravity applied to everything but they wouldn’t move because of the presence of the constraint.

Thank you Eric! That is very helpful!!

I will try both feedback way and constraint way. The Operator Snippets have been a huge help!

Another solution is to feedback the active channel of the bodies through the feedback CHOP parameter. Each body would start off deactivated, then could be activated individually as they’re clicked in the scene.

Interesting. I like that there are different ways. I’m gonna try the active channel way as well.

Question about point to point constraint, would it work for multiple instances?
Or the constraint is one apple per actor?

The Constraint COMP Actor Bodies parameter resolves to a list of integers corresponding to actor’s body ID’s. For example, [0-3] would apply the constraint to bodies 0, 1, 2, 3 in the Actor COMP.

That being said, the constraint solution is probably the most complicated. You’d need to keep a list of body ID integers that have not been clicked. This would be passed as a string (eg. “1 2 3 4 5 6”) to the parameter. As bodies are clicked you’d have to update the parameter string to no longer include that body ID.

Thanks @eric.b

Following question, What is the best way to retrieve intsance ID inside Actor COMP. Take yamashita’s example, If I want to remove the apple whenever it collides with “floor” , could I still be able to use render pick DAT to find out that body ID?

The body ID should line up with the instanceID. You can get that value from the body_id channel in the Bullet Solver CHOP or the index in the Body Class if using python.

Hi guys ! Thanks for this topic, this is actually exactly what I’m looking for, as I’m building a room which would slowly break down piece by piece. I’m using the constraint method and everything is great except for one thing:I managed to get the BODIES parameter to update as I want (using Python expression referencing a table cell which is updated as I turn on and off certain bodies), but it seems the Constraint COMP updates its parameter only when I click and show its parameter window… If I keep it open and deactivate certain bodies they will fall, but if I close it, they do not move until I reopen the window parameter. Do you have an idea of what this could be due to ? Is there some type of force cook or force update that I should ask the Constraint COMP to do ? Thanks for your help & amazing discussion here !

Just found the solution : since I was storing the data in a Table DAT I had to use a DAT execute to ask the Constraint COMP to cook after it passed its string of data. I’m pretty new to TD so maybe this was obvious, but good to know ! :slight_smile:

1 Like