Collada: export bone to collada file, the transform matrix is not right #29672

Closed
opened 2011-12-21 08:51:11 +01:00 by davy zhang · 9 comments

%%%a single bone and a single plane as the file attached.

check the transform matrix
<float_array id="Armature_Plane-skin-bind_poses-array" count="16">1 0 0 0 0 0 1 0 0 -1 0 0 0 0 0 1</float_array>
this can not make a identity matrix,

the collada content exported is :

``` Blender User Blender 2.61.0 r42614 2011-12-21T15:46:29 2011-12-21T15:46:29 Z_UP 1 1 0 1 -1 0 -1 -0.9999998 0 -0.9999997 1 0 0 0 1 4

0 0 3 0 2 0 1 0

1 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 Bone 1 0 0 0 0 0 1 0 0 -1 0 0 0 0 0 1 0.9999984 0.9999983 0.9999983 0.9999985 1 1 1 1 0 0 0 1 0 2 0 3 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 0 0 -4.37114e-8 -1 0 0 1 -4.37114e-8 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 1 1 1 #Bone ``` %%%
%%%a single bone and a single plane as the file attached. check the transform matrix <float_array id="Armature_Plane-skin-bind_poses-array" count="16">1 0 0 0 0 0 1 0 0 -1 0 0 0 0 0 1</float_array> this can not make a identity matrix, the collada content exported is : <?xml version="1.0" encoding="utf-8"?> <COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1"> ``` <asset> <contributor> <author>Blender User</author> <authoring_tool>Blender 2.61.0 r42614</authoring_tool> </contributor> <created>2011-12-21T15:46:29</created> <modified>2011-12-21T15:46:29</modified> <unit name="meter" meter="1"/> <up_axis>Z_UP</up_axis> </asset> <library_geometries> <geometry id="Plane-mesh"> <mesh> <source id="Plane-mesh-positions"> <float_array id="Plane-mesh-positions-array" count="12">1 1 0 1 -1 0 -1 -0.9999998 0 -0.9999997 1 0</float_array> <technique_common> <accessor source="#Plane-mesh-positions-array" count="4" stride="3"> <param name="X" type="float"/> <param name="Y" type="float"/> <param name="Z" type="float"/> </accessor> </technique_common> </source> <source id="Plane-mesh-normals"> <float_array id="Plane-mesh-normals-array" count="3">0 0 1</float_array> <technique_common> <accessor source="#Plane-mesh-normals-array" count="1" stride="3"> <param name="X" type="float"/> <param name="Y" type="float"/> <param name="Z" type="float"/> </accessor> </technique_common> </source> <vertices id="Plane-mesh-vertices"> <input semantic="POSITION" source="#Plane-mesh-positions"/> </vertices> <polylist count="1"> <input semantic="VERTEX" source="#Plane-mesh-vertices" offset="0"/> <input semantic="NORMAL" source="#Plane-mesh-normals" offset="1"/> <vcount>4 </vcount> <p>0 0 3 0 2 0 1 0</p> </polylist> </mesh> <extra><technique profile="MAYA"><double_sided>1</double_sided></technique></extra> </geometry> </library_geometries> <library_controllers> <controller id="Armature_Plane-skin" name="Armature"> <skin source="#Plane-mesh"> <bind_shape_matrix>1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1</bind_shape_matrix> <source id="Armature_Plane-skin-joints"> <Name_array id="Armature_Plane-skin-joints-array" count="1">Bone</Name_array> <technique_common> <accessor source="#Armature_Plane-skin-joints-array" count="1" stride="1"> <param name="JOINT" type="name"/> </accessor> </technique_common> </source> <source id="Armature_Plane-skin-bind_poses"> <float_array id="Armature_Plane-skin-bind_poses-array" count="16">1 0 0 0 0 0 1 0 0 -1 0 0 0 0 0 1</float_array> <technique_common> <accessor source="#Armature_Plane-skin-bind_poses-array" count="1" stride="16"> <param name="TRANSFORM" type="float4x4"/> </accessor> </technique_common> </source> <source id="Armature_Plane-skin-weights"> <float_array id="Armature_Plane-skin-weights-array" count="4">0.9999984 0.9999983 0.9999983 0.9999985</float_array> <technique_common> <accessor source="#Armature_Plane-skin-weights-array" count="4" stride="1"> <param name="WEIGHT" type="float"/> </accessor> </technique_common> </source> <joints> <input semantic="JOINT" source="#Armature_Plane-skin-joints"/> <input semantic="INV_BIND_MATRIX" source="#Armature_Plane-skin-bind_poses"/> </joints> <vertex_weights count="4"> <input semantic="JOINT" source="#Armature_Plane-skin-joints" offset="0"/> <input semantic="WEIGHT" source="#Armature_Plane-skin-weights" offset="1"/> <vcount>1 1 1 1 </vcount> <v>0 0 0 1 0 2 0 3</v> </vertex_weights> </skin> </controller> </library_controllers> <library_visual_scenes> <visual_scene id="Scene" name="Scene"> <node id="Armature" type="NODE"> <translate sid="location">0 0 0</translate> <rotate sid="rotationZ">0 0 1 0</rotate> <rotate sid="rotationY">0 1 0 0</rotate> <rotate sid="rotationX">1 0 0 0</rotate> <scale sid="scale">1 1 1</scale> <node id="Bone" name="Bone" sid="Bone" type="JOINT"> <matrix sid="transform">1 0 0 0 0 -4.37114e-8 -1 0 0 1 -4.37114e-8 0 0 0 0 1</matrix> </node> </node> <node id="Plane" type="NODE"> <translate sid="location">0 0 0</translate> <rotate sid="rotationZ">0 0 1 0</rotate> <rotate sid="rotationY">0 1 0 0</rotate> <rotate sid="rotationX">1 0 0 0</rotate> <scale sid="scale">1 1 1</scale> <instance_controller url="#Armature_Plane-skin"> <skeleton>#Bone</skeleton> </instance_controller> </node> </visual_scene> </library_visual_scenes> <scene> <instance_visual_scene url="#Scene"/> </scene> ``` </COLLADA>%%%
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

