From caca840b8606bf7681591415911a73073dbd50f4 Mon Sep 17 00:00:00 2001 From: nahkd123 Date: Thu, 10 Oct 2024 22:24:48 +0700 Subject: [PATCH] Expose selections and playback to addons --- nahara-motion-ui/src/App.svelte | 84 +------- nahara-motion-ui/src/App.ts | 189 ++++++++++++++++++ nahara-motion-ui/src/appglobal.ts | 80 -------- nahara-motion-ui/src/ui/bar/MediaBar.svelte | 26 +-- nahara-motion-ui/src/ui/bar/TopBar.svelte | 2 +- .../src/ui/graph/AnimationGraphPane.svelte | 23 +-- .../src/ui/outliner/Outliner.svelte | 3 +- .../src/ui/outliner/OutlinerPane.svelte | 30 +-- .../src/ui/project/ProjectPane.svelte | 2 +- .../src/ui/project/SceneCreatePopup.svelte | 2 +- .../src/ui/properties/PropertiesPane.svelte | 23 +-- .../src/ui/render/RenderPane.svelte | 1 - .../src/ui/timeline/TimelinePane.svelte | 30 +-- .../src/ui/viewport/ViewportPane.svelte | 88 ++++---- .../src/ui/viewport/Welcome.svelte | 2 +- nahara-motion/src/addon/registries.ts | 5 +- nahara-motion/src/editor/command.ts | 63 ++++++ nahara-motion/src/editor/editor.ts | 4 + nahara-motion/src/editor/playback.ts | 37 ++++ nahara-motion/src/editor/selection.ts | 31 +++ nahara-motion/src/index.ts | 3 + nahara-motion/src/system/commands.ts | 13 ++ nahara-motion/src/system/nahara.ts | 5 + 23 files changed, 470 insertions(+), 276 deletions(-) create mode 100644 nahara-motion-ui/src/App.ts create mode 100644 nahara-motion/src/editor/command.ts create mode 100644 nahara-motion/src/editor/playback.ts create mode 100644 nahara-motion/src/editor/selection.ts create mode 100644 nahara-motion/src/system/commands.ts diff --git a/nahara-motion-ui/src/App.svelte b/nahara-motion-ui/src/App.svelte index 5f000d9..1f207d4 100644 --- a/nahara-motion-ui/src/App.svelte +++ b/nahara-motion-ui/src/App.svelte @@ -1,95 +1,17 @@ - - @@ -62,14 +64,14 @@ />
-
- +
diff --git a/nahara-motion-ui/src/ui/bar/TopBar.svelte b/nahara-motion-ui/src/ui/bar/TopBar.svelte index 2202fb6..97e367d 100644 --- a/nahara-motion-ui/src/ui/bar/TopBar.svelte +++ b/nahara-motion-ui/src/ui/bar/TopBar.svelte @@ -3,7 +3,7 @@ import { openMenuAt } from "../menu/MenuHost.svelte"; import { openPopupAt } from "../popup/PopupHost.svelte"; import RenderPane from "../render/RenderPane.svelte"; - import type { EditorImpl } from "../../App.svelte"; + import type { EditorImpl } from "../../App"; import type { DropdownEntry } from "../menu/FancyMenu"; export let editor: EditorImpl; diff --git a/nahara-motion-ui/src/ui/graph/AnimationGraphPane.svelte b/nahara-motion-ui/src/ui/graph/AnimationGraphPane.svelte index 43248d7..37c4087 100644 --- a/nahara-motion-ui/src/ui/graph/AnimationGraphPane.svelte +++ b/nahara-motion-ui/src/ui/graph/AnimationGraphPane.svelte @@ -1,13 +1,12 @@ @@ -56,10 +55,10 @@ {#if property instanceof motion.AnimatableObjectProperty} { cast(property).set($seekhead.position, e.detail); currentScene.update(a => a); }} + animating={!!property.animatable.getKeyframe($seekhead)} + on:update={e => { cast(property).set($seekhead, e.detail); currentScene.update(a => a); }} on:keyframebutton={() => handleKeyframeButton(property.animatable)} /> {:else if property instanceof motion.EnumObjectProperty} @@ -70,7 +69,7 @@ type: "simple", name: property.valueTranslator(v), click: () => { - property.set($seekhead.position, v); + property.set($seekhead, v); currentScene.update(a => a); } }))) @@ -79,8 +78,8 @@ {:else} { cast(property).set($seekhead.position, e.detail); currentScene.update(a => a); }} + value={property.get($seekhead)} + on:update={e => { cast(property).set($seekhead, e.detail); currentScene.update(a => a); }} /> {/if} {/each} diff --git a/nahara-motion-ui/src/ui/render/RenderPane.svelte b/nahara-motion-ui/src/ui/render/RenderPane.svelte index 65614c3..36197cb 100644 --- a/nahara-motion-ui/src/ui/render/RenderPane.svelte +++ b/nahara-motion-ui/src/ui/render/RenderPane.svelte @@ -1,6 +1,5 @@