mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-04 01:18:34 +00:00
Removed buttons that were no longer needed
moved functionality to generate movie cross checking if there are odd keyframing issues.
This commit is contained in:
1 parent
9009724511
commit
f956e65bc6
4 files changed
+20
-124
No files matched your search
@@ -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 (
|
||||
<div>
|
||||
<TopBarHelmet>
|
||||
<Button icon={faSparkles}>Generate Movie</Button>
|
||||
<Button icon={faSparkles} onClick={handleGenerateMovieClick}>Generate Movie</Button>
|
||||
</TopBarHelmet>
|
||||
|
||||
<div style={{ height: "calc(100vh - 68px)" }}>
|
||||
{/* Engine section/side panel */}
|
||||
<div
|
||||
|
||||
@@ -24,68 +24,10 @@ export const ControlsTopButtons = () => {
|
||||
|
||||
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
|
||||
</Button>
|
||||
<Button
|
||||
onClick={handleObjectPanelTest}
|
||||
onClick={handleTestButton2}
|
||||
className="bg-brand-tertiary hover:bg-brand-teriary-400 focus-visible:outline-brand-tertiary"
|
||||
>
|
||||
Show Object Panel
|
||||
Test Button 2
|
||||
</Button>
|
||||
</div>
|
||||
<div className="flex gap-2">
|
||||
<Button onClick={handleButtonSingleFrame}>Render Single Frame</Button>
|
||||
<Button onClick={handleButtonTakeFrame}>Take Frame</Button>
|
||||
<Button onClick={handleButtonRender}>Render</Button>
|
||||
{/* <Button onClick={handleButtonLoad}>Load</Button>
|
||||
<Button onClick={handleButtonRender}>Render</Button> */}
|
||||
<Button
|
||||
onClick={handleButtonTest}
|
||||
className="bg-brand-tertiary hover:bg-brand-teriary-400 focus-visible:outline-brand-tertiary"
|
||||
|
||||
@@ -79,29 +79,7 @@ export const TrackProvider = ({ children }: Props) => {
|
||||
}, [length, scale]);
|
||||
|
||||
useEffect(() => {
|
||||
setAnimationClips([
|
||||
{
|
||||
version: 1,
|
||||
media_id: "m_5q9s6esz8ymjqz0bheh8nf4crtj2kx",
|
||||
type: ClipType.ANIMATION,
|
||||
length: 25,
|
||||
name: "Sit",
|
||||
},
|
||||
{
|
||||
version: 1,
|
||||
media_id: uuid.v4(),
|
||||
type: ClipType.ANIMATION,
|
||||
length: 25,
|
||||
name: "Idle",
|
||||
},
|
||||
{
|
||||
version: 1,
|
||||
media_id: uuid.v4(),
|
||||
type: ClipType.ANIMATION,
|
||||
length: 25,
|
||||
name: "Stand",
|
||||
},
|
||||
{
|
||||
setAnimationClips([{
|
||||
version: 1,
|
||||
media_id: "m_w5t517krrf63f3tj2288vsffmj87zw",
|
||||
type: ClipType.ANIMATION,
|
||||
@@ -110,34 +88,13 @@ export const TrackProvider = ({ children }: Props) => {
|
||||
},
|
||||
]);
|
||||
setAudioClips([
|
||||
{
|
||||
version: 1,
|
||||
media_id: uuid.v4(),
|
||||
type: ClipType.ANIMATION,
|
||||
length: 25,
|
||||
name: "Sing",
|
||||
},
|
||||
{
|
||||
version: 1,
|
||||
media_id: uuid.v4(),
|
||||
type: ClipType.AUDIO,
|
||||
length: 25,
|
||||
name: "Chatter",
|
||||
},
|
||||
{
|
||||
version: 1,
|
||||
media_id: "m_403phjvjkbbaxxbz8y7r6qjay07mfd",
|
||||
type: ClipType.AUDIO,
|
||||
length: 25,
|
||||
name: "Talk",
|
||||
},
|
||||
{
|
||||
version: 1,
|
||||
media_id: uuid.v4(),
|
||||
type: ClipType.AUDIO,
|
||||
length: 25,
|
||||
name: "Yell",
|
||||
},
|
||||
}
|
||||
]);
|
||||
setScale(1);
|
||||
setLength(12);
|
||||
|
||||
@@ -366,7 +366,7 @@ export class TimeLine {
|
||||
// element.play()
|
||||
// remove the element from the list
|
||||
const object = this.scene.get_object_by_uuid(element.object_uuid);
|
||||
if (element.type == "transform") {
|
||||
if (element.type === ClipType.TRANSFORM) {
|
||||
if (object && this.transform_engine.clips[element.object_uuid]) {
|
||||
this.transform_engine.clips[element.object_uuid].step(
|
||||
object,
|
||||
@@ -388,7 +388,7 @@ export class TimeLine {
|
||||
await this.lipSync_engine.clips[element.object_uuid].play(object);
|
||||
this.lipSync_engine.clips[element.object_uuid].step();
|
||||
}
|
||||
} else if (element.type == "animation") {
|
||||
} else if (element.type === ClipType.ANIMATION) {
|
||||
if (object) {
|
||||
await this.animation_engine.clips[object.uuid].play(object);
|
||||
this.animation_engine.clips[object.uuid].step(
|
||||
|
||||
Reference in new issue
Block a user