Page MenuHome

Collada: export bone to collada file, the transform matrix is not right
Closed, InvalidPublic

Description

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>

Details

Type
Bug

Event Timeline

<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".

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

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 ?

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 :)

The exported rotation matrix seems correct to me.

Gaia Clary (gaiaclary) closed this task as Invalid.Feb 8 2013, 11:52 PM