forked from LeenkxTeam/LNXSDK
Cleanup
This commit is contained in:
@ -75,8 +75,8 @@ def resize_texture_if_needed(image: bpy.types.Image, filepath: str, max_size: in
|
||||
texture_quality = wrd.lnx_texture_quality
|
||||
|
||||
cache_key = (filepath, max_size, texture_quality, os.path.getmtime(filepath) if os.path.exists(filepath) else 0)
|
||||
if cache_key in _texture_resize_cache:
|
||||
cached_path = _texture_resize_cache[cache_key]
|
||||
if cache_key in texture_resize_cache:
|
||||
cached_path = texture_resize_cache[cache_key]
|
||||
if os.path.exists(cached_path):
|
||||
return cached_path
|
||||
|
||||
@ -101,7 +101,7 @@ def resize_texture_if_needed(image: bpy.types.Image, filepath: str, max_size: in
|
||||
src_mtime = os.path.getmtime(filepath)
|
||||
dst_mtime = os.path.getmtime(resized_path)
|
||||
if dst_mtime >= src_mtime:
|
||||
_texture_resize_cache[cache_key] = resized_path
|
||||
texture_resize_cache[cache_key] = resized_path
|
||||
return resized_path
|
||||
|
||||
try:
|
||||
@ -146,7 +146,7 @@ def resize_texture_if_needed(image: bpy.types.Image, filepath: str, max_size: in
|
||||
|
||||
if result.returncode == 0 and os.path.exists(resized_path):
|
||||
print(f"[Texture Optimizer] Resized: {basename} {width}x{height} -> {new_width}x{new_height}")
|
||||
_texture_resize_cache[cache_key] = resized_path
|
||||
texture_resize_cache[cache_key] = resized_path
|
||||
return resized_path
|
||||
else:
|
||||
error_msg = result.stderr.decode('utf-8', errors='ignore') if result.stderr else 'Unknown error'
|
||||
|
||||
Reference in New Issue
Block a user