From 4b94d449adf88e8cc58514a8c936ea7c24a5e7d6 Mon Sep 17 00:00:00 2001 From: themancalledjakob Date: Sun, 14 May 2023 10:20:30 +0200 Subject: [PATCH] dispatch sequenceEvents --- .../BasicKeyframedTrack.tsx | 13 +++++++++++ theatre/studio/src/store/stateEditors.ts | 23 +++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/BasicKeyframedTrack.tsx b/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/BasicKeyframedTrack.tsx index 1254844..aa9be4d 100644 --- a/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/BasicKeyframedTrack.tsx +++ b/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/BasicKeyframedTrack.tsx @@ -62,6 +62,19 @@ const BasicKeyframedTrack: React.VFC = React.memo( props, ) + const toVT = { + sequenced: true, + panelID: leaf.sheetObject.address.objectKey, + prop: leaf.pathToProp, + origin: 'BasicKeyframedTrack.tsx', + } + const event = new CustomEvent('sequenceEvent', { + bubbles: false, + detail: toVT, + }) + window.dispatchEvent(event) + //console.log('sequence this', {toVT}); + const snapPositionsState = useVal(snapPositionsStateD) const snapPositions = diff --git a/theatre/studio/src/store/stateEditors.ts b/theatre/studio/src/store/stateEditors.ts index 528cf66..6489d3b 100644 --- a/theatre/studio/src/store/stateEditors.ts +++ b/theatre/studio/src/store/stateEditors.ts @@ -702,6 +702,17 @@ namespace stateEditors { tracks.trackData[trackId] = track tracks.trackIdByPropPath[pathEncoded] = trackId + const toVT = { + sequenced: true, + panelID: p.objectKey, + prop: p.pathToProp, + origin: 'stateEditors.ts', + } + const event = new CustomEvent('sequenceEvent', { + bubbles: false, + detail: toVT, + }) + window.dispatchEvent(event) } export function setPrimitivePropAsStatic( @@ -721,6 +732,18 @@ namespace stateEditors { stateEditors.coreByProject.historic.sheetsById.staticOverrides.byObject.setValueOfPrimitiveProp( p, ) + const toVT = { + sequenced: false, + panelID: p.objectKey, + prop: p.pathToProp, + origin: 'stateEditors.ts', + } + const event = new CustomEvent('sequenceEvent', { + bubbles: false, + detail: toVT, + }) + window.dispatchEvent(event) + //console.log('make this static', {toVT}); } export function setCompoundPropAsStatic(