diff options
| author | Danilo M. <danix@danix.xyz> | 2026-10-28 12:25:51 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-10-28 12:25:51 +0100 |
| commit | 89b1fb6f88ef2ea60f28623e04d46072ef15ba21 (patch) | |
| tree | 25c542717a4bf7e6208411c9a6bc0731ae37841d /generat3d | |
| parent | d658a24d2da58064c0dceaa8688246625ff9ef75 (diff) | |
| download | generat3D-89b1fb6f88ef2ea60f28623e04d46072ef15ba21.tar.gz generat3D-89b1fb6f88ef2ea60f28623e04d46072ef15ba21.zip | |
Skip non-numeric morph channels, summarize other-geometry morphs
Genesis 9 Starter Essentials ships file-launcher channels (type "file") in its Morphs folder and morphs whose vertex count belongs to other geometry. The first made loading fatal, the second printed one warning per morph.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'generat3d')
| -rw-r--r-- | generat3d/scene.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/generat3d/scene.py b/generat3d/scene.py index 722057f..5c35022 100644 --- a/generat3d/scene.py +++ b/generat3d/scene.py @@ -102,6 +102,7 @@ class _Loader: self.graph = Graph() self.loaded = set() self.hd = 0 + self.other_geometry = 0 def run(self): nodes = self.doc.get("scene", {}).get("nodes", []) @@ -138,6 +139,8 @@ class _Loader: warn("pose in scene ignored: the .dbz holds rest data") if self.hd: warn(f"{self.hd} HD morphs: detail ignored (v1)") + if self.other_geometry: + warn(f"{self.other_geometry} morphs for other geometry skipped") return Scene(self.path, self.figure, self.graph) def _figure(self, inst, fpath, asset): @@ -195,6 +198,8 @@ class _Loader: if parent and parent != self.figure.id: continue ch = mod.get("channel", {}) + if ch.get("type", "float") not in ("float", "int"): + continue # file launchers, aliases on bones: not dials for name in ("value", "min", "max"): if name in ch and not _finite(ch[name]): raise Error(f"{path}#{mod['id']}: {name} is not a finite number") @@ -207,7 +212,7 @@ class _Loader: self.hd += 1 d = morph.get("deltas", {}).get("values", []) if morph.get("vertex_count", nverts) != nverts: - warn(f"{path}#{mod['id']}: vertex count mismatch, morph skipped") + self.other_geometry += 1 elif d: arr = np.array(d, dtype=float) if (arr.ndim != 2 or arr.shape[1] != 4 |
