From 1b41f1afca84dc9b4c0ee41033725d99967aea9b Mon Sep 17 00:00:00 2001 From: Cole Lawrence Date: Tue, 7 Jun 2022 15:49:52 -0400 Subject: [PATCH] feature: Add selecting a sheet object row via sequence editor --- .../DopeSheet/Left/SheetObjectRow.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Left/SheetObjectRow.tsx b/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Left/SheetObjectRow.tsx index d9f3c2f..bfb755c 100644 --- a/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Left/SheetObjectRow.tsx +++ b/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Left/SheetObjectRow.tsx @@ -4,6 +4,7 @@ import React from 'react' import AnyCompositeRow from './AnyCompositeRow' import {decideRowByPropType} from './PropWithChildrenRow' import {setCollapsedSheetObjectOrCompoundProp} from '@theatre/studio/panels/SequenceEditorPanel/DopeSheet/setCollapsedSheetObjectOrCompoundProp' +import getStudio from '@theatre/studio/getStudio' const LeftSheetObjectRow: React.VFC<{ leaf: SequenceEditorTree_SheetObject @@ -14,6 +15,14 @@ const LeftSheetObjectRow: React.VFC<{ leaf={leaf} label={leaf.sheetObject.address.objectKey} isCollapsed={leaf.isCollapsed} + toggleSelect={() => { + // set selection to this sheet object on click + getStudio().transaction(({stateEditors}) => { + stateEditors.studio.historic.panels.outline.selection.set([ + leaf.sheetObject, + ]) + }) + }} toggleCollapsed={() => setCollapsedSheetObjectOrCompoundProp(!leaf.isCollapsed, leaf) }