Page MenuHome

Generic Rigid Body Constraint Bug
Confirmed, NormalPublicBUG


System Information
Operating system: Windows 10
Graphics card: Radeon RX 470

Blender Version
Broken: 2.83.0
Worked: Unknown if it ever worked

Short description of error
Angle limit not only doesn't work but causes weird neverending twitching back and forth
Twitching happens for both cases when both rigid bodies are active and when one of them is passive.

Exact steps for others to reproduce the error

  1. Add 2 rigid bodies, 1 active, 1 passive animated
  2. Position them active on top, passive on the bottom
  3. Add an empty in between them, add a rigid body constraint to it, select the 2 rigid bodies in its settings, uncheck disable collisions.
  4. Change the joint type to Generic, limit location to 0-0 on each axis.
  5. Play. Now it works, once you select the passive RB and move it it should behave normal.
  6. Undo. Check angle limit on Z and choose some angle range (I had it set to -30 to 30).
  7. Play. Move the passive RB and watch it breaking.

Event Timeline

Richard Antalik (ISS) changed the task status from Needs Triage to Needs Information from User.Aug 21 2020, 6:13 AM

Can you check if this happens in latest development build?

If there is bug still, please upload simple example file.

Ok it works in latest development build blender-2.90.0-05e1ccf10836-windows64! I'm sorry for being lazy to check it at first.

Zachary Litvinenko (ZackMercury) changed the task status from Resolved to Archived.Aug 22 2020, 4:34 PM

Ok so I didn't have this problem in the simpler setup I described above, but when I added a more complex setup the twitching returned

Zachary Litvinenko (ZackMercury) changed the task status from Archived to Resolved.Aug 22 2020, 4:35 PM

the only thing I want is to have shoulder joint, so that it can move around but can't twist... or be able to twist with a certain threshold

Richard Antalik (ISS) reopened this task as Needs Information from User.Aug 25 2020, 4:06 AM

how do I revive this report

I am not sure if you can.

Please upload example file, otherwise I can not confirm the issue.

Oh sorry I forgot that
There you go

The bug report describes only two bodies and an Empty. The uploaded file is much more complex, even with an armature and bone constraints. Following the comments, it looks like the steps to reproduce in the task description don't reproduce the issue.

Having said that, @Sebastian Parborg (zeddb) is working on an improved integration with the Bullet library (which manages the physics simulation). It could very well be that this twitching will be gone then as well.

The twitching issue is not solved with my update.

The issue here stems from multiple issues:

  1. The rigidbody world seems to have been broken/corrupted somehow.

If you remove all the constraints and move the bodies so that they are well away from each other, they will still twitch around or go flying.

This can be solved by removing the rigidbody world and re adding all of the bodies again. I wonder how it go into this state. The file is kinda messy so it is hard to tell.
(There seems to have been multiple worlds and rigidbody setups done in it)

  1. The bodies are placed too close to each other and a intersecting from the start.

This will lead to general instability.

  1. The "generic" constraint type doesn't seem to play nicely in this scenario.

The hinge constraint works much better.

Nr 1 I need to know the steps you did to manage to break the world simulation to be able to fix.
Nr 2 I can't fix, you just have to space them out properly so they have enough room.
Nr 3 will need some more research before we can tell if it an issue with blender or with bullet.

Here is as test file with the changes I did to make it stable:

Hello again. I recreated a similar setup in a new clean file.

  1. now the file is clean and has only 1 rigid body world. I did nothing in it besides adding a few boxes and empties between them.
  2. they are not intersecting at the start anymore

apparently the z angle limit doesn't work either since you can see them turning freely way more than 30 degrees (since my angle limit was -15 to 15)

also I checked the file you sent and it looks like this

You probably are using an older blender version. You need to use a build from the 2.91 branch to get my example file to behave better.
(And also increase the new "Substeps per frame" in the world settings to 10 or so):

I can also still reproduce the general weird general constraint behavior.
Thanks for providing a better test file!

@Sebastian Parborg (zeddb) How do you think this report should be classified? Bug? Known Issue?

Sebastian Parborg (zeddb) changed the subtype of this task from "Report" to "Bug".Sep 24 2020, 1:03 PM

@Sybren A. Stüvel (sybren) We can do it as bug atm.
We'll see if things get better after I have cleaned up the spagetti rigid body code in blender.

This might also be an issue with bullet itself. But it will be easier to tell after the cleanup.

Sebastian Parborg (zeddb) changed the task status from Needs Information from User to Confirmed.Sep 24 2020, 1:03 PM

This might also be an issue with bullet itself. But it will be easier to tell after the cleanup.

Do you have a task number for this, so that we can properly link them together?

@Sybren A. Stüvel (sybren) not yet, I talked to Brecht and Sergey about it and it seems like I should probably make a bigger proposal and design about this.

I could of course try to just make the current approach nicer, but I think maybe thinking ahead a bit and preparing for "everything nodes" here would be good.
This is so that I don't do a big rewrite and then we have to do an other big rewrite relatively soon after I'm done with it.

However I haven't had time yet to discuss this with Sergey as I would want this to work more like a modifier of sorts instead of having it be this special edge case as it is now.
(By modifiers are not allowed to touch the objects transform, so we have to do some more back and forth here).

System Information:
Operating system: Windows 10
Graphics card: NVidia GeForce RTX 3050 Ti

Blender Version:
Broken: 3.0.0

I found a lingering problem with the rigid body constraint as well.
A very simple scene consisting of 2 cubes and 1 "Generic" rigid body constraint.
I did 4 cases of a pendulum:

  1. Fixed center of rotation;
  2. Z-axis slack of 1 m;
  3. Z- and Y-axis slack of both 1 m, and;
  4. Small offset on the pendulum in the y-axis of 0.01 m.

Complete detail is in the blend file and the video above. For the first three cases, everything was working well. For the fourth case, the small offset created an energy-gaining motion. I hope this helps pinpoint the origin of the bug. Thank you and cheers!