diff --git a/io_soulworker/chunks/readers/wght_reader.py b/io_soulworker/chunks/readers/wght_reader.py index c892990..4b50366 100644 --- a/io_soulworker/chunks/readers/wght_reader.py +++ b/io_soulworker/chunks/readers/wght_reader.py @@ -1,4 +1,3 @@ -from logging import debug from io_soulworker.chunks.wght_chunk import WGHTChunk from io_soulworker.core.binary_reader import BinaryReader @@ -8,11 +7,7 @@ class WGHTChunkReader: def all_of(self, vertices_count: int) -> list[WGHTChunk]: - def re(i: int): - debug('read: %d', i) - return WGHTChunk(self.__reader__) - - return [re(i) for i in range(vertices_count)] + return [WGHTChunk(self.__reader__) for _ in range(vertices_count)] def __init__(self, reader: BinaryReader): diff --git a/io_soulworker/out/model_file_reader.py b/io_soulworker/out/model_file_reader.py index 4d0c200..0c9c582 100644 --- a/io_soulworker/out/model_file_reader.py +++ b/io_soulworker/out/model_file_reader.py @@ -106,11 +106,11 @@ def __xml_material(reader: BinaryReader) -> dict[str, VisMaterial]: @staticmethod def __material_from_file(path: Path) -> dict[str, VisMaterial]: - def __float(name: str, node: Element): return float(node.attrib[name]) - # def __int(name: str, node: Element): return int(node.attrib[name]) + def __float(name: str, node: Element): + return float(node.attrib[name]) - def __color(name: str, node: Element): return [ - int(v) for v in node.attrib[name].split(',')] + def __color(name: str, node: Element): + return [int(v) for v in node.attrib[name].split(',')] def create(node: Element) -> tuple[str, VisMaterial]: material = VisMaterial() @@ -138,8 +138,10 @@ def create(node: Element) -> tuple[str, VisMaterial]: @staticmethod def __materials_paths(path: Path): + file = Path(path.name + "_data", "materials.xml") + # NPC_0001_Mirium.model -> NPC_0001_Mirium.model_data\\materials.xml - yield path.parent / (path.name + "_data/materials.xml") + yield path.parent / file # NPC_0001_Mirium.model -> Overrides\\NPC_0001_Mirium.model_data\\materials.xml - yield path.parent / "Overrides" / (path.name + "_data/materials.xml") + yield path.parent / "Overrides" / file diff --git a/io_soulworker/out/model_importer.py b/io_soulworker/out/model_importer.py index e48b3f6..fdc2a98 100644 --- a/io_soulworker/out/model_importer.py +++ b/io_soulworker/out/model_importer.py @@ -81,7 +81,7 @@ def create_blender_nodes(material: Material): texture_node: ShaderNodeTexImage = nodes.new("ShaderNodeTexImage") debug("texture path: %s", path) - texture_node.image = bpy.data.images.load(path.__str__()) + texture_node.image = bpy.data.images.load(str(path)) debug("texture loaded: %s", path) input = pbsdf_node.inputs["Base Color"] @@ -179,7 +179,7 @@ def on_skeleton(self, chunk: SkelChunk): editbone = armature.edit_bones[bone.parent_id] new.parent = editbone - bpy.ops.object.mode_set(mode="OBJECT") + bpy.ops.object.mode_set(mode="OBJECT") self.context.view_layer.update()