feat(web): armature bone parenting, pose evaluation and ABB IRB120 headed suite
- engine: PARBONE parenting, BKE_pose_where_is pose refresh, pose channel readback - viewport: three.js bone wireframes for the main-thread and offscreen paths - properties: draft numeric transform inputs (decimals survive typing), armature pose readback in degrees with step=any fields so validation cannot block Apply Pose - tests: headed armature/robot suite (9 cases), receipts bound to candidate hashes Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -26,6 +26,7 @@ import {
|
||||
} from "../vendor/three/three.module.js";
|
||||
import type { SceneSnapshotIR } from "../../../protocol/scene-ir";
|
||||
import {nodeDisplayMatrix as matrixFor} from '../three-adapter/node-display-matrix';
|
||||
import {createArmatureWireframes} from '../three-adapter/armature';
|
||||
import type { GPUTextureAsset } from "../../../protocol/render-assets";
|
||||
import type { MeshElementMode, MeshGeometryBuffer } from "../../../protocol/web-engine";
|
||||
import type { NonMeshGeometryChunk } from "../../../protocol/nonmesh-binary";
|
||||
@@ -875,8 +876,14 @@ function setSnapshot(snapshot: SceneSnapshotIR, buffers: MeshGeometryBuffer[], n
|
||||
greasePencilOnionStrokeCount += Number(object.userData.greasePencilOnionStrokeCount ?? 0);
|
||||
greasePencilCount++;
|
||||
}
|
||||
const armatureObjectMatrix = (objectId: string) => {
|
||||
const node = snapshot.nodes.find((candidate) => candidate.id === objectId);
|
||||
return node ? matrixFor(node, node.visible) : null;
|
||||
};
|
||||
const armatureWireframes = createArmatureWireframes(snapshot.armatures ?? [], armatureObjectMatrix);
|
||||
if (armatureWireframes.boneCount > 0) root.add(armatureWireframes.group);
|
||||
const lightingBudget = planPBRLightingBudget(snapshot, "THREE_WEBGL2");
|
||||
post({ type: "snapshotStatus", snapshotRevision: snapshot.revision, nonMeshCount, nonMeshBlockedCount, greasePencilCount, greasePencilBlockedCount, greasePencilOnionStrokeCount, renderBudget: lightingBudget });
|
||||
post({ type: "snapshotStatus", snapshotRevision: snapshot.revision, nonMeshCount, nonMeshBlockedCount, greasePencilCount, greasePencilBlockedCount, greasePencilOnionStrokeCount, armatureBoneCount: armatureWireframes.boneCount, renderBudget: lightingBudget });
|
||||
const world = snapshot.worlds.find((candidate) => candidate.id === snapshot.scenes[0]?.worldId) ?? snapshot.worlds[0];
|
||||
const sceneDefinition = snapshot.scenes.find((candidate) => candidate.id === snapshot.sceneId) ?? snapshot.scenes[0];
|
||||
if (!world?.environmentImageId) scene.background = world ? new Color().setRGB(...world.color) : new Color(0x25272b);
|
||||
|
||||
Reference in New Issue
Block a user