basic advanced example

This commit is contained in:
Vysyr committed 2026-10-31 23:11:57 +01:00
1 parent 6fe57915e8
commit bd8edf5afb
29 files changed
+1501 -38

No files matched your search

+5 -1
View File
@@ -6,6 +6,7 @@ import unreal
from .paths import GENERATED, PROJECT, slug
from .characters import _clips
from .animation_catalog import update_catalog
@dataclass
@@ -111,7 +112,8 @@ def import_model(filename, name="Character", animations=None, collection="Charac
"""
source = Path(filename).expanduser()
source = (source if source.is_absolute() else PROJECT / source).resolve()
if animations is None:
discover_all = animations is None
if discover_all:
animations = _clips(source)
name = slug(name)
destination = f"{GENERATED}/Skeletal/{name}"
@@ -131,4 +133,6 @@ def import_model(filename, name="Character", animations=None, collection="Charac
for alias, filename in (animations or {}).items():
clips[alias] = import_animation(filename, skeleton, name=slug(alias),
destination=destination + "/Animations", reimport=reimport)
update_catalog(name, {key: clip.get_play_length() for key, clip in clips.items()},
replace=discover_all)
return SkeletalImport(meshes[0], clips)