Files
workinf_Blender_Wasm/docs/status/W-076.md
2026-08-12 04:47:48 -04:00

2.6 KiB

W-076 Status

status: in_progress
task: 属性、UV 和蒙皮安全简化

SimplifyProfile now requires an explicit attribute policy after parsing and defines SkinSimplifyPolicy limits for influences, weights, position error and shape keys. The native command currently implements this partial protection matrix:

  • normals are recomputed from the evaluated triangle topology;
  • BMFace material indices and material slot IDs are retained;
  • existing UV and float-color corner values are transferred to output corners using a deterministic closest-source-triangle barycentric projection;
  • DROP is the only policy that removes these arrays intentionally;
  • Collapse validates and accepts open/non-manifold Mesh-to-BMesh topology;
  • the native reader exports Mesh MDeformVert CustomData as fixed four-slot SkinWeightsIR arrays, carries Mesh vertex-group names, and exports non-Basis KeyBlock positions as ShapeKeyIR; the local rigged_shape_scene.blend fixture validates both on a real .blend file;
  • a skinned or shape-key mesh requires explicit skinPolicy; omitting it is a structured NOT_IMPLEMENTED failure rather than silent attribute loss.

Native smoke and browser Worker E2E verify normal, UV, corner and material buffer sizes on the closed cube fixture. The WebEngine protocol validates SkinWeightsIR and ShapeKeyIR. After BMesh produces the authoritative topology, native code projects each output vertex onto the closest source triangle, merges and normalizes its joint influences, and reconstructs every shape-key position with the same barycentric weights. maxInfluences, minWeight and maxPositionError are enforced before committing the new SceneIR. Native smoke and Worker E2E verify output vertex counts, normalized weights, stable joint IDs, bind matrices and shape-key array lengths. shapeKeys: REJECT still returns SHAPE_KEYS_REJECTED before native work.

The reader now exports ArmatureIR bones with parent IDs, Blender Bone.arm_mat rest matrices and matching PoseChannel.pose_mat matrices. A mesh Armature modifier resolves its armature object, remaps vertex-group bone names to stable joint IDs, and records the mesh object TRS as its non-identity bind matrix. The generated rig fixture verifies all fields against local Blender data. This is sufficient for GLB inverse-bind generation and the current triangle-bridge remapping path.

UV seam and sharp-edge error metrics, tangent regeneration, native vertex-group name selection in profiles, Armature deformation comparison, seam/sharp constraints and Blender-evaluated shape-key error comparison remain required before this task can be marked done.