I’m running into something very disruptive with the Bullet Solver.
I have a bunch of spheres that are attracted to a set of points using a feedback CHOP.
My goal is to animate the size of the spheres as part of the physics. When I toggle Update Collision Shape to ON in the Actor COMP, the moment I update the radius on any of my sphere instances the simulation pauses.
I did notice if I manually hit the pulse button the simulation updates by a frame. Adding an execute DAT that hits the pulse button each frame even seems to mostly work. (although wrong of course and not fast enough).
I’ve included a little example patch to show the issue.
Another thing that’s not really a bug but more a question, why can’t I update the collision shape of individual actors? Having them all update every frame slows down things quite a bit.
–
Further down the line I’ll probably have the same question about other properties, such as the mass and friction etc. it seems a lot of things can’t be updated on a per instance basis.
Thanks for the report. I’m able to reproduce the update collision issue and am looking into it.
Updating your collision shape each frame is slow because the SOP used to calculate your collision shape has so many points – to get better performance you’ll want to bring the point frequency way down. If you want to keep the same SOP for rendering then you can override the collision SOP with the parameter on the Actor COMP.
More fine-tuned control for updating every frame, friction, mass etc. is something that could be added through feedbacking, or the python Body Class. I’ve created an internal RFE for this.
for the moment I’ve solved it by using replicators instead of instances for the actors.
One thing that would be cool is to be able to have the bullet solver update even when nothing is directly looking at it. I’m drawing my shapes using a seperate geo with instancing, but I still want my bullet solver to update if its not directly drawn on the screen, currenty it pauses when its not looked at.
In this example all spheres should be touching each other while they are growing and shirinking. As you can see during sphere growth they push each other apart, but on shrinking the collision shape does not update. When you go into the solver and have the geometry preview open it does update correctly.
While making this example I was actually trying to report a different bug. In another project I get a strange gimble lock behaviour on the rotation of the spheres upon animating their scale.
@eric.b great job! it certainly fixes the initial bug I reported it doesn’t seem to work though against the gimble-lock effect I mentioned which occurs if I use the bullet solver data in my geo instance.
I’ve updated the example file, you can clearly see the difference.
Ah yeah, thanks for the example, I can reproduce that one. I think this problem is unique to oriented bounding box and bounding sphere, so I recommend switching to convex hull collision shape as a work-around for the time being. Working on a fix at the moment.
In this example all spheres should be touching each other while they are growing and shirinking. As you can see during sphere growth they push each other apart, but on shrinking the collision shape does not update. When you go into the solver and have the geometry preview open it does update correctly.
This is fixed for you in that build I sent though right?
@eric.b thanks so much any chance that release is in the next four weeks? I’m on a project atm and not having to calculate as convex hull collision would save me a lot of performance.
One other Bullet bug I noticed has to do with the TD realtime toggle, this seems to always have to be turned off to prevent weird behaviour. For insance having the realtime toggle turned on causes solid numbers in CHOPs to turn into an array of values for very brief intervals, I could only see this when locking the CHOP at the right timing.
I couldn’t find any info about this in the documentation, also the bullet actors or solver don’t show a warning icon when realtime is turned on.
Let me know if you prefer me to make individual threads for these bullet issues btw.
One other Bullet bug I noticed has to do with the TD realtime toggle, this seems to always have to be turned off to prevent weird behaviour. For insance having the realtime toggle turned on causes solid numbers in CHOPs to turn into an array of values for very brief intervals, I could only see this when locking the CHOP at the right timing.
This is due to time slicing. The Bullet Solver CHOP is not time sliced and each sample represents a body so that shouldn’t be affected by the realtime toggle, however if you have any time sliced CHOPs in your feedback network then you could run into that. For some CHOPs you can disable time slicing on the Common page.
With realtime on, do warnings still show up in the Error DAT?
Sorry for getting back to you on this topic after such a long time.
Regarding the Error DAT, no there are no warnings showing up.
What I do run into, is regarding time slicing and bulllet. For instance in my feedback network I want to select a subset of actors and run operations on them separately and then join them together again. Though due to time slicing I can’t get these values on their own, often they come in pairs of two samples which I can only spot when locking the CHOP.
Are there any best practices or abilities to go between time slicing and non-time slicing in CHOPs?
As you mentioned, it is not possible on all CHOPs to enable/disable time slicing, also for some such as Count and Lag, turning off time slicing causes non desired behaviour, does that mean I can’t use them inside a feedback CHOP network for bullet? Especially Count doesn’t seem to work normally when time slicing is turned off.
I’m trying to influence my bullet spheres with movements coming from a kinect azure CHOP, though this one is time sliced, does that mean I have to convert the output somehow to something non time sliced to let it play nicely with bullet?
The only workaround I have found is by using a constant CHOP and connecting its value to the value of a timesliced CHOP.
You can toggle on/off globally with the real-time flag on the top bar. When enabled the time step forward will be variable depending on fluctuations in fps – if you dropped a frame for example. If you drop a frame then the next frame will account for that with a larger time step. When you disable the real-time flag the timestep will always be 1 / timeline fps regardless of any frame drops so you won’t get any fluctuations in time slice size.
What is your timeline fps set to? You could also try lowering that. I believe the Kinect Azure runs at 30 fps.