found work around for compound assembly issues, #42400

Closed
opened 2014-10-26 02:06:38 +02:00 by Jacob Merrill · 12 comments

when assembling a compound body inside a function the objects physics bound was incorrect, also the objects physics bound (child) was left where the object was when assembled,

a work around was to do

(calculations for assembling)

assembling function (center of mass etc)

function(create mesh libNew and parent children and assign mass of "centroid")

for all parts in assembly
removeParent()
disableRigidBody()
suspendPhysics()
setParent(centroid libNew host)

however after doing this, once the object is removed from the assembly with "removeParent" it still had the complex compound shape bounds in physics,

so

for removed objects:
add new copy of object
set properties
end old object

works around all issues.

when assembling a compound body inside a function the objects physics bound was incorrect, also the objects physics bound (child) was left where the object was when assembled, a work around was to do (calculations for assembling) assembling function (center of mass etc) function(create mesh libNew and parent children and assign mass of "centroid") for all parts in assembly removeParent() disableRigidBody() suspendPhysics() setParent(centroid libNew host) however after doing this, once the object is removed from the assembly with "removeParent" it still had the complex compound shape bounds in physics, so for removed objects: add new copy of object set properties end old object works around all issues.
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @JacobMerrill-1

Added subscriber: @JacobMerrill-1
Author

https://www.youtube.com/watch?v=EZFewOI_nCY

working assembly system in game

https://www.youtube.com/watch?v=EZFewOI_nCY working assembly system in game

Added subscriber: @mont29

Added subscriber: @mont29

I can’t I understand what’s the issue nor topic really here… is it about GE? Blender itself? Is it a bug report? something else?

Please follow our submission template and instructions, it really helps sorting things out…

I can’t I understand what’s the issue nor topic really here… is it about GE? Blender itself? Is it a bug report? something else? Please follow our submission template and instructions, it really helps sorting things out…
Author

There was a bug in the game engine, "ending object crashes game engine" that was related to ending the child of a compound object,

another bug, related to this was about the shape bounds not moving when a object was assembled (it left the physics bound of the child where it was when parented)

I found workarounds for both of these issues,

ending compound object child not crashing game

object.removeParent()
object.disableRigidBody()
object.suspendDynamics()
object.endObject()

as for the shape bounds,
I did a similar thing
for objects in new assembly:
object['Root']=parent
object.removeParent()
object.disableRigidBody()
object.suspendDynamics()
object.setParent(object['Root'],1,0)

so, this updated bullets shape bounds on the compound object right after assembly.....

basically I found my own problem and it was related to rigid body assembly, incorrect shape bounds, "ghosts" of objects physics bounds,
and when a object was disassembled it would have "ghosts" in it's physics bounds....

issues I found and worked around
1.in physics visualization shape bound was not correct for my rigid body assemblies

  1. if you ended a child of a compound shape/rigid body it crashed the engine

  2. if you removed a compound assembly object it carried with it "junk" (it could not be moved but could rotate....)

solutions
1 = reparented same objects after disabling rigid body and dynamics (after initial assembly)

2 = remove parent remove rigid body remove dynamics then remove object

3= add in new copy of component , copy properties from old object - end old object

There was a bug in the game engine, "ending object crashes game engine" that was related to ending the child of a compound object, another bug, related to this was about the shape bounds not moving when a object was assembled (it left the physics bound of the child where it was when parented) I found workarounds for both of these issues, ending compound object child not crashing game object.removeParent() object.disableRigidBody() object.suspendDynamics() object.endObject() as for the shape bounds, I did a similar thing for objects in new assembly: object['Root']=parent object.removeParent() object.disableRigidBody() object.suspendDynamics() object.setParent(object['Root'],1,0) so, this updated bullets shape bounds on the compound object right after assembly..... basically I found my own problem and it was related to rigid body assembly, incorrect shape bounds, "ghosts" of objects physics bounds, and when a object was disassembled it would have "ghosts" in it's physics bounds.... **issues I found and worked around** 1.in physics visualization shape bound was not correct for my rigid body assemblies 2. if you ended a child of a compound shape/rigid body it crashed the engine 3. if you removed a compound assembly object it carried with it "junk" (it could not be moved but could rotate....) **solutions** 1 = reparented same objects after disabling rigid body and dynamics (after initial assembly) 2 = remove parent remove rigid body remove dynamics then remove object 3= add in new copy of component , copy properties from old object - end old object

Thanks for the clarifications.

Thanks for the clarifications.
Member

Added subscriber: @JorgeBernalMartinez

Added subscriber: @JorgeBernalMartinez
Member

Jacob, we need blends for the both issues that you commented. This way we can check the possible bugs.

thanks.

Jacob, we need blends for the both issues that you commented. This way we can check the possible bugs. thanks.
Author

ok

File

Assemblysimplified(1) {F179643}= Problem (press P, then press space) see the floating white cube?)

AssemblySimplified2 = work around

turns out it has to do with applyMovment + setParent in the same frame.

setParent then apply movement does not update the physics of the child shape bound.

(I lost most of my old files so I don't know if the other problems I ran into were user error or?)

AssemblieSimplified2.blend

ok File Assemblysimplified(1) {[F179643](https://archive.blender.org/developer/F179643/AssemblieSimplified__1_.blend)}= Problem (press P, then press space) see the floating white cube?) AssemblySimplified2 = work around **turns out it has to do with applyMovment + setParent in the same frame.** setParent then apply movement does not update the physics of the child shape bound. (I lost most of my old files so I don't know if the other problems I ran into were user error or?) [AssemblieSimplified2.blend](https://archive.blender.org/developer/F179640/AssemblieSimplified2.blend)
Author

https://youtu.be/fpS9mygynRk

video of exposing the undesired activity,
and the work around,

1 when a object is compound parented, if it is moved after parenting, it leaves the physics mesh, and only moves the graphics mesh.

2 If applyMovement is done, in a frame before parenting, the movment never happens (at least in this case)

a work around for number 2 = use object.worldPosition, and get the world vector you need for local movment using

desired=object.worldPosition+(object.worldOrientation*Vector([x,y,z]))

https://youtu.be/fpS9mygynRk video of exposing the undesired activity, and the work around, # 1 when a object is compound parented, if it is moved after parenting, it leaves the physics mesh, and only moves the graphics mesh. # 2 If applyMovement is done, in a frame before parenting, the movment never happens (at least in this case) a work around for number 2 = use object.worldPosition, and get the world vector you need for local movment using desired=object.worldPosition+(object.worldOrientation*Vector([x,y,z]))
Member

Closed as duplicate of #40427

Closed as duplicate of #40427
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#42400
No description provided.