COLLADA exports animations values for Location in world space instead of local space #45687

Closed
opened 2015-08-05 17:04:41 +02:00 by Eric · 18 comments

System Information
N/A

Blender Version
Broken: 2.75 c6b042b
Worked: NO

Short description of error
DAE/COLLADA exporter generates animation curve output values for Location in world space coordinates instead of local space coordinates.

It seem this bug affects only the Location (i.e. "location.X", "location.Y", "location.Z") components for non-bones objets, the Rotation values seem to be correctly exported in local space (i don't have tested Scale components).

This bug does not affects the "matrix" type animations (commonly used for bones's animations) which are correctly exported in local space.

This is NOT an importation-side problem (this is obvious but i prefer to point that) since even Blender don't correctly import the file he just exported and the problem is the same in any other DAE viewer or 3D software.

This bug is old, i mentioned it few years ago, but it seem nobody to took me seriously. I don't think it is hard to correct this bug, this is a little bug, but corrupts all (COLLADA) animation data exported by Blender.

anim-test.blend

anim-test.dae

test-anim-FBXreview.jpg

test-anim-Open3D.jpg

Exact steps for others to reproduce the error

  1. Create a scene with animated objects where some are parented to others
  2. Export as COLLADA
  3. Check the firsts output key values for Localtion.X, Y and Z in the DAE file, compare with the transformations data of the : There is obviously a problem.
    3-bis) Look the original animation in Blender, re-import the DAE file just created, and look again the animation.
**System Information** N/A **Blender Version** Broken: 2.75 c6b042b Worked: NO **Short description of error** DAE/COLLADA exporter generates animation curve output values for Location in world space coordinates instead of local space coordinates. It seem this bug affects only the Location (i.e. "location.X", "location.Y", "location.Z") components for non-bones objets, the Rotation values seem to be correctly exported in local space (i don't have tested Scale components). This bug does not affects the "matrix" type animations (commonly used for bones's animations) which are correctly exported in local space. This is NOT an importation-side problem (this is obvious but i prefer to point that) since even Blender don't correctly import the file he just exported and the problem is the same in any other DAE viewer or 3D software. This bug is old, i mentioned it few years ago, but it seem nobody to took me seriously. I don't think it is hard to correct this bug, this is a little bug, but corrupts all (COLLADA) animation data exported by Blender. [anim-test.blend](https://archive.blender.org/developer/F220305/anim-test.blend) [anim-test.dae](https://archive.blender.org/developer/F220306/anim-test.dae) ![test-anim-FBXreview.jpg](https://archive.blender.org/developer/F220307/test-anim-FBXreview.jpg) ![test-anim-Open3D.jpg](https://archive.blender.org/developer/F220309/test-anim-Open3D.jpg) **Exact steps for others to reproduce the error** 1) Create a scene with animated objects where some are parented to others 2) Export as COLLADA 3) Check the firsts output key values for Localtion.X, Y and Z in the DAE file, compare with the transformations data of the <node>: There is obviously a problem. 3-bis) Look the original animation in Blender, re-import the DAE file just created, and look again the animation.
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @Sedenion42

Added subscriber: @Sedenion42
Member

Added subscriber: @Blendify

Added subscriber: @Blendify

Added subscribers: @GaiaClary, @Sergey

Added subscribers: @GaiaClary, @Sergey
Gaia Clary was assigned by Sergey Sharybin 2015-08-06 12:38:34 +02:00

@GaiaClary, are you still around to help us with collada?

@GaiaClary, are you still around to help us with collada?
Author

i looked to blender's source code and strangely i don't see where is the problem (from what i understand of blender source code) since the exporter just puts the BezTriple.vec content in the DAE file... so, i can see only two possible mistakes: blender keep animation curves in world space (which seem strange to me) or the wrong fcurve is selected for exportation... Unfortunatly the Blender's architecture is relatively opaque to me...

i looked to blender's source code and strangely i don't see where is the problem (from what i understand of blender source code) since the exporter just puts the BezTriple.vec content in the DAE file... so, i can see only two possible mistakes: blender keep animation curves in world space (which seem strange to me) or the wrong fcurve is selected for exportation... Unfortunatly the Blender's architecture is relatively opaque to me...
Member

@Sergey: sure i am available.
@Sedenion42: i remember something strange goes on when using transformation type TransRotLock while it works when using transformation type Matrix (in the collada export options). it might be related.

i can take a look at this next week (if nobody else is faster).

@Sergey: sure i am available. @Sedenion42: i remember something strange goes on when using transformation type TransRotLock while it works when using transformation type Matrix (in the collada export options). it might be related. i can take a look at this next week (if nobody else is faster).
Author

@GaiaClary Note that Matrix animation export works only for bones. I don't know if it's a feature or a bug, but whatever you select in the export options, the animations for non-bones objects are exported in TransRotLoc way.

@GaiaClary Note that Matrix animation export works only for bones. I don't know if it's a feature or a bug, but whatever you select in the export options, the animations for non-bones objects are exported in TransRotLoc way.
Member

It looks like the matrix_parent_inverse information gets lost during export.

I made the following test:

  • exported the 3 objects to collada
  • imported the objects back into the same blend file
  • copied the matrix_parent_inverse values from the original objects to the reimported objects.

Now the animation works again as expected.

As far as i know Collada does not support the concept of "matrix_parent_inverse". So the exported objects all have their matrix_parent_inverse "applied" to preserve the correct object locations in world space. But the animation curves are exported without applying the matrix_parent_inverse

So i guess the fix is to apply the matrix_parent_inverse also to the animation curves during export (if that makes sense)...

It looks like the matrix_parent_inverse information gets lost during export. I made the following test: - exported the 3 objects to collada - imported the objects back into the same blend file - copied the matrix_parent_inverse values from the original objects to the reimported objects. Now the animation works again as expected. As far as i know Collada does not support the concept of "matrix_parent_inverse". So the exported objects all have their matrix_parent_inverse "applied" to preserve the correct object locations in world space. But the animation curves are exported without applying the matrix_parent_inverse So i guess the fix is to apply the matrix_parent_inverse also to the animation curves during export (if that makes sense)...
Author

That make sens to me yes... and the "inverse parent" matrix has, to me, nothing to do in the transformations informations... ( I was forced to adapt my importer to properly compute this strange matrice by multiplying it by the local matrix ).

In my knowledge The "matrix_parent_inverse" is an exclusivity of blender. As far as i know, objects usually just have two main matrices, the local one, and the world-matrix, which is the result of the successive multiplications of parent's world-matrix with the local one (which give the final world transformation).

"world_matrix = local_matrix * parent->world_matrix" si what i do, and i'm not sur, but i think everybody (except blender it seems) do like that...

That make sens to me yes... and the "inverse parent" matrix has, to me, nothing to do in the transformations informations... ( I was forced to adapt my importer to properly compute this strange matrice by multiplying it by the local matrix ). In my knowledge The "matrix_parent_inverse" is an exclusivity of blender. As far as i know, objects usually just have two main matrices, the local one, and the world-matrix, which is the result of the successive multiplications of parent's world-matrix with the local one (which give the final world transformation). "world_matrix = local_matrix * parent->world_matrix" si what i do, and i'm not sur, but i think everybody (except blender it seems) do like that...
Author

In fact, all matrices and transformations should be "local" to object in the exported file... the world transformations are computed later, in the engine (whatever the engine) who multiply naturally the local matrix with parent matrix (except for root objects).

In fact, all matrices and transformations should be "local" to object in the exported file... the world transformations are computed later, in the engine (whatever the engine) who multiply naturally the local matrix with parent matrix (except for root objects).
Member

Closed as duplicate of #43298

Closed as duplicate of #43298

Changed status from 'Duplicate' to: 'Open'

Changed status from 'Duplicate' to: 'Open'
Member

Removed subscriber: @Blendify

Removed subscriber: @Blendify
Member

I have started a rework of the animation exporter. The fix in D3070 already solves the issue, but it needs some refinement and further testing.

I have started a rework of the animation exporter. The fix in [D3070](https://archive.blender.org/developer/D3070) already solves the issue, but it needs some refinement and further testing.
Member

The reworked animation exporter/importer is now in master

The reworked animation exporter/importer is now in master
Member

And now it is also in Blender 2.8

And now it is also in Blender 2.8
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
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
6 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#45687
No description provided.