Skip to content

Commit

Permalink
update xc3_model_py, root motion and infer game version
Browse files Browse the repository at this point in the history
  • Loading branch information
ScanMountGoat committed Dec 2, 2024
1 parent cfc72a0 commit 469fd02
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 29 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## unreleased
### Added
* Added support for root motion to mot animation loading.

### Removed
* Removed the "Game Version" property for wimdo and wismhd import. Shader databases are now selected automatically based on the file data.

## 0.16.0 - 2024-11-27
### Added
* Added support for exporting vertex groups for bones in the skeleton but not in the wimdo bone list.
Expand Down
3 changes: 2 additions & 1 deletion xenoblade_blender/import_camdo.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import math

from .import_root import (
get_database_path,
get_image_folder,
import_armature,
import_model_root,
Expand Down Expand Up @@ -73,7 +74,7 @@ def import_camdo(
):
start = time.time()

database_path = os.path.join(os.path.dirname(__file__), "xcx.bin")
database_path = get_database_path()
database = xc3_model_py.shader_database.ShaderDatabase.from_file(database_path)
root = xc3_model_py.load_model_legacy(path, database)

Expand Down
5 changes: 2 additions & 3 deletions xenoblade_blender/import_root.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
from pathlib import Path


def get_database_path(version: str) -> str:
files = {"XC1": "xc1.bin", "XC2": "xc2.bin", "XC3": "xc3.bin"}
return os.path.join(os.path.dirname(__file__), files[version])
def get_database_path() -> str:
return os.path.join(os.path.dirname(__file__), "xc_combined.bin")


def get_image_folder(image_folder: str, filepath: str) -> str:
Expand Down
13 changes: 1 addition & 12 deletions xenoblade_blender/import_wimdo.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,6 @@ class ImportWimdo(bpy.types.Operator, ImportHelper):
type=bpy.types.OperatorFileListElement, options={"HIDDEN", "SKIP_SAVE"}
)

game_version: EnumProperty(
name="Game Version",
description="The game version for the shader database",
items=(
("XC1", "Xenoblade 1 DE", "Xenoblade Chronicles 1 Definitive Edition"),
("XC2", "Xenoblade 2", "Xenoblade Chronicles 2"),
("XC3", "Xenoblade 3", "Xenoblade Chronicles 3"),
),
default="XC3",
)

pack_images: BoolProperty(
name="Pack Images",
description="Pack all images into the Blender file. Increases memory usage and import times but makes the Blender file easier to share by not creating additional files",
Expand Down Expand Up @@ -79,7 +68,7 @@ def execute(self, context: bpy.types.Context):
log_fmt = "%(levelname)s %(name)s %(filename)s:%(lineno)d %(message)s"
logging.basicConfig(format=log_fmt, level=logging.INFO)

database_path = get_database_path(self.game_version)
database_path = get_database_path()
image_folder = get_image_folder(self.image_folder, self.filepath)

# TODO: merge armatures?
Expand Down
13 changes: 1 addition & 12 deletions xenoblade_blender/import_wismhd.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,6 @@ class ImportWismhd(bpy.types.Operator, ImportHelper):
maxlen=255,
)

game_version: EnumProperty(
name="Game Version",
description="The game version for the shader database",
items=(
("XC1", "Xenoblade 1 DE", "Xenoblade Chronicles 1 Definitive Edition"),
("XC2", "Xenoblade 2", "Xenoblade Chronicles 2"),
("XC3", "Xenoblade 3", "Xenoblade Chronicles 3"),
),
default="XC3",
)

pack_images: BoolProperty(
name="Pack Images",
description="Pack all images into the Blender file. Increases memory usage and import times but makes the Blender file easier to share by not creating additional files",
Expand All @@ -66,7 +55,7 @@ def execute(self, context: bpy.types.Context):
log_fmt = "%(levelname)s %(name)s %(filename)s:%(lineno)d %(message)s"
logging.basicConfig(format=log_fmt, level=logging.INFO)

database_path = get_database_path(self.game_version)
database_path = get_database_path()
image_folder = get_image_folder(self.image_folder, self.filepath)

self.import_wismhd(
Expand Down
Binary file removed xenoblade_blender/xc1.bin
Binary file not shown.
Binary file removed xenoblade_blender/xc2.bin
Binary file not shown.
Binary file removed xenoblade_blender/xc3.bin
Binary file not shown.
Binary file added xenoblade_blender/xc_combined.bin
Binary file not shown.
Binary file removed xenoblade_blender/xcx.bin
Binary file not shown.

0 comments on commit 469fd02

Please sign in to comment.