MarianG Posted October 24, 2018 Share Posted October 24, 2018 Hi. I'm haveing a new problem. I'm trying to import an object from string, but it doesn't work. here is my attempt: http://playground.babylonjs.com/#UKNERM#41 the same string saved as babylonjs file work. https://www.smarteam3d.com/test2 And a lot of objects worked to import as string till now, but this one not, and I cann't explain what. Any help is welcome. PS: string length: 10205552 Quote Link to comment Share on other sites More sharing options...
ssaket Posted October 24, 2018 Share Posted October 24, 2018 I am not sure because I can't open the PG, but one possible reason could be because of string overflow, and the reason it works when you use scene loader is it uses File IO operations, again if someone could very this. Another reason could be because of JSON parsing error or incorrect format. Hope this helps ! ECMASCript 2016 (ed. 7) established a maximum length of 2^53 - 1 elements. Previously, no maximum length was specified. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length Quote Link to comment Share on other sites More sharing options...
ssaket Posted October 24, 2018 Share Posted October 24, 2018 It's failing in createTexture method of engine.ts at var onload = (img: HTMLImageElement) function because the img is null; pinging @Deltakosh Quote Link to comment Share on other sites More sharing options...
Sebavan Posted October 24, 2018 Share Posted October 24, 2018 You should encode your texture in base64 in this mode if you are willing to embed them. Else they could be absolute path to url instead of data: in order to make it work. Hope that helps ssaket 1 Quote Link to comment Share on other sites More sharing options...
MarianG Posted October 27, 2018 Author Share Posted October 27, 2018 Hey, sory for late reply, and thanks for explanations. Yes, actually I have an babylon file which is base64 encoded, and on decode I got the string above. My misunderstanding is that: why, this as example https://playground.babylonjs.com/#UKNERM#42 is loaded and is saying, hey i need an image and my examply doesn't load , although that seems is the same problem. 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.