-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blender exporter - Exported object transforms and geometry don't match Blender. #11803
Comments
There are a number of transformations and coordinate swaps that occur in the exporter, i think in attempts to address peoples preference for default "up" vector. These transformations are spread throughout the exporter, and don't seem completely consistent to me. I have disabled them in a local branch of the exporter, and I get a solid 1 to 1 correspondence between blender and the three viewer. You can get my modified exporter here if you want to check it out: |
I'm not familiar with the blender exporter but we discussed a similar problem right here #11540. So basically an exporter that produces output in the I'm a little bit confused now why your geometry is imported and rendered correctly even if you removed all coordinate system transformations in the exporter. The default up axis in Blender is BTW: I agree with you that the blender exporter should change the coordinate system consistently. If this is not the case, we need a fix. |
The exporter used to have controls that affected how the axes would be transformed/swapped, but that UI seems to have been changed/been removed in previous revs. And good catch on my screenshot... I did rotate the scene root in the viewer, to look at it upright. I was focusing more on the relative positions of the objects, but I understand your point. I'm suspecting that there is more nuance here than I thought... I saw you pinged @WestLangley in that other thread. Perhaps he can provide some insight. :) I do think there is a case to be made for exposing the transform UI again, or maybe there is some hidden way to enable it? |
I'm not sure we need an UI element for choosing e.g. the |
|
@izar89 I think that would be a good solution. Also, fixing the existing functionality seems important. |
Here's a copy of the .blend that shows the problem, and the resulting export... |
Agreed. |
Here's an example where the arrows are parented tip to tail, and each is rotated 25 degrees inward: Here is the blend, and exported json: |
🤔 |
Just chiming in; #11803 (comment) I mean... that looks totally broken to me. |
Yeah me too.. It definitely needs some love. I also would not be sad if there was a checkbox to allow passthrough exporting without touching vertices/transforms, for when you really just want the actual data as it is in blender.. but that is another topic. |
Any takers? 😇 |
I'm looking at it.... I think there is some confusion in the exporter, or maybe some legacy code that is transforming vertices and normals, in addition to the code transforming matrices for Y up... By disabling the vertex/normal remapping, but leaving the matrix remapping as is, it seems to produce the correct output: I'm going to stare at it a bit more, but this might be an easy fix. |
After reading the code further, simply disabling the coordinate axis flipping will touch many other parts of the exporter, so I'll need to do a bunch more reading/testing to figure out exactly what is going on... Particularly for skinned meshes and possibly morph targets. |
The JSON Blender exporter has been removed with Also see: https://threejs.org/docs/#manual/introduction/Loading-3D-models |
Description of the problem
The blender exporter is doing a bunch of coordinate space conversions to change the up axis...
So normals and vertices have their axis swapped around....
Additionally, there are attempts to adjust transforms to compensate for this shift, but they don't seem to be consistent.
When exporting the following scene, and importing the result into the three.viewer:
I get this:
Three.js version
Browser
OS
Hardware Requirements (graphics card, VR Device, ...)
The text was updated successfully, but these errors were encountered: