Dad72 Posted November 24, 2015 Author Share Posted November 24, 2015 Nobody can tell me how it goes with the charger "data:{json string}" and a plugin personnal. What plugin is used in this case? Quote Link to comment Share on other sites More sharing options...
RaananW Posted November 24, 2015 Share Posted November 24, 2015 That depends on the scene filename you input. The data:... attribute is the URL, and not the filename. so, define the filename's ending yourself, and you have the answer. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted November 24, 2015 Author Share Posted November 24, 2015 I board not understood Raanan. When loading a scene like that:BABYLON.SceneLoader.Load("", "data:{json string}", engine, function (newScene) {});What plugin is used ? (personal or babylon) there is no file extension to detect the plugin to use? so this is the plugin that is used babylon or am I wrong? There is no URL of the ways to load a scene with "data:{json string}" Thank you Raanan Quote Link to comment Share on other sites More sharing options...
RaananW Posted November 24, 2015 Share Posted November 24, 2015 Sorry, sorry! My bad.I read the code too fast. You are right, this is not working like I thought it does.BUT, now I did read the code https://github.com/BabylonJS/Babylon.js/blob/master/src/Loading/babylon.sceneLoader.ts#L51If no plugin was found, it will use the last added plugin. So if you add yours, this is the plugin that will be used. Dad72 1 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted November 24, 2015 Author Share Posted November 24, 2015 Cool, thank you Raanan Quote Link to comment Share on other sites More sharing options...
Dad72 Posted November 29, 2015 Author Share Posted November 29, 2015 Hello, I have a small problem, when i serializes a scene containing an object from a remote URL. When I reload this scene, the loader search the images in local and not distant (URL distant).Basically, the loader not going to look for images on the remote server but search locally where you load the scene. and I in return 'not found' on the images How to solve it ? is a bug ? Thanks Quote Link to comment Share on other sites More sharing options...
Dad72 Posted November 29, 2015 Author Share Posted November 29, 2015 In doing, looking more ready, the URL is not serialized. In doing, looking more ready, the URL is not serialized. This requires that I add it myself. But why the url textures are not serialize? Is there a reason? This would help to find the exact path of the texture: texture.url = parsedTexture.url; I think I can add this to serialize and loader, but can be that there are reasons why this is not done? Quote Link to comment Share on other sites More sharing options...
RaananW Posted November 29, 2015 Share Posted November 29, 2015 Root URL is being used to load a babylon file. This is a parameter you provide when loading the scene. All Images are relative to this root url. Isn't root URL enough? do you need an absolute URL for each image? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted November 29, 2015 Author Share Posted November 29, 2015 do you need an absolute URL for each image? Yes, because my editor responsible for url that can come from any other server.All models of users that are hosted on their servers and when recharging their scene saved, I have to recover all its different URL (http) to rebuild the scene.My editor does not store data of users, no models and no textures... it remains their property, I am not responsible in case of problems with my server. (to avoid data loss eg) Quote Link to comment Share on other sites More sharing options...
RaananW Posted November 29, 2015 Share Posted November 29, 2015 This would require a relatively big change to the babylon loader.The global rootUrl is provided throughout the material/texture parsing. You will have to check if the URL is absolute, and if not, root URL should be used.I believe DK was talking about refactoring the babylon loaded, might be a feature that could be added to a future release. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted November 29, 2015 Author Share Posted November 29, 2015 That would be good. So how could I until a remedy that little problem on my side instead?It'll be a big problem for my editor if I can not do this. Or I have to recreate my own serializer of zero and not that completed that of babylon. When I import a model, images are in the root of where the model is loaded, but if the models are loaded by remote url, the textures is register with the path where you load the model. For example I load a model from site1.com (the editor), but the models are on site2.com (the store), serialization.but he'll consider textures site1.com and not site2.com. Yet when you look at the URL of the texture (not serialize) I have the right path, but unfortunately unusable because not serialized. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 30, 2015 Share Posted November 30, 2015 I'm definitely not for an absolute version of URL storing. I like the way it works today because you can have everything side by side with the .babylon file and use it anywhere. Adding absolute URL will open the door to CORS issues for instance Quote Link to comment Share on other sites More sharing options...
Dad72 Posted November 30, 2015 Author Share Posted November 30, 2015 Yes I opened "CORS". but for my editor, I do not want to store users data on my server, it must be on their servers so that I should not lose any data that is not for me. If I have a problem with my server, I would lose a lot of data and it would do a lot of unhappy in case of problems. Why not let people choose storage mode DK and by default have in relative mode ?. But I understand your point of seen too. I guess I'll have to create my own loader and serializer completely. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted November 30, 2015 Author Share Posted November 30, 2015 I solved by creating my own model serializer that serializes all. GameMonetize 1 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.