2 Commits
Author SHA1 Message Date
PozzettiAndrea e463099eec serialization.py: tighten Trimesh serializer, same behavior
Collapse the repeated best-effort try/except into _opt/_put helpers, flatten
the visual/metadata handling, and compress the docstring. 117 -> 86 lines
(85 -> 57 code lines). Verified behaviorally identical to the prior version
by round-tripping real trimesh meshes (plain / textured uv+material+metadata /
no-faces) through both old and new serialize+deserialize with identity recurse.

The load-bearing comments are kept verbatim in intent: the id()-reuse GC
hazard (pass mesh arrays directly, never np.asarray) and the decompose-visuals-
by-kind rationale (avoid PIL + the mesh back-reference re-serializing geometry).
Material without uv is now nested under uv -- deserialize ignores it anyway, so
the round-trip is unchanged and the wire gets slightly smaller.
2026-08-13 16:05:05 +02:00
PozzettiAndrea 1716b3ec56 Declare wire types in comfy-env-root.toml [types]; serialization.py (ADR-0015)
- comfy-env-root.toml [types]: TRIMESH custom; SKELETON/INTRINSICS/
  EXTRINSICS/VOXELGRID builtin (explicit inventory, validated by
  comfy-env at register_nodes).
- geometrypack_wire_types.py -> serialization.py, loaded by file path
  on both sides (comfy-env 0.4.16). The manual OpaquePayload
  ImportError branch is gone: deserialize registers only where trimesh
  imports; a trimesh-less host holds materialized receipts owned by
  comfy-env (safe across worker restarts -- the WinError 2 fix).
- Tag flips geompack.Trimesh -> trimesh.Trimesh (type-identity
  convention): packs that also declare trimesh.Trimesh interop without
  sharing code.
- [serializers] removed from nodes/comfy-env.toml (superseded, no
  backcompat); requirements pin comfy-env==0.4.16.

Verified end-to-end: textured 5k-vert mesh, bare-host parent (trimesh
blocked), producer worker killed, receipt forwarded to a fresh worker,
mesh rebuilt with uv + metadata intact.
2026-08-13 10:58:30 +02:00