dr3d Posted October 1, 2015 Share Posted October 1, 2015 I've encountered a problem that's preventing me from loading a saved, serialized scene. new Texture() constructor takes a simple url, and assigns that url to the texture's name. so if the texture url is in a scene directory, the name will include that directory however, Internals.loadTexture() when deserializing a scene whe encountering a texture, prepends the rootURL to the texture's name. Consequently, I get errors during loads about rootUrl/rootUrl/image.png not being found ... not causing problems for anyone else? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 1, 2015 Share Posted October 1, 2015 can you share a simple .babylon that contains this issue? Quote Link to comment Share on other sites More sharing options...
dr3d Posted October 2, 2015 Author Share Posted October 2, 2015 Okay I made a quick demo of the problem. It's a bit wonky to use but illustrates problem it's at http://enjoy3d.com/babylonjs/ basically it shows a scene made from an imported meshit also loads the last 'saved' scene into another scene you can toggle to there are 3 keys you can press: if you type 's', it saves the current scene in the scene directoryif you type 't', it toggles the scene with the one last saved in the scene directoryif you type 'c', it changes the texture of the book to a jpg loaded from the scene directory. if you SAVE the original scene, no problem with the toggle.But if you change the texture and then save it, next time you refresh (and reload scene) there will be an error about textureand the toggled scene will show the missing texture pattern So I am trying to work with assets in a scene directory, but the way textures are made during scene de-serialize causes the rootURL to get prepended to the texture name - which already has the rootURL in its name. Let me know if any of this isn't clear or maybe my overall strategy could be improved somehow tnx!-scott Quote Link to comment Share on other sites More sharing options...
dr3d Posted October 2, 2015 Author Share Posted October 2, 2015 looks like if i just set texture name to same as url minus rootUrl the problem is solved Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 2, 2015 Share Posted October 2, 2015 Sounds good to me Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.