0
$\begingroup$

I am using Blender on Windows, version 2.92.0. I have "Relative Paths" selected in the "Save & Load" panel of the Preferences.

I have a lot of directories, each with a set of .png images with the same names.

When using the shader editor, and creating an Image Texture node, the Blender File View has "Relative Paths" also selected. When I navigate through the directories and select the image, the Image is given the name of the image, with none of the previous sub-directories considered. For example, if I have a .blend file C:\Example\example.blend, and an asset directory with the following contents:

C:\Example\Icons\foo\1.png
C:\Example\Icons\foo\2.png
C:\Example\Icons\foo\3.png

C:\Example\Icons\bar\1.png
C:\Example\Icons\bar\2.png
C:\Example\Icons\bar\3.png

...

If I import all of these, they will show up in the Blender File Outliner, under images, but as 1.png, 1.png.001, 1.png.002, and so on, instead of what I would expect, which is in a series of directories or groups based on the relative path, such as //Icons/bar/1.png. At one point I was able to find the properties of the image itself, which did in fact use that path as the filename of the image. I can't find that dialog box anymore.

I would expect the Blender File Outliner to allow me to create some kind of subcategory or group in the "Images" node in order to organize them, but that doesn't seem possible either. It's not clear to me how one is expected to organize a large amount of Image assets in a .blend file. and manually naming individual images "some/long/directory/foo.png" seems like the only option. Am I wrong?

$\endgroup$
0
$\begingroup$

No, you are right. When blender encounters files with the same name (regardless of where they are from), it assigns a .### to the end of the newly loaded file’s data block name (same is true of any data block being introduced into the blend file, actually). As you said, though, the filepath property of the images are still different, and the images are not equal. You can look at this property with:

>>> bpy.data.images[“datablockname.png”].filepath
$\endgroup$
5
  • $\begingroup$ I should be able to write a script that goes through each image and renames it. I'm just really surprised there's no Collection-style grouping for file resources. I am very curious to see how an expert with a ton of assets uses Blender and keeps resources organized. $\endgroup$ – wherezyurheadat May 4 at 1:30
  • 1
    $\begingroup$ I’m an ExPort, does that count? $\endgroup$ – TheLabCat May 4 at 1:32
  • $\begingroup$ I don't know what that means, sorry :-(. Also I just tried it and it turns out that images have a very short maximum length, 64 characters or so, so forcefully renaming them to their filepaths isn't going to work either, because my directorie's names are much longer in length. Back to the drawing board! $\endgroup$ – wherezyurheadat May 4 at 1:48
  • $\begingroup$ What it means is that I don’t use tons of assets, but the assets I do use I try not to name numerically. $\endgroup$ – TheLabCat May 4 at 2:01
  • $\begingroup$ Apart from that I'm also more like @ZargulTheWizard when it comes to naming things, regarding your problem with limited name lengths... when I see your example, is it necessary to rename those files with the complete path? Wouldn't foo/1.png, bar/1.png etc. also work? Maybe you find a way to shorten names. $\endgroup$ – Gordon Brinkmann May 4 at 6:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.