Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
rename hierarchy node using hotkey
Browse files Browse the repository at this point in the history
  • Loading branch information
aditya-mitra committed Aug 14, 2024
1 parent bce156b commit 5e0df31
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,14 @@ function HierarchyPanelContents(props: { sceneURL: string; rootEntity: Entity; i
}
})

useHotkeys(`${cmdOrCtrlString}+r`, (e) => {
e.preventDefault()
const selectedEntities = SelectionState.getSelectedEntities()
for (const entity of selectedEntities) {
onRenameNode(entity)
}
})

const MemoTreeNode = useCallback(
(props: HierarchyTreeNodeProps) => (
<HierarchyTreeNode
Expand Down Expand Up @@ -574,6 +582,7 @@ function HierarchyPanelContents(props: { sceneURL: string; rootEntity: Entity; i
variant="transparent"
className="text-left text-xs"
onClick={() => onRenameNode(contextSelectedItem!)}
endIcon={cmdOrCtrlString + ' + r'}
>
{t('editor:hierarchy.lbl-rename')}
</Button>
Expand Down

0 comments on commit 5e0df31

Please sign in to comment.