Two ways of creating the same scene result in different values for the objects transforms. #55103

Closed
opened 2018-05-16 20:06:30 +02:00 by k · 5 comments

System Information
Void Linux, Nvidia Titan
Also tested on Windows.

Blender Version
2.79b

Short description of error
The following two ways of creating the (seemingly) same scene result in different values for the objects transforms.

Exact steps for others to reproduce the error
Init:

  • create 3 cubes (Object mode -> add -> mesh -> cube )
    In my description I will call those cube a, cube b, and cube c.

steps towards what I consider the bugged result bugged.blend:

  • select cube b and change its transform y to 2
  • select cube c and change its transform y to 4
  • leave cube a at origin
  • parent cube c to cube b
  • parent cube b to cube a
  • to demonstrate the real weirdness, now set the transform z of cube b to 2

this results in these transform values for the respective cubes:
cube a:
x: 0
y: 0
z: 0
cube b:
x: 0
y: 2
z: 2
cube c:
x: 0
y: 4
z: 0

which is completely puzzling.
In which coordinate system is the transform of cube c supposed to be?
It's not in a global coordinate system, although one could expect it from y being 4.
But z is 0, while one can see by its actual position that in global coordinates it should be 2 (just like its parent b)
It is not in coordinates relative to its parent either, since then y should be 2, not 4.
This makes no sense at all, and I consider it buggy.

Even worse is that you can create the same scene in a different way with the result being exactly what I expect.
Just reorder the operations.

steps towards expected result expected.blend:

  • parent cube c to cube b
  • parent cube b to cube a
  • select cube b and change its transform y to 2 and its z to 2
  • select cube c and change its transform y to 2

this results in these transform values for the respective cubes:
cube a:
x: 0
y: 0
z: 0
cube b:
x: 0
y: 2
z: 2
cube c:
x: 0
y: 2
z: 0

Which is what I would expect.
The transforms are relative to their parent.

How could I know from an exported file ( for example I use gltf ), where the nodes are supposed to be positioned?
It's impossible as long as the first way results in nonsensical values for the transform (which get exported 1-to-1 into the gltf file)

The way I think it should be (and how it is in game engines and the like) is that every node should have global and local (meaning relative to its parent) transforms exposed.
It would be simple and require no magical numbers.

**System Information** Void Linux, Nvidia Titan Also tested on Windows. **Blender Version** 2.79b **Short description of error** The following two ways of creating the (seemingly) same scene result in different values for the objects transforms. **Exact steps for others to reproduce the error** Init: - create 3 cubes (Object mode -> add -> mesh -> cube ) In my description I will call those cube a, cube b, and cube c. steps towards what I consider the bugged result [bugged.blend](https://archive.blender.org/developer/F3376461/bugged.blend): - select cube b and change its transform y to 2 - select cube c and change its transform y to 4 - leave cube a at origin - parent cube c to cube b - parent cube b to cube a - to demonstrate the real weirdness, now set the transform z of cube b to 2 this results in these transform values for the respective cubes: cube a: x: 0 y: 0 z: 0 cube b: x: 0 y: 2 z: 2 cube c: x: 0 y: 4 z: 0 which is completely puzzling. In which coordinate system is the transform of cube c supposed to be? It's not in a global coordinate system, although one could expect it from y being 4. But z is 0, while one can see by its actual position that in global coordinates it should be 2 (just like its parent b) It is not in coordinates relative to its parent either, since then y should be 2, not 4. This makes no sense at all, and I consider it buggy. Even worse is that you can create the same scene in a different way with the result being exactly what I expect. Just reorder the operations. steps towards expected result [expected.blend](https://archive.blender.org/developer/F3376462/expected.blend): - parent cube c to cube b - parent cube b to cube a - select cube b and change its transform y to 2 and its z to 2 - select cube c and change its transform y to 2 this results in these transform values for the respective cubes: cube a: x: 0 y: 0 z: 0 cube b: x: 0 y: 2 z: 2 cube c: x: 0 y: 2 z: 0 Which is what I would expect. The transforms are relative to their parent. How could I know from an exported file ( for example I use gltf ), where the nodes are supposed to be positioned? It's impossible as long as the first way results in nonsensical values for the transform (which get exported 1-to-1 into the gltf file) The way I think it should be (and how it is in game engines and the like) is that every node should have global and local (meaning relative to its parent) transforms exposed. It would be simple and require no magical numbers.
Author

Added subscriber: @KevinMichalev

Added subscriber: @KevinMichalev
Author

Actually, after some testing, it seems like exporting to gltf does seem to export the transforms relative to their parent.
So everything is fine in that regard.
Still it seems to be confusing for the values in blender to be different just by reordering the actions a bit.

Actually, after some testing, it seems like exporting to gltf does seem to export the transforms relative to their parent. So everything is fine in that regard. Still it seems to be confusing for the values in blender to be different just by reordering the actions a bit.
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Philipp Oeser self-assigned this 2018-05-17 13:01:57 +02:00
Member

This is because of whats called the Parent Inverse.
This might not be how this is done in many other applications (but it does its job)

There is some explanation to it in the manual .
Please also refer there to set parenting up without Parent Inverse (or how to clear it later)
This document also explains it nicely, and there is probably more information on the internet.

So as you say it's not in global coords, it's not in parent's coords either, it's

  • matrix_basis = object transform coordinates
  • matrix_parent_inverse = object correcting matrix
  • matrix_local = matrix_parent_inverse x matrix_basis
  • matrix_world = parent's matrix_world (or global origin) x matrix_local

Note that to my knowledge there is no builtin method to clear it without affecting a childs global transform, but you can do it with a script:
https://blender.stackexchange.com/questions/28896/how-to-clear-parent-inverse-without-actually-moving-the-object

Hope this clarifies it? Dont think this can be considered a bug though...

This is because of whats called the `Parent Inverse`. This might not be how this is done in many other applications (but it does its job) There is some explanation to it in [the manual ](https://docs.blender.org/manual/en/dev/editors/3dview/object/properties/relations/parents.html). Please also refer there to set parenting up **without** `Parent Inverse` (or how to clear it later) [This document ](https://wiki.blender.org/index.php/User:Pepribal/Ref/Appendices/ParentInverse) also explains it nicely, and there is probably more information on the internet. So as you say it's not in global coords, it's not in parent's coords either, it's - matrix_basis = object transform coordinates - matrix_parent_inverse = object correcting matrix - matrix_local = matrix_parent_inverse x matrix_basis - matrix_world = parent's matrix_world (or global origin) x matrix_local Note that to my knowledge there is no builtin method to clear it without affecting a childs global transform, but you can do it with a script: https://blender.stackexchange.com/questions/28896/how-to-clear-parent-inverse-without-actually-moving-the-object Hope this clarifies it? Dont think this can be considered a bug though...
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
2 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#55103
No description provided.