This commit is contained in:
2026-02-24 17:35:26 -08:00
parent 1c3c30e6ce
commit d45c632dcd
28 changed files with 1982 additions and 97 deletions

View File

@ -16,11 +16,13 @@
#
import os
import shutil
import subprocess
from typing import Any, Dict, Optional, Tuple
import bpy
import os
import lnx.assets
import lnx.assets as assets
import lnx.log as log
import lnx.make_state
import lnx.material.cycles_functions as c_functions
@ -1003,7 +1005,12 @@ def make_texture(
wrd = bpy.data.worlds['Lnx']
max_size = int(wrd.lnx_max_texture_size)
if max_size > 0 and image is not None:
original_filepath = filepath
filepath = resize_texture_if_needed(image, filepath, max_size)
if filepath != original_filepath:
resized_filename = lnx.utils.extract_filename(filepath)
tex['file'] = lnx.utils.safestr(resized_filename)
# Link image path to assets
# TODO: Khamake converts .PNG to .jpg? Convert ext to lowercase on windows