Page MenuHome

Collada export exporting -tive z scale as wrong x rotation
Closed, InvalidPublic


Using build 25804..

In the attached .blend file is a cube modified to be assymetric, and the scaled -1 in Z at the model (not mesh) level.

When this is exported it exports the scale incorrectly (as a 3.1415 X rotation), and on collada re-import (or use in another tool) it is incorrect. If you look at the top view you will see the change between the blend file and the re-imported collada, we have verified by hand-checking the collada.

This created quite an issue as it breaks uv mapping assumptions for us, and was not like this in the previous python exporters.

We are using these exports in OSG, and the new collada exporter is a great improvement, keep up the great work.



Event Timeline

Just digging a little deeper, it appears that mat4_to_size oversimplifies the matrix decomposition, therefore assuming orthonormal matricies, ie: rot, trans, +tive scale.
At a minimum a residual matrix needs to be calculated and allowed for.

Is anyone going to look at this? this is quite a major bug in collada exports, without which a large number of belnder models are simply broken, and cannot be post-repaired.

Hi Stuart,

I'm studying this problem now. Will try to fix today or tomorrow.


Fixed in svn branch:

Please check. I've detected a few other bugs that I want to fix before merging into trunk:

* importer suffers from negative scale problem too
* bones with negative scale are exported incorrectly too
* object animation values are copied from FCurves which is not ok for child objects where values should be in parent-space


This is fantastic news Arystanbek, and much appreciated.

Unfortunately I wont be near a build environment for a couple of days but look forward to trying out these fixes.

Collada import/export is rapidly becoming essential for a lot of work so we are very happy to see these improvements.

So far looks good to me, do we need other testing before it gets integrated to main? we would love to see this mainlines ASAP.


The exporter fix is already merged into trunk (revision 26444).

Still got to work on the related bugs I mentioned above. So please don't close this report.

Arystan, any progress on these bugs?

Currently not too much time to work on this, so I'm moving this to our todo list on the wiki:

Anyone who wants to help out still can provide patches!

Thanks for reporting.

this report appears like it has been partially solved. Maybe it makes sense to create a new report for the remaining issues ? as from the log it is not precsisely clear (to me) what parts of the report are still broken.


This issue was most likely fixed with r43915 which changed export to use parentinv-matrix + loc/rot/scale instead of reinterpreting a matrix as loc/rot/scale. There are multiple "correct" ways to decomposite a matrix, but in this case if it's negative scale on single axis a rotation isn't sufficient to represent it so maybe a bug in decomposition. In any case, negative scales will remain problematic when decompositing is required in the importer.

This issue seems to be fixed. Please ask for reopening if this is not true.

Gaia Clary (gaiaclary) closed this task as Invalid.Jun 14 2012, 12:58 PM