Skip to content
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

Incorrectly exported a project from Blender #9454

Closed
acopalipsis opened this issue Aug 3, 2016 · 11 comments
Closed

Incorrectly exported a project from Blender #9454

acopalipsis opened this issue Aug 3, 2016 · 11 comments
Labels

Comments

@acopalipsis
Copy link

A project in Blender -

_013
_014

three editor (note the arrows to the active camera) -
_015

the render shows a black screen on that picture is not attached.
Turn around 180 degrees (note the arrows to the active camera) -

_016
The source of light from above, lighting is the side.

Is it possible to fix this and how?

@WestLangley
Copy link
Collaborator

@acopalipsis
Copy link
Author

@WestLangley ???

@mrdoob mrdoob added the Bug label Aug 4, 2016
@mrdoob
Copy link
Owner

mrdoob commented Aug 4, 2016

@BenCidPerez Sounds like we're not handling the cameras correctly?

@BenCidPerez
Copy link
Contributor

@mrdoob Don't think it's only a camera issue. The light source also is getting flipped by 90° - the scene export is not converting from blender coordinates (z-up) to three.js (y-up), so everything is on it's side unless you rotate it manually.
Export of individual objects is handled differently regarding the coordinate system. We need to get this consistent, especially, if JSONLoader is gonna get depecrated. Looking into it with @daniel-nth but will take some work.

@mrdoob
Copy link
Owner

mrdoob commented Aug 8, 2016

Looking into it with @daniel-nth but will take some work.

Thanks!

@acopalipsis
Copy link
Author

unless you rotate it manually
I didn't buy it all by default.

Yesterday, almost finished modeling my first 3D game and realized that the situation is hopeless.
All of the normals are wrong, the materials get turned inside out (I refused to import lights and cameras, and about animation in General am silent). And separately I want to note that in the Blender before I import restore all normals, and applying transformation. And I understand if all the normals are shot down, the normals map, ao and other maps will not work. As the editor and soms threejs?

@BenCidPerez
Copy link
Contributor

@acopalipsis I'm having a bit of a hard time totally understanding the problems you are having.
Could you attach some examples of blender-files / results in three.js to make it easier to see, where possible problems could come from?

Our company has created several prototypes and games for customers using a combination of blender and three.js and although the exporter most definitely got some problems, it hasn't been terrible - compared with the blender - support of other webGL-based 3D-frameworks (and believe me, I think we tried them all) it is actually the framework that works best with blender. Granted, you maybe trying to use some advanced features, thereby running into problems we did not encounter yet - another reason why some example-files could help understanding the issues.

@acopalipsis
Copy link
Author

@BenCidPerez create new project -> delete cube -> create circle -> edit mode hotkey (E, 0, enter, alt + M, at center) -> file -> export -> threejs json -> http://threejs.org/editor/ -> import .json -> create light... -> scene is empty. The view from below - you will see a circle. And so it is always. And in my code I'm loading with ObjectLoader. And this is only part of the problem.

The main problem with partially smoothed objects. If you try to restore the normal in threejs, smooth becomes the whole object.

But I still decided to import it into threejs as .obj... But what about animation? For the animation you want to export from blender as threejs .json?

@BenCidPerez
Copy link
Contributor

create new project -> delete cube -> create circle -> edit mode hotkey (E, 0, enter, alt + M, at center) -> file -> export -> threejs json -> http://threejs.org/editor/ -> import .json -> create light... -> scene is empty.

If you turn on "backface culling" in blender, you will see, that your normals are wrong already in the blender file. They are all pointing down, so in the scene, if you look from above, you won't see anything, unless you use "THREE.DoubleSide" on your material, thereby disabling backface culling for that material specifically. That is not the fault of THREE.js - your model is just created that way.

The main problem with partially smoothed objects. If you try to restore the normal in threejs, smooth becomes the whole object

@acopalipsis You need to split the edges by duplicating the vertices of the edge. Easiest way to do this, is using blender's edge-split modifier. This is not THREE.js specific. But I don't think this is the right place for a general "Creating game assets in Blender" discussion.

I can't say anything about the three.js editor - never used it. We export everything as JSON from blender and import it into our Three.js projects.

Maybe you want to take a look at some Blender-related tutorials, and afterwards some export-related ones, like this one here:
http://www.jonathan-petitcolas.com/2015/07/27/importing-blender-modelized-mesh-in-threejs.html

@acopalipsis
Copy link
Author

@BenCidPerez specifically, in this case You are right.

@Mugen87
Copy link
Collaborator

Mugen87 commented May 31, 2018

The JSON Blender exporter has been removed with R93 (#14117).

Also see: https://threejs.org/docs/#manual/introduction/Loading-3D-models

@Mugen87 Mugen87 closed this as completed May 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants