kurhlaa Posted March 11, 2018 Share Posted March 11, 2018 Hello, When I use Blender and apply texture to some object - I can select an image from any folder. However, when I import scene to the BJS - it looks for all images in the folder where *.babylon file is. Import example: var meshTask = loader.addMeshTask("someName", "", "assets/", "myScene.babylon"); As a result - *.babylon file contains filenames only and BJS looks for them only in "assets/" + image_name.png. If we want to store images (and other files?) in a different separate folders - how it can be achieved? Because putting all Blender source files and all related files in one folder - not comfortable at all I see that Blender has a field with a relative path - maybe it can be exported/used somehow? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted March 11, 2018 Share Posted March 11, 2018 That option to save images in another folder is really an option for the javascript generator variant that leaked into this. It will actually save in the location specified for the JSON exporter. Only the filename without path is written to the JSON file though. Writing the full path into the field looks simple enough. Do not know if it works. Manually edit your .babylon with the extra info & test it works, then report back. Adding a fixed or DOS formatted location would cause problems, but you cannot always save everybody. Quote Link to comment Share on other sites More sharing options...
kurhlaa Posted March 11, 2018 Author Share Posted March 11, 2018 @JCPalmer, I tried to edit *.babylon file and to replace name, for example, "image_name.png" with "images/image_name.png". There probably can be any path, relative to the assets/ folder. It works, but that means editing these files (every texture's path!) after every Blender's exporting. How do you deal with that? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted March 11, 2018 Share Posted March 11, 2018 Since you reported it works, I'll change the code. When I do not know. kurhlaa 1 Quote Link to comment Share on other sites More sharing options...
kurhlaa Posted March 11, 2018 Author Share Posted March 11, 2018 @JCPalmer, Thanks anyway May I one more question about Blender exporter without new topic?! In Blender (mesh Data) you have a checkbox "Cast Shadows", but I don't see it in the exported *.babylon file. How this setting can be used in BJS? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted March 11, 2018 Share Posted March 11, 2018 This is used in the mesh list for any shadow generators for Blender lights. It is not recognized as a field in BABYLON.Mesh or BABYLON.AbstractMesh. The javascript generator does use assign it directly, but shadows mesh lists are updated with a function also written into the file. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted March 23, 2018 Share Posted March 23, 2018 @kurhlaa, have added the path onto the exporter. Commit message: Quote Blender 5.6.2 minor release The custom property, textureDir, originally for Tower of Babel to indicate the directory to write images, is now joined into the name field of the texture in the .babylon file. If the field does not end with '/', then one will be added between the directory & file name. The field is relative to the .babylon file. For this to work probably implies that the .babylon is in the same directory as the html file. Still it now allows images to be in a separate directory. Have not tested where the the .babylon is in a different directory from html file. V!nc3r and kurhlaa 1 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.