Jump to content

Blender texture images in a separate folder


kurhlaa
 Share

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

@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?

Link to comment
Share on other sites

  • 2 weeks later...

@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.

 

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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