From f956e65bc62e668d3a0aae5f707dbbfcc6c2e6c0 Mon Sep 17 00:00:00 2001 From: Michael Chung <6252325+ArEnSc@users.noreply.github.com> Date: Thu, 4 Apr 2024 17:12:54 -0400 Subject: [PATCH] Removed buttons that were no longer needed moved functionality to generate movie cross checking if there are odd keyframing issues. --- app/pages/PageEnigma/PageEnigmaComponent.tsx | 15 +++- .../ControlsTopButtons/ControlsTopButtons.tsx | 78 +------------------ .../contexts/TrackContext/TrackProvider.tsx | 47 +---------- app/pages/PageEnigma/js/timeline.ts | 4 +- 4 files changed, 20 insertions(+), 124 deletions(-) diff --git a/app/pages/PageEnigma/PageEnigmaComponent.tsx b/app/pages/PageEnigma/PageEnigmaComponent.tsx index b8416749c1..160c9ca07e 100644 --- a/app/pages/PageEnigma/PageEnigmaComponent.tsx +++ b/app/pages/PageEnigma/PageEnigmaComponent.tsx @@ -1,5 +1,4 @@ import { useContext } from "react"; - import { faSparkles } from "@fortawesome/pro-solid-svg-icons"; import { Button, LoadingBar, LoadingDots } from "~/components"; @@ -19,9 +18,12 @@ import { APPUI_VIEW_MODES } from "./reducers"; import { timelineHeight } from "~/pages/PageEnigma/store"; import { useSignals } from "@preact/signals-react/runtime"; import { AppUiContext } from "~/pages/PageEnigma/contexts/AppUiContext"; +import { EngineContext } from "./contexts/EngineContext"; export const PageEnigmaComponent = () => { useSignals(); + + const editorEngine = useContext(EngineContext); const [appUiState] = useContext(AppUiContext); //To prevent the click event from propagating to the canvas: TODO: HANDLE THIS BETTER? @@ -29,13 +31,20 @@ export const PageEnigmaComponent = () => { event.stopPropagation(); }; + const handleGenerateMovieClick=()=> { + if ( editorEngine != null) { + editorEngine?.generateVideo() + } else { + console.log("Tried to generate movie but editor was null") + } + }; + const lowerHeight = timelineHeight.value; return (
- + -
{/* Engine section/side panel */}
{ const handleButtonTest = () => { editorEngine?.testStylizeRequest(); - - // if(appUiState?.showEditorLoadingBar.isShowing){ - //TO GO TO A HUNDRED AND DISAPPER - // dispatchAppUiState({ - // type: APPUI_ACTION_TYPES.UPDATE_EDITOR_LOADINGBAR, - // payload:{ - // showEditorLoadingBar: { - // progress: 100, - // } - // } - // }); - // setTimeout(() => { - // dispatchAppUiState({ - // type: APPUI_ACTION_TYPES.HIDE_EDITOR_LOADINGBAR, - // }); - // }, 1000); - //END :TO GO TO A HUNDRED AND DISAPPER - - //EAMPLE OF CHANING LOADING MESSAGE - // dispatchAppUiState({ - // type: APPUI_ACTION_TYPES.UPDATE_EDITOR_LOADINGBAR, - // payload:{ - // showEditorLoadingBar: { - // message: "new message", - // } - // } - // }); - // }else{ - // dispatchAppUiState({ - // type: APPUI_ACTION_TYPES.SHOW_EDITOR_LOADINGBAR, - // payload:{ - // showEditorLoadingBar: { - // message: 'display of LoadingBar triggered by Test Button', - // progress: 10, - // } - // } - - // }); - //} }; - const handleObjectPanelTest = () => { - if (appUiState?.controlPanel.isShowing) { - dispatchAppUiState({ - type: APPUI_ACTION_TYPES.HIDE_CONTROLPANELS_SCENEOBJECT, - }); - } else { - dispatchAppUiState({ - type: APPUI_ACTION_TYPES.SHOW_CONTROLPANELS_SCENEOBJECT, - payload: { - group: ClipGroup.OBJECT, - object_name: "TEST BUTTON", - object_uuid: "", - version: "1", - objectVectors: { - position: { x: 1, y: 2, z: 3 }, - rotation: { x: 4, y: 5, z: 6 }, - scale: { x: 7, y: 8, z: 9 }, - }, - }, - }); - } + const handleTestButton2 = () => { + console.log("Test Button 2") }; const handleButtonCameraView = () => { @@ -94,18 +36,9 @@ export const ControlsTopButtons = () => { const handleButtonPlayBack = () => { editorEngine?.startPlayback(); }; - const handleButtonRender = () => { - editorEngine?.generateVideo(); - }; - const handleButtonTakeFrame = () => { editorEngine?.take_timeline_cam_clip(); }; - - const handleButtonLoad = () => { - console.log("LOADING"); - }; - const handleButtonSingleFrame = () => { editorEngine?.generateFrame(); }; @@ -172,18 +105,15 @@ export const ControlsTopButtons = () => { Toggle Camera View
- - {/* - */}