Subtle part rotation after import.
dtriangle started this discussion in Model Export and Render

Strange little translation problem occurring after importing a .dae into Blender. Only happens to some parts. It happens on template 1.05 and the current beta. Anyone else encountered this?

http://c2.staticflickr.com/2/1464/24927666343_dd846b5d10_b.jpg

12 replies · Page 1 of 1
Avatar of Scrubs
Administrator

Hello, yep from my point of view there is a bug in the blender collada importer. I cannot explain it otherwise. Check the first post of the Blender template thread. Open the .dae file in a text editor and replace Y_axis up by Z_axis. You will have to manually rotate the model once imported but I noticed that those inaccuracies are gone.

I had this same problem only once! 😛

Ah okay cool, thanks Scrubs – that did the trick. It has happened on a few models for me lately.. I've just been manually changing them one by one : P

Avatar of Scrubs
Administrator

It happened to me again yesterday... Same models in other software are imported properly. It looks like the Blender collada importer has issues with decimals when computing the converted transformations. Setting the up axis to z allows to bypass this part of the code. Maybe I shall report it.

Avatar of Scrubs
Administrator

This issue with Blender starts to annoy me seriously. I did some more tests and every time when I was looking closely I managed to find a few parts which are not rotated perfectly. Hopefully, import with the Z-axis up is working correctly so what I will try to do is to do the conversion in the mecabricks importer to keep the model in a correct orientation and use Z-axis up. I hope that it won't add too much time in computation for big models and that it is not going to break it for software other than Blender.

Avatar of Scrubs
Administrator

Hello, I implemented the fix for this Blender issue. It shall not happen anymore. Hopefully other software will be happy with it too!

Edit: It is not perfect as I still managed to find a few issues, but way less than before. I don't know what Blender is doing internally for Collada import but it is buggy...

Avatar of Scrubs
Administrator

Really I don't know. There is generally almost 1° difference when there is an issue. e.g. 89.091° instead of 90° and the value doesn't seem to change...
I loaded the test collada files in other software and no problem at all.

Avatar of Scrubs
Administrator

I found the C++ code for the importer. I'll do some experiment later to see if I can find a real fix.

Avatar of Scrubs
Administrator

Yeah, I managed to properly solve this issue! Blender wasn't too happy about the precision of the float for the transform matrix. We are back to Y-axis up which means less calculations. I also took this opportunity to optimize the code. It shall use less memory for big models.

Incredible!

Nice work scrubs! You should submit the edited code to blender.

Great work, just tried it and all is well on my end !
I know it goes without saying, but anyway – Scrubs, you da man : )

Advertising
4 participants
Avatar of dtriangle
Avatar of Scrubs
Avatar of zanna
Avatar of UmbraManis

LEGO, the LEGO logo, the Minifigure, and the Brick and Knob configurations are trademarks of the LEGO Group of Companies. ©2024 The LEGO Group.

Mecabricks, the Mecabricks logo and all content not covered by The LEGO Group's copyright is, unless otherwise stated, ©2011-2024 Mecabricks.