From 90abb5e7eb4f6419519353584df090753136854a Mon Sep 17 00:00:00 2001 From: David Gordon <94419856+dinomut1@users.noreply.github.com> Date: Sun, 4 Aug 2024 12:51:10 -0700 Subject: [PATCH] point click placement feature flag, prefab creation fixes (#10852) * 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 <142644522+JT00y@users.noreply.github.com> Co-authored-by: Rahul Ghosh * add feature flag for point and click (#10850) * force deselect entity on prefab creation --------- Co-authored-by: Jiatong Yao <142644522+JT00y@users.noreply.github.com> Co-authored-by: Rahul Ghosh Co-authored-by: AidanCaruso --- packages/common/src/constants/FeatureFlags.ts | 3 ++ .../dialogs/CreatePrefabPanelDialog.tsx | 2 +- .../editor/src/systems/EditorControlSystem.ts | 1 + .../Viewport/tools/SceneHelpersTool.tsx | 39 +++++++++++-------- 4 files changed, 28 insertions(+), 17 deletions(-) diff --git a/packages/common/src/constants/FeatureFlags.ts b/packages/common/src/constants/FeatureFlags.ts index 1236c42ef3..d73c341c46 100644 --- a/packages/common/src/constants/FeatureFlags.ts +++ b/packages/common/src/constants/FeatureFlags.ts @@ -42,6 +42,9 @@ export const FeatureFlags = { UI: { Hierarchy: { ShowModelChildren: 'ir.editor.ui.hierarchy.showModelChildren' + }, + TopBar: { + PointClickPlacement: 'ir.editor.ui.topBar.pointClickPlacement' } } } diff --git a/packages/editor/src/components/dialogs/CreatePrefabPanelDialog.tsx b/packages/editor/src/components/dialogs/CreatePrefabPanelDialog.tsx index 3c0917cd70..d327dff459 100644 --- a/packages/editor/src/components/dialogs/CreatePrefabPanelDialog.tsx +++ b/packages/editor/src/components/dialogs/CreatePrefabPanelDialog.tsx @@ -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 diff --git a/packages/editor/src/systems/EditorControlSystem.ts b/packages/editor/src/systems/EditorControlSystem.ts index e5a0967a50..c16f112c0e 100644 --- a/packages/editor/src/systems/EditorControlSystem.ts +++ b/packages/editor/src/systems/EditorControlSystem.ts @@ -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) diff --git a/packages/ui/src/components/editor/panels/Viewport/tools/SceneHelpersTool.tsx b/packages/ui/src/components/editor/panels/Viewport/tools/SceneHelpersTool.tsx index fe166e51c3..33db7c281f 100644 --- a/packages/ui/src/components/editor/panels/Viewport/tools/SceneHelpersTool.tsx +++ b/packages/ui/src/components/editor/panels/Viewport/tools/SceneHelpersTool.tsx @@ -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' @@ -45,22 +47,27 @@ export default function SceneHelpersTool() { return (
- -