Three.js: Issue with importing

Created on 22 Apr 2017  路  10Comments  路  Source: mrdoob/three.js

Description of the problem

I was trying out some of the importing features of the web based editor on r84 and it was working great.After deciding to try the editor on a local server i discovered the files i was importing did not work anymore and that's when i found out that there's a difference in the versions(r85dev).Moved from Opera (ver. 44) to MS Edge (ver. 38) and everything worked again.Today I noticed an update in the version of the live editor (the one on the website) to r85 and the issues is permanent.I was importing .dae (COLLADA) files and before the update everything uploaded correctly while now after the import the scene elements are not being displayed (just the default Camera and Scene) and the 2D coordinate system disappears.I've also tried importing on Firefox 53 and it did not work with the current version of the editor.I do apologize if this is a known issue and I've missed it in the issues list.

Three.js version
  • [x] r85
  • [ ] r84
  • [ ] ...
Browser
  • [ ] All of them
  • [ ] Chrome
  • [x] Firefox
  • [x] Opera
  • [ ] Internet Explorer
OS
  • [ ] All of them
  • [x] Windows
  • [ ] macOS
  • [ ] Linux
  • [ ] Android
  • [ ] iOS
Bug

Most helpful comment

Thanks for reporting this. I think it should be fixed now. Do you mind trying with the latest?

All 10 comments

Yeah, i face same issue as well. I have a scene file that i've got from online three.js editor and it was working until 1 week ago. But it doesn't work at the moment. It looks like something has been broken after latest update.

@devcem Can you please share this scene file for testing? Besides, do you see any warnings/errors in the browser console?

@devcem I suggests running your files on MS Edge.You may get different result.If you're not running Windows maybe you can ask a buddy to run them for you?

@plamen-dimitrov06, thank you for your suggestion but it didn't work on MS Edge as well. Yet MS Edge doesn't return any error or console log. I've also tried with other web browsers but they gave same reactions.

Yes, @Mugen87. I see warnings and errors in browser console. It returns this console error, when i tried to import my scene file :
Uncaught TypeError: Materials[json.type] is not a constructor
And a screenshot from console log to see all flow ;
sceenshot - 10 59 16

In addition to, i've tried to import my scene file on r83 and r84 versions to make sure if they have been broken in last week. And in these versions, scene can be imported properly. When i tried to fetch and work on latest commits, i can see that SceneLoader.js file moved into deprecated folder. It looks like something changed on there.

@devcem Thanks for the logs! Is it still possible that you share your file for debugging purposes?

i can see that SceneLoader.js file moved into deprecated folder

SceneLoader was already deprecated and located in the mentioned folder. With r85 it is now removed from the library. But i'm not sure this change causes your problem.

Maybe the error occurs because json.type is MultiMaterial. That would break the following code in MaterialLoader.

import * as Materials from '../materials/Materials';

...

var material = new Materials[ json.type ](); // `MultiMaterial` is not a property of `Materials`

@devcem If you don't want to share your model, can you please debug what's the value of json.type in your case?

@Mugen87 my scene contains some commercial models in it. But I can send you scene file with email, if you still use this email address : michael.[email protected]?

Also, json.type value of scene is "object" and scene file has some materials with "MultiMaterial" value.
Here is a screenshot from debug log ;
sceenshot - 12 07 11

Yeah that's my email address.

Thanks for reporting this. I think it should be fixed now. Do you mind trying with the latest?

Yeah, @mrdoob . It works properly, thank you very much.

Was this page helpful?
0 / 5 - 0 ratings