merge util_blc_tex to prop_vt_tex. support virtools texture props when importing virtools file.

This commit is contained in:
2023-11-12 20:35:54 +08:00
parent b7ad5c67d4
commit 6991307b8b
3 changed files with 369 additions and 349 deletions

View File

@ -2,8 +2,8 @@ import bpy
from bpy_extras.wm_utils.progress_report import ProgressReport
import tempfile, os, typing
from . import PROP_preferences
from . import UTIL_virtools_types, UTIL_functions, UTIL_file_browser, UTIL_blender_mesh, UTIL_ballance_texture
from . import PROP_ballance_element, PROP_virtools_group, PROP_virtools_material
from . import UTIL_virtools_types, UTIL_functions, UTIL_file_browser, UTIL_blender_mesh
from . import PROP_ballance_element, PROP_virtools_group, PROP_virtools_material, PROP_virtools_texture
from .PyBMap import bmap_wrapper as bmap
class BBP_OT_import_virtools(bpy.types.Operator, UTIL_file_browser.ImportVirtoolsFile):
@ -87,14 +87,14 @@ def _import_virtools_textures(
vttexture.save_image(texpath_to_load)
# detect whether it is ballance texture and load
try_blc_tex: str | None = UTIL_ballance_texture.get_ballance_texture_filename(texpath_to_load)
try_blc_tex: str | None = PROP_virtools_texture.get_ballance_texture_filename(texpath_to_load)
tex: bpy.types.Image
if try_blc_tex:
# load as ballance texture
tex = UTIL_ballance_texture.load_ballance_texture(try_blc_tex)
tex = PROP_virtools_texture.load_ballance_texture(try_blc_tex)
else:
# load as other textures
tex = UTIL_ballance_texture.load_other_texture(texpath_to_load)
tex = PROP_virtools_texture.load_other_texture(texpath_to_load)
# rename and insert it to map
tex.name = UTIL_functions.virtools_name_regulator(vttexture.get_name())