gregdavisd / DAEBlend

Plugin script to export Collada DAE files from Blender.
GNU General Public License v3.0
36 stars 4 forks source link

Troubles with Three.js importing (r90) #6

Closed tokarev-i-v closed 3 years ago

tokarev-i-v commented 6 years ago

When I'm trying to import .dae scene to Three.js with ColladaLoader I have this Error 2018-04-04 05 39 40

There is a parameters: image Blender 2.75 Is there a way to solve this problem?

gregdavisd commented 6 years ago

Hello polyzer, It appears that the Three.js team has rewritten the Collada skinning code in the last few months so the 'Three.js' compatibility option may no longer be working. To look into it I would need the DAE file and details on the steps taken to reproduce the error. I don't know what the error means for Three.js. You could also ask the Three.js team if it's a known problem.

tokarev-i-v commented 6 years ago

Ok. I have this problem only using this DAEexporter. (Standard Blender exporter works fine) fox_sits.zip

gregdavisd commented 6 years ago

Change the "neck top" and "neck down" bone names to remove the space. e.g. "neck_top" and "neck_down". See if that fixes anything.

tokarev-i-v commented 6 years ago

Unfortunetly... it doesn't. image But for time Error was changed to another, before I reload scene in Blender. There is my .blend file, may be it will help you: Fox.zip

gregdavisd commented 6 years ago

Hello polyzer,

I've reproduced the problem and it is caused by the fox mesh being under, or parented by, the armature controller. The three.js loader encounters the controller under the skeleton and recurses again to load the skeleton which in turn finds the controller again and so on until a stack overflow occurs.

The exported parenting setup is correct as per the Collada 1.5 specification, see page 4-9 of collada_spec_1_5.pdf. So the problem is with https://github.com/mrdoob/three.js.

Also there is other bugs in three.js like it putting an identity matrix in the skeleton if it encounters an unreferenced bone sometimes causing the geometry to fold up into a mess.

The three.js code for skinning attempts to rebuild the skeleton based on the bones listed in the controller. However this rebuild does not always faithfully recreate the skeleton. This tree rebuilding procedure is a variation from how skinning is designed in Collada. As per the Collada design the skeleton tree structure is already defined with nested the XML tags. This structure should be left as it is.

In short, getting this exporter to work with three.js will require many more workarounds that I don't have the time to implement. The upcoming release of Blender 2.8 will require this exporter to be rewritten for the new Blender API so the new version may get a workaround. In the meantime consider this exporter as incompatible with three.js.

Regards, Greg.