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

how to load json produced with convert_to_threejs.py #5983

Closed
grgr opened this issue Jan 26, 2015 · 13 comments
Closed

how to load json produced with convert_to_threejs.py #5983

grgr opened this issue Jan 26, 2015 · 13 comments
Labels

Comments

@grgr
Copy link

grgr commented Jan 26, 2015

I tried to load json-files produced with convert_to_threejs.py with ObjectLoader, JSONLoader and SceneLoader.
No chance, the structure of the json-files does not fit the expected structure from the Loaders.

IMPORTANT: If I upload the files to clara.io and then download them in threejs-json-format everthing works as expected (with ObjectLoader). The json-file structure from clara.io is differrent than the one produced with convert_to_threejs.py.

Is this a known issue?
Are there some hints I could follow?
Is someone working on convert_to_threejs.py actually?
If not I could give it a try. The differences are not too big.

Thanks in advance

@mrdoob
Copy link
Owner

mrdoob commented Jan 26, 2015

JSONLoader should be able to load them. What error are you getting?
convert_to_threejs.py is kind of deprecated though...

@grgr
Copy link
Author

grgr commented Jan 26, 2015

I get the console message that I should use SceneLoader. But SceneLoader is substituted with ObjectLoader in #5560. And ObjectLoader needs a slightly different json Format than the one produced with convert_to_threejs.py.
Is there another possibility to convert .fbx (and .obj) at the moment or someone working on it or some other plans?
Just wanted to be sure before I start something.

@mrdoob
Copy link
Owner

mrdoob commented Jan 26, 2015

You can load the .fbx in Blender and export from there to .json using the exporter.

@grgr
Copy link
Author

grgr commented Jan 27, 2015

I will try if the conversion is automatable with commandline blender.
So, can I conclude there is no work going on to fit convert_to_threejs.py to the needs of ObjectLoader?

@mrdoob
Copy link
Owner

mrdoob commented Jan 27, 2015

Yeah, convert_to_threejs.py is very outdated and unmaintained.
If you want a command line approach, maybe you can try node.js + OBJLoader.js + object.toJSON()?

@grgr
Copy link
Author

grgr commented Jan 27, 2015

Thank you for the hint with node.js! I will give it a try.

@grgr grgr closed this as completed Jan 27, 2015
@mrdoob
Copy link
Owner

mrdoob commented Jan 27, 2015

Let me know how it goes! :)

@bsenftner
Copy link

For what it’s worth, we use convert_to_threes.py at the www.3d-Avatar-Store.com http://www.3d-avatar-store.com/, and load with the JSONLoader.

Is that path being phased out?

Sincerely,
-Blake Senftner

On Jan 27, 2015, at 6:57 AM, Mr.doob notifications@github.com wrote:

Let me know how it goes! :)


Reply to this email directly or view it on GitHub #5983 (comment).

@mrdoob
Copy link
Owner

mrdoob commented Jan 27, 2015

Eventually, yes.

@grgr
Copy link
Author

grgr commented Feb 9, 2015

So @mrdoob, I did not have time before but here is something like an answer how it goes :)

OBJLoader is great for .obj-files but loads .fbx or .3DS with Mesh.geometry.boundingSphere.radius = 0 and Mesh.geometry.boundingSphere.center has only NaN values .
But these files are converted with values with convert_to_threejs.py.

You gave me the hint with OBJLoader. But OBJLoader like SceneLoader can only be found in examples/js/loaders and not in src/loaders. The fact that SceneLoader is kind of deprecated made me think all the stuff in the examples/js/loaders is kind of deprecated. So I did not want to use it.
Finally, after your hint, I threw away my worries about deprecation and got the json-files produced with convert_to_threejs.py to show up with SceneLoader and STLLoader as GeometryHandler :)

@mrdoob
Copy link
Owner

mrdoob commented Feb 10, 2015

The fact that SceneLoader is kind of deprecated made me think all the stuff in the examples/js/loaders is kind of deprecated.

Oh, good point... I should create a deprecated folder...

mrdoob added a commit that referenced this issue Feb 19, 2015
@RunninglVlan
Copy link
Contributor

Yeah, convert_to_threejs.py is very outdated and unmaintained.

Hi. I just tried to load an object converted from FBX with help of convert_to_threejs.py and JSONLoader threw an Error that I need to use SceneLoader for the loading. Then I found out that it's deprecated. Normally when something becomes deprecated, it is replaced by something new. There is no mention in SceneLoader however that we need to use ObjectLoader instead.

Now I also find out that convert_to_threejs.py is outdated, but there's no mention about it in its README.md either. This got me really frustrated. I think it would be good to have a message in SceneLoader that it's replaced by ObjectLoader, and in convert_to_threejs.py that it isn't compatible with ObjectLoader yet.

@mrdoob
Copy link
Owner

mrdoob commented May 2, 2015

I'm sorry.

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

4 participants