Blender Game Engine does not fully implement Parent-Child relationships. #33512

Closed
opened 2012-12-13 09:55:17 +01:00 by Tously Sid · 21 comments

Category: Animation

%%%The .blend file includes a sphere parented to a cube, the cube has been scaled, and the sphere has been rotated. The 3D view shows the expected behavior, the sphere rotates within the scaled cube and is completely confined to the cube's bounds. Rotate the sphere to see how the sphere manages to rotate within the cube. Activate the game engine by pressing 'P'. The sphere correctly implements its parent's scaling and rotation properties, however it is no longer confined to it's parent's area of operation, rotating itself outside of its bounds.

Expected behavior: The sphere should only be able to rotate within the confines of its parent's boundaries as it does in the 3D editor/when rendering. This behavior is immensely useful in cases where the end user needs to rotate an object while keeping certain scaling properties, such as a ball squashing and stretching as it bounces, or a wheel slightly depressing due to its load while remaining easy to rotate.

Side note: Lattices are not a valid workaround as it seems the game engine does not support it.%%%

**Category**: Animation %%%The .blend file includes a sphere parented to a cube, the cube has been scaled, and the sphere has been rotated. The 3D view shows the expected behavior, the sphere rotates within the scaled cube and is completely confined to the cube's bounds. Rotate the sphere to see how the sphere manages to rotate within the cube. Activate the game engine by pressing 'P'. The sphere correctly implements its parent's scaling and rotation properties, however it is no longer confined to it's parent's area of operation, rotating itself outside of its bounds. Expected behavior: The sphere should only be able to rotate within the confines of its parent's boundaries as it does in the 3D editor/when rendering. This behavior is immensely useful in cases where the end user needs to rotate an object while keeping certain scaling properties, such as a ball squashing and stretching as it bounces, or a wheel slightly depressing due to its load while remaining easy to rotate. Side note: Lattices are not a valid workaround as it seems the game engine does not support it.%%%
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

%%%Added a second .blend, this one uses a Cube instead of an Empty, same result unfortunately.%%%

%%%Added a second .blend, this one uses a Cube instead of an Empty, same result unfortunately.%%%
Author

%%%Or rather I attempted to submit a second .blend file but the server sent a "missing parameter" error. Download here: http://blenderartists.org/forum/attachment.php?attachmentid=206630&d=1355393266%%%

%%%Or rather I attempted to submit a second .blend file but the server sent a "missing parameter" error. Download here: http://blenderartists.org/forum/attachment.php?attachmentid=206630&d=1355393266%%%

%%%add a message (comment) when you attach the file and send. otherwise it fails.%%%

%%%add a message (comment) when you attach the file and send. otherwise it fails.%%%
Author

%%%Thanks, here's the file: %%%

%%%Thanks, here's the file: %%%
Author

%%%Please read this helpful post by MarcoIT which implements a solution through python: http://blenderartists.org/forum/showthread.php?275058-Not-Solvable-By-End-User-Game-Engine-state-is-not-identical-to-the-editor&p=2260075&viewfull=1#post2260075

I've upload his .blend file here as well, it's titled "bugScale.blend"%%%

%%%Please read this helpful post by MarcoIT which implements a solution through python: http://blenderartists.org/forum/showthread.php?275058-Not-Solvable-By-End-User-Game-Engine-state-is-not-identical-to-the-editor&p=2260075&viewfull=1#post2260075 I've upload his .blend file here as well, it's titled "bugScale.blend"%%%

%%%I can confirm this bug. Important remark in the forum thread by MarcoIT:

"i think to have found the bug,
it is in localTransform(4x4) that , make a transformation of position and orientation , but not the scale with the parent obj.

in the blend below , that make the sphere with the code should be done automatically with parent + applyRotation .afaik

(to note that worldTransform is almost new , (from 2.62) and the scale is not used pretty much in game) "

I've been diving in the BGE scenegraph lately so I'm going to take a look at this to get myself more aquainted with the code. This shouldn't be too hard to fix, right...

right...%%%

%%%I can confirm this bug. Important remark in the forum thread by MarcoIT: "i think to have found the bug, it is in localTransform(4x4) that , make a transformation of position and orientation , but not the scale with the parent obj. in the blend below , that make the sphere with the code should be done automatically with parent + applyRotation .afaik (to note that worldTransform is almost new , (from 2.62) and the scale is not used pretty much in game) " I've been diving in the BGE scenegraph lately so I'm going to take a look at this to get myself more aquainted with the code. This shouldn't be too hard to fix, right... right...%%%
Author

%%%Thanks for checking this out Arnaud. Good luck.%%%

%%%Thanks for checking this out Arnaud. Good luck.%%%

%%%This might be related to #19216%%%

%%%This might be related to #19216%%%

%%%Also related: #28908%%%

%%%Also related: #28908%%%
Member

Added subscriber: @JorgeBernalMartinez

Added subscriber: @JorgeBernalMartinez
Inês Almeida self-assigned this 2014-06-17 12:10:16 +02:00

Added subscriber: @fsiddi

Added subscriber: @fsiddi

Adding a simplified version of the enginegameparentchildrelationships.blend file.

parent_child_simplified.blend

Adding a simplified version of the enginegameparentchildrelationships.blend file. [parent_child_simplified.blend](https://archive.blender.org/developer/F99296/parent_child_simplified.blend)
Member

One more file, changing the suzanne rotation is what makes the bug noticable
parent_child_simplified_suzane.blend

One more file, changing the suzanne rotation is what makes the bug noticable [parent_child_simplified_suzane.blend](https://archive.blender.org/developer/F99499/parent_child_simplified_suzane.blend)
Member

What is happening here is due to the GE using component wise hierarchical transforms, keeping loc, rot (as a 3x3 mat) and scale separated. This has noticeable problems when a child inherits a scale in different axis than it's own, because there is simply nowhere to store that information.

I do think this is a serious problem, solvable only by doing all the hierarchical transforms math in a different way. I think this would be a good chance change everything more in depth, so I am opening a design thread for discussion leaving my input there as I spent quite some time with this bug. It does not have a quick solution.

The right file this time:
parent_child_simplified_suzane.blend

What is happening here is due to the GE using component wise hierarchical transforms, keeping loc, rot (as a 3x3 mat) and scale separated. This has noticeable problems when a child inherits a scale in different axis than it's own, because there is simply nowhere to store that information. I do think this is a serious problem, solvable only by doing all the hierarchical transforms math in a different way. I think this would be a good chance change everything more in depth, so I am opening a design thread for discussion leaving my input there as I spent quite some time with this bug. It does not have a quick solution. The right file this time: [parent_child_simplified_suzane.blend](https://archive.blender.org/developer/F99530/parent_child_simplified_suzane.blend)
Inês Almeida removed their assignment 2014-08-23 20:14:43 +02:00
Member

Added subscriber: @brita

Added subscriber: @brita

Added subscriber: @sybrenstuvel

Added subscriber: @sybrenstuvel

Added subscriber: @mobious

Added subscriber: @mobious
Member

Added subscriber: @Blendify

Added subscriber: @Blendify
Member

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Aaron Carlisle self-assigned this 2019-06-29 02:20:30 +02:00
Member

This task is being closed because the BGE has been removed in Blender 2.8.

This task is being closed because the BGE has been removed in Blender 2.8.
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
9 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#33512
No description provided.