%%%
1 0 0 0 0 -4.37114e-8 -1 0 0 1 -4.37114e-8 0 0 0 0 1

also this transform is not quit right%%%

%%%<node id="Bone" name="Bone" sid="Bone" type="JOINT"> <matrix sid="transform">1 0 0 0 0 -4.37114e-8 -1 0 0 1 -4.37114e-8 0 0 0 0 1</matrix> </node> also this transform is not quit right%%%

%%%Hi,

I don't have an indepth understanding of collada, but in general those matrices look ok and you should get an identity matrix if you do joint-matrix * bind-matrix. The bone has a matrix that's non-identity since it's lengthwise direction is it's local Y-axis; you can see this in pose-mode with 3d view's transform orientation set as "Gimbal".
%%%

%%%Hi, I don't have an indepth understanding of collada, but in general those matrices look ok and you should get an identity matrix if you do joint-matrix * bind-matrix. The bone has a matrix that's non-identity since it's lengthwise direction is it's local Y-axis; you can see this in pose-mode with 3d view's transform orientation set as "Gimbal". %%%

%%%Collada bugs are not being handled well so far,

for this reason they are all being set as 'TODO' and linked from our wiki page.

http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/Import_Export#OpenCollada%%%

%%%Collada bugs are not being handled well so far, for this reason they are all being set as \'TODO\' and linked from our wiki page. http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/Import_Export#OpenCollada%%%
Member

%%%Tested with revision 43930 on a windows-7 (32 build)

I use factory settings

  • open Blender
  • export scene as is as test1.dae
  • remove all elements from current scene
  • import test1.dae

result:

1.) camera, cube and lamp are imported
2.) Camera is selected (expected cubue to be selected)
3.) a new Material appears:
3.1.) Specularity set to Phong (original was CockTorr)
3.2.) Specular color set to <0.5,0.5,0.5> (original was <1.0,1.0,1.0>)

It seems to be not defined which object will become selected
right after import. When i repeat this procedure with a fresh
Blender its always the camare that gets selected.
But if i do:

  • export scene
  • delete all objects
  • import scene
  • export scene
  • delete all objects
  • import scene

then the cube is selected.


Questions:

1.) Is it expected that the material settings change ?
2.) Can the current selection state be stored in collada at all ?
3.) Would it be an option to either select all imported objects or none of the imported objects ?%%%

%%%Tested with revision 43930 on a windows-7 (32 build) I use factory settings - open Blender - export scene as is as test1.dae - remove all elements from current scene - import test1.dae result: 1.) camera, cube and lamp are imported 2.) Camera is selected (expected cubue to be selected) 3.) a new Material appears: 3.1.) Specularity set to Phong (original was CockTorr) 3.2.) Specular color set to <0.5,0.5,0.5> (original was <1.0,1.0,1.0>) It seems to be not defined which object will become selected right after import. When i repeat this procedure with a fresh Blender its always the camare that gets selected. But if i do: - export scene - delete all objects - import scene - export scene - delete all objects - import scene then the cube is selected. **** Questions: 1.) Is it expected that the material settings change ? 2.) Can the current selection state be stored in collada at all ? 3.) Would it be an option to either select all imported objects or none of the imported objects ?%%%
Member

%%%First check: Something wrong with the scaling of the bone after import (bone size scales down to 10 cm but 1 meter was expected)%%%

%%%First check: Something wrong with the scaling of the bone after import (bone size scales down to 10 cm but 1 meter was expected)%%%

%%%Gaia, can you please have an eye on this? Feel free to poke other devs it it's not directly related on collada module :)%%%

%%%Gaia, can you please have an eye on this? Feel free to poke other devs it it's not directly related on collada module :)%%%
Member

%%%The exported rotation matrix seems correct to me.
%%%

%%%The exported rotation matrix seems correct to me. %%%
Member

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
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
5 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#29672
No description provided.