Refactor new editor scene viewport tools

This commit is contained in:
2026-04-18 18:55:19 +08:00
parent b8e84001fa
commit f544b2792b
17 changed files with 3414 additions and 14 deletions

View File

@@ -123,7 +123,16 @@ void EditorShellRuntime::Update(
m_shellFrame.workspaceInteractionFrame.dockHostFrame.layout;
m_hierarchyPanel.SetSceneRuntime(&context.GetSceneRuntime());
context.BindEditCommandRoutes(&m_hierarchyPanel, &m_projectPanel);
m_sceneEditCommandRoute.BindSceneRuntime(&context.GetSceneRuntime());
// Keep the previous render request available for readback-based picking during
// this update, then refresh it again after camera/navigation state changes.
m_viewportHostService.SetSceneViewportRenderRequest(
context.GetSceneRuntime().BuildSceneViewportRenderRequest());
context.BindEditCommandRoutes(
&m_hierarchyPanel,
&m_projectPanel,
&m_sceneEditCommandRoute,
&m_inspectorPanel);
context.SyncSessionFromWorkspace(workspaceController);
UIEditorShellInteractionDefinition definition =
context.BuildShellDefinition(workspaceController, captureText, shellVariant);
@@ -168,11 +177,19 @@ void EditorShellRuntime::Update(
FilterHostedContentInputEventsForShellOwnership(
inputEvents,
shellOwnsHostedContentPointerStream);
m_sceneViewportController.Update(
context.GetSceneRuntime(),
m_viewportHostService,
m_shellInteractionState.workspaceInteractionState.composeState,
m_shellFrame.workspaceInteractionFrame.composeFrame);
m_viewportHostService.SetSceneViewportRenderRequest(
context.GetSceneRuntime().BuildSceneViewportRenderRequest());
ApplyViewportFramesToShellFrame(m_shellFrame, m_viewportHostService);
context.SyncSessionFromWorkspace(workspaceController);
context.UpdateStatusFromShellResult(workspaceController, m_shellFrame.result);
const std::string& activePanelId = workspaceController.GetWorkspace().activePanelId;
m_projectPanel.SetProjectRuntime(&context.GetProjectRuntime());
m_hierarchyPanel.Update(
m_shellFrame.workspaceInteractionFrame.composeFrame.contentHostFrame,
hostedContentEvents,
@@ -187,7 +204,10 @@ void EditorShellRuntime::Update(
m_inspectorPanel.Update(
context.GetSession(),
context.GetSceneRuntime(),
m_shellFrame.workspaceInteractionFrame.composeFrame.contentHostFrame);
m_shellFrame.workspaceInteractionFrame.composeFrame.contentHostFrame,
hostedContentEvents,
!m_shellFrame.result.workspaceInputSuppressed,
activePanelId == kInspectorPanelId);
m_consolePanel.Update(
context.GetSession(),
m_shellFrame.workspaceInteractionFrame.composeFrame.contentHostFrame);