Grimrukh / soulstruct-blender

Blender plugins for FromSoft games, via `soulstruct`.
98 stars 4 forks source link

[HOTFIX] Lowercase texture_stem and Image Cache KeyError #61

Closed EclipsedButter closed 2 months ago

EclipsedButter commented 2 months ago

This is too simple an issue for a pull request, so: 2.0.0 makes texture_stem case-insensitive, apparently by tacking .lower() on to the end whenever it is initialized in any given scope. I noticed that, for DS1 PTDE, chr that load textures from a partsbnd (such as black knight, c2790) will cache them all lowercase, but io_soulstruct/flver/material/types.py/BlenderFLVERMaterial.new_from_flver_material, at line 233, initializes texture_stem from the sampler_texture_stems dict, which has case-sensitive stems, and so it encounters a KeyError looking for them and creates magenta image. Currently working hotfix: add texture_stem = texture_stem.lower() after line 233.

Grimrukh commented 2 months ago

Cheers, good catch, will integrate this ASAP.

Grimrukh commented 2 months ago

Should be fixed in 2.0.1; I also tried to catch a few other cases where this mattered.