jacquesr Posted January 29, 2016 Share Posted January 29, 2016 Hello guys, I'm addressing this directly to the babylon devs: From what I can read from examples using models with textures, the textures are always in separate image files. Are there any plans to include the textures as e. g. byte array directly inside the .babylon json? Or is there already a way to do so? The background is that I would like to define a theme for a 3D scene I'm working on to contain models and also textures and the themes should be exchangable at runtime So the best would be that the theme object contains everything. It would be great to have the babylon JSONs that I store in it also already contain the textures binaries. Kind Regards Jacques Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted January 29, 2016 Share Posted January 29, 2016 One solution could be for you to embed your textures as base64 images in a JSON. In your app you load and parse the JSON file (http://doc.babylonjs.com/tutorials/How_to_use_AssetsManager), and then create your babylon textures from that base64 images (same method as for pics). If you prefer to store your textures in the .babylon file, you'll need to write your own data file, and a specific loader, based on the one already existing for the .babylon extension. BJS has already prepared such a process for you : http://doc.babylonjs.com/tutorials/How_to_Create_Your_Own_File_Importer Have a nice day. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted January 29, 2016 Share Posted January 29, 2016 Both Blender exporters have an 'inline textures' checkbox. For full documentation, see. adam 1 Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted January 29, 2016 Share Posted January 29, 2016 Hmm JCP, that means .babylon file can already directly embed textures ?! Didn't know that. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted January 29, 2016 Share Posted January 29, 2016 Yep, since BJS 2.1, I think. Quote Link to comment Share on other sites More sharing options...
Temechon Posted February 1, 2016 Share Posted February 1, 2016 Your texture just has to be in base64. I think it's handled correctly in the scene loader. Quote Link to comment Share on other sites More sharing options...
satguru Posted February 1, 2016 Share Posted February 1, 2016 Can the scene serializer do this too? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted February 2, 2016 Share Posted February 2, 2016 I seriously doubt it. When I did it for Blender (using python), I relied on the base64 library to do all the work. You should investigate if Javascript has such a factility. 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.