motor constraint isn't working #113234

Open
opened 2023-10-04 05:30:22 +02:00 by michael campbell · 8 comments

System Information
Operating system: Windows-10-10.0.19045-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 536.99

Blender Version
Broken: version: 4.0.0 Beta, branch: blender-v4.0-release, commit date: 2023-10-01 16:56, hash: 4d3534401060
Broken: 2.91.0
Worked: 2.90.1

Caused by 1aa54d4921

Short description of error
motor constraint has no effect

Exact steps for others to reproduce the error
open attached blend file and press play. Move the cone empty on the x axis to change the speed of the tanks back wheels which are driven by the motor constraint. The empties are aligned so the x axis oriented correctly with rotation as described in the user manual.

**System Information** Operating system: Windows-10-10.0.19045-SP0 64 Bits Graphics card: NVIDIA GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 536.99 **Blender Version** Broken: version: 4.0.0 Beta, branch: blender-v4.0-release, commit date: 2023-10-01 16:56, hash: `4d3534401060` Broken: 2.91.0 Worked: 2.90.1 Caused by 1aa54d4921c2e8d7114f463a940c169ee573f557 **Short description of error** motor constraint has no effect **Exact steps for others to reproduce the error** open attached blend file and press play. Move the cone empty on the x axis to change the speed of the tanks back wheels which are driven by the motor constraint. The empties are aligned so the x axis oriented correctly with rotation as described in the user manual.
michael campbell added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2023-10-04 05:30:23 +02:00
Member

Can confirm, will check

Can confirm, will check
Philipp Oeser added
Module
Nodes & Physics
Status
Confirmed
and removed
Status
Needs Triage
labels 2023-10-04 10:00:29 +02:00
Member

Pretty sure this was caused by 1aa54d4921

OK, so while there are a couple of dependency cycles detected, (such as the following), it was still somewhat working prior to above commit :

Dependency cycle detected:
  SCScene/RIGIDBODY_SIM() depends on
  OBCylinder.016/TRANSFORM_SIMULATION_INIT() via 'Object Transform -> Rigidbody Sim Eval'
  OBCylinder.016/TRANSFORM_EVAL() via 'Transform Eval -> Simulation Init'
  OBCylinder.016/TRANSFORM_CONSTRAINTS() via 'Constraint -> Transform Eval'
  OBEmpty.032/TRANSFORM_FINAL() via 'Limit Distance'
  OBEmpty.032/TRANSFORM_SIMULATION_INIT() via 'Simulation -> Final Transform'
  OBEmpty.032/TRANSFORM_EVAL() via 'Transform Eval -> Simulation Init'
  OBEmpty.032/TRANSFORM_PARENT() via 'Eval'
  OBEmpty.032/TRANSFORM_LOCAL() via 'ObLocal -> ObParent'
  OBEmpty.032/TRANSFORM_INIT() via 'Transform Init'
  OB000hull/TRANSFORM_FINAL() via 'Parent'
  OB000hull/RIGIDBODY_TRANSFORM_COPY() via 'Rigidbody Sync -> Transform Final'
  SCScene/RIGIDBODY_SIM() via 'Rigidbody Sim Eval -> RBO Sync'

So #87085 is related (as is the fix for forcefields f4d8382c86)
And in a bold move to rectify this, if I up the Target Velocity & Max Impulse in the motor constraint by a factor of 81 (see #87085 for the reasoning), I am getting comparable results.

Tempted to set this to High prio for a bit, to get input from @ZedDB and @LukasTonne to see if this is something that can be fixed easily. Situation now (that the influence Target Velocity & Max Impulse have on the simulation depends on the substeps) is pretty much broken.

Pretty sure this was caused by 1aa54d4921c2e8d7114f463a940c169ee573f557 OK, so while there are a couple of dependency cycles detected, (such as the following), it was still somewhat working prior to above commit : ``` Dependency cycle detected: SCScene/RIGIDBODY_SIM() depends on OBCylinder.016/TRANSFORM_SIMULATION_INIT() via 'Object Transform -> Rigidbody Sim Eval' OBCylinder.016/TRANSFORM_EVAL() via 'Transform Eval -> Simulation Init' OBCylinder.016/TRANSFORM_CONSTRAINTS() via 'Constraint -> Transform Eval' OBEmpty.032/TRANSFORM_FINAL() via 'Limit Distance' OBEmpty.032/TRANSFORM_SIMULATION_INIT() via 'Simulation -> Final Transform' OBEmpty.032/TRANSFORM_EVAL() via 'Transform Eval -> Simulation Init' OBEmpty.032/TRANSFORM_PARENT() via 'Eval' OBEmpty.032/TRANSFORM_LOCAL() via 'ObLocal -> ObParent' OBEmpty.032/TRANSFORM_INIT() via 'Transform Init' OB000hull/TRANSFORM_FINAL() via 'Parent' OB000hull/RIGIDBODY_TRANSFORM_COPY() via 'Rigidbody Sync -> Transform Final' SCScene/RIGIDBODY_SIM() via 'Rigidbody Sim Eval -> RBO Sync' ``` So #87085 is related (as is the fix for forcefields f4d8382c86ba760c5fccf7096ca50d6572b208bd) And in a bold move to rectify this, if I up the `Target Velocity` & `Max Impulse` in the motor constraint by a factor of 81 (see #87085 for the reasoning), I am getting comparable results. Tempted to set this to High prio for a bit, to get input from @ZedDB and @LukasTonne to see if this is something that can be fixed easily. Situation now (that the influence `Target Velocity` & `Max Impulse` have on the simulation depends on the substeps) is pretty much broken.
Philipp Oeser added
Priority
High
and removed
Priority
Normal
labels 2023-10-04 11:00:52 +02:00
Member

Tempted to set this to High prio for a bit, to get input from @ZedDB and @LukasTonne to see if this is something that can be fixed easily.

Of course feel free to lower priority again (since this area is not well maintained -- and it is quite an old bug)

> Tempted to set this to High prio for a bit, to get input from @ZedDB and @LukasTonne to see if this is something that can be fixed easily. Of course feel free to lower priority again (since this area is not well maintained -- and it is quite an old bug)
Member

I can't even run 2.90 on my linux work machine any more, hard to tell what this would actually look like before 2.91. I don't intend to spend much time on this, but likely that motors also have some kind of update that needs to be repeated each substep, similar to force fields.

I can't even run 2.90 on my linux work machine any more, hard to tell what this would actually look like before 2.91. I don't intend to spend much time on this, but likely that motors also have some kind of update that needs to be repeated each substep, similar to force fields.
Philipp Oeser added
Priority
Normal
and removed
Priority
High
labels 2023-10-04 12:30:16 +02:00

I'm not sure if it's any use, but here's a much simpler version. In this one the motor does begin to work, but after a few iterations it causes all constraints to just explode. I've checked all the margins are small enough, and also increased the steps and substeps quite high. Without the motor constraint no explosions happen. Could it be a conflict of some type between the spring code and the motor code? There are no dependency cycles in this one.

I'm not sure if it's any use, but here's a much simpler version. In this one the motor does begin to work, but after a few iterations it causes all constraints to just explode. I've checked all the margins are small enough, and also increased the steps and substeps quite high. Without the motor constraint no explosions happen. Could it be a conflict of some type between the spring code and the motor code? There are no dependency cycles in this one.
Member

I'm pretty sure the instability in the car example is caused by a known issue with the "Generic Spring" (aka 6DoF) constraint: When the angle reaches 90 degrees it goes into gimbal lock and becomes unstable.
https://pybullet.org/Bullet/phpBB3/viewtopic.php?t=12159

I attached a modified version that uses simpler hinge constraints and works just fine.

I'm pretty sure the instability in the car example is caused by a known issue with the "Generic Spring" (aka 6DoF) constraint: When the angle reaches 90 degrees it goes into gimbal lock and becomes unstable. https://pybullet.org/Bullet/phpBB3/viewtopic.php?t=12159 I attached a modified version that uses simpler hinge constraints and works just fine.

Thanks @LukasTonne that's cool but no suspension. I think i've found the cause of the bug though, it works fine if you add the constraints via the object menu, but not when adding them manually. I guess some bit of necessary code is present in the object menu implementation but not when adding the constraints from the empty's physics tab?

Here's the working version created by selecting the wheel then the car body, going to the object -> rigid body -> connect, and choosing spring generic with location selected. The motor was also added from the object menu.

Thanks @LukasTonne that's cool but no suspension. I think i've found the cause of the bug though, it works fine if you add the constraints via the object menu, but not when adding them manually. I guess some bit of necessary code is present in the object menu implementation but not when adding the constraints from the empty's physics tab? Here's the working version created by selecting the wheel then the car body, going to the object -> rigid body -> connect, and choosing spring generic with location selected. The motor was also added from the object menu.
Iliya Katushenock added the
Interest
Physics
label 2023-10-05 16:40:54 +02:00

actually, scrap that, I've found the issue is the spring constraint only works if it's y axis points backward or forward, and it's x axis aligns with the wheel rotation as shown below. I'm not sure why that would be, and the manual doesn't suggest it's necessary:

image

actually, scrap that, I've found the issue is the spring constraint only works if it's y axis points backward or forward, and it's x axis aligns with the wheel rotation as shown below. I'm not sure why that would be, and the manual doesn't suggest it's necessary: ![image](/attachments/1de0f3f3-1e88-4e2b-9d3a-61e36b2e7707)
113 KiB
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#113234
No description provided.