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

Commit

Permalink
point click placement feature flag, prefab creation fixes (#10852)
Browse files Browse the repository at this point in the history
* update assets panel categories (#10843)

* fix scene reloading on save (#10844)

* create prefab remove original entity fix (#10781) (#10846)

* create prefab remove original entity fix

* clean up

* add reactor to create object

* clean up

* remove extra removeObject function

* replace react gltfdoucument to node

---------

Co-authored-by: Jiatong Yao <[email protected]>
Co-authored-by: Rahul Ghosh <[email protected]>

* add feature flag for point and click (#10850)

* force deselect entity on prefab creation

---------

Co-authored-by: Jiatong Yao <[email protected]>
Co-authored-by: Rahul Ghosh <[email protected]>
Co-authored-by: AidanCaruso <[email protected]>
  • Loading branch information
4 people authored Aug 4, 2024
1 parent 31baba6 commit 90abb5e
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 17 deletions.
3 changes: 3 additions & 0 deletions packages/common/src/constants/FeatureFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ export const FeatureFlags = {
UI: {
Hierarchy: {
ShowModelChildren: 'ir.editor.ui.hierarchy.showModelChildren'
},
TopBar: {
PointClickPlacement: 'ir.editor.ui.topBar.pointClickPlacement'
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export default function CreatePrefabPanel({ entity }: { entity: Entity }) {
scale: new Vector3(1, 1, 1)
})
setComponent(entity, EntityTreeComponent, { parentEntity: prefabEntity })

getMutableState(SelectionState).selectedEntities.set([])
await exportRelativeGLTF(prefabEntity, srcProject, fileName)
//await exportRelativeGLTF(entity, srcProject, fileName)
//pass tags to static resource
Expand Down
1 change: 1 addition & 0 deletions packages/editor/src/systems/EditorControlSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ const onKeyW = () => {
}

const onKeyP = () => {
if (!FeatureFlagsState.enabled(FeatureFlags.Studio.UI.TopBar.PointClickPlacement)) return
const editorHelperState = getMutableState(EditorHelperState)
if (editorHelperState.placementMode.value === PlacementMode.CLICK) {
editorHelperState.placementMode.set(PlacementMode.DRAG)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ All portions of the code written by the Ethereal Engine team are Copyright © 20
Ethereal Engine. All Rights Reserved.
*/

import { FeatureFlags } from '@etherealengine/common/src/constants/FeatureFlags'
import { downloadScreenshot } from '@etherealengine/editor/src/functions/takeScreenshot'
import { EditorHelperState, PlacementMode } from '@etherealengine/editor/src/services/EditorHelperState'
import { FeatureFlagsState } from '@etherealengine/engine'
import { useMutableState } from '@etherealengine/hyperflux'
import { RendererState } from '@etherealengine/spatial/src/renderer/RendererState'
import React from 'react'
Expand All @@ -45,22 +47,27 @@ export default function SceneHelpersTool() {

return (
<div className="flex items-center gap-1">
<Tooltip title={t('editor:toolbar.placement.click')}>
<Button
startIcon={<LuMousePointerClick />}
onClick={() => editorHelperState.placementMode.set(PlacementMode.CLICK)}
variant={editorHelperState.placementMode.value === PlacementMode.CLICK ? 'outline' : 'transparent'}
className="px-0"
/>
</Tooltip>
<Tooltip title={t('editor:toolbar.placement.drag')}>
<Button
startIcon={<LuMove3D />}
onClick={() => editorHelperState.placementMode.set(PlacementMode.DRAG)}
variant={editorHelperState.placementMode.value === PlacementMode.DRAG ? 'outline' : 'transparent'}
className="px-0"
/>
</Tooltip>
{FeatureFlagsState.enabled(FeatureFlags.Studio.UI.TopBar.PointClickPlacement) && (
<>
<Tooltip title={t('editor:toolbar.placement.click')}>
<Button
startIcon={<LuMousePointerClick />}
onClick={() => editorHelperState.placementMode.set(PlacementMode.CLICK)}
variant={editorHelperState.placementMode.value === PlacementMode.CLICK ? 'outline' : 'transparent'}
className="px-0"
/>
</Tooltip>
<Tooltip title={t('editor:toolbar.placement.drag')}>
<Button
startIcon={<LuMove3D />}
onClick={() => editorHelperState.placementMode.set(PlacementMode.DRAG)}
variant={editorHelperState.placementMode.value === PlacementMode.DRAG ? 'outline' : 'transparent'}
className="px-0"
/>
</Tooltip>
</>
)}

<InfoTooltip
title={t('editor:toolbar.helpersToggle.lbl-helpers')}
info={t('editor:toolbar.helpersToggle.info-helpers')}
Expand Down

0 comments on commit 90abb5e

Please sign in to comment.