Jump to content

Serialize scene not complete


Recommended Posts

I board not understood Raanan.  :unsure:


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
Link to comment
Share on other sites

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 :)


If no plugin was found, it will use the last added plugin. So if you add yours, this is the plugin that will be used.

Link to comment
Share on other sites



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 ?



Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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)
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.  :wacko:


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.
Link to comment
Share on other sites

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.  :(

Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...