diff --git a/src/PosePanel.tsx b/src/PosePanel.tsx index a994e2b..ea987bf 100644 --- a/src/PosePanel.tsx +++ b/src/PosePanel.tsx @@ -15,6 +15,7 @@ let tiles: Tile[] let selectedJoint: number | undefined = undefined export function posesBodyPanel(mesh: Mesh) { + mesh.initPoses() const panel: HTMLElement[] = [] tiles = new Array(poseTargets.length) for (let jointIdx = 1; jointIdx < poseTargets.length; ++jointIdx) { diff --git a/src/main.ts b/src/main.ts index e236711..f83d0ef 100644 --- a/src/main.ts +++ b/src/main.ts @@ -39,7 +39,7 @@ export function main() { mgr.calcWidgetTargets() // console.log("init poses") - mesh.initPoses() + // mesh.initPoses() // console.log(mesh) diff --git a/src/screen.tsx b/src/screen.tsx index 48efaa4..8a4ac51 100644 --- a/src/screen.tsx +++ b/src/screen.tsx @@ -24,7 +24,6 @@ interface ToolDef { desc: string img?: HTMLImageElement render?: (mesh: Mesh, mgr: SelectorListener) => Fragment - dom?: Fragment // FIXME: toad.jsx can not initialize the same JSX twice, hence we must cache } const toolbarDefinition: ToolDef[] = [ @@ -52,11 +51,8 @@ function setTab(mesh: Mesh, mgr: SelectorListener, tab: ToolDef) { } activeTab = tab activeTab.img!.src = `images/ui/toolbar_${activeTab.file}_over.png` - if (tab.dom === undefined && tab.render !== undefined) { - tab.dom = tab.render(mesh, mgr) - } - if (tab.dom !== undefined) { - refs.panel.replaceChildren(...tab.dom) + if (tab.render !== undefined) { + refs.panel.replaceChildren(...tab.render(mesh, mgr)) } else { refs.panel.replaceChildren() }