Closed thetestgame closed 3 years ago
Yes, I can confirm this. This is a pressing issue, because this results in any models with a texture whose name does not match its filename to fail to be exported with textures, with this message:
Warning: Failed to find image data for texture-file-basename-without-extension-here, skipping
Traceback (most recent call last):
File "/home/rdb/lab/blend2bam/blend2bam/blend2gltf/../blender_script_common.py", line 32, in convert_files
convertfn(settings, src, dst)
File "/home/rdb/lab/blend2bam/blend2bam/blend2gltf/blender28_script.py", line 179, in export_gltf
fix_image_uri(gltf_data)
File "/home/rdb/lab/blend2bam/blend2bam/blend2gltf/blender28_script.py", line 85, in fix_image_uri
if blender_img.source == 'FILE':
AttributeError: 'NoneType' object has no attribute 'source'
The mechanism that blend2bam is using to match Blender images to glTF images is extremely fragile, since the glTF exporter uses a relatively complex mechanism to determine the name. It needs to be rethought, but let me see if I can come up with a quick stopgap solution for the common case.
When trying to convert a fbx model from the Unity AssetStore to blend then to bam via blend2bam I discovered blend2bam tries to read the image texture based on its name not its actual file name. This fbx file uses a name different then the set filename for the image.
Got: %E8%B4%B4%E5%9B%BE%20740.png (https://gyazo.com/02deffbf6c7d4d79465b7f88846e012e) Expected: ZLPP_Plant.tif