The VS Code of video editing, built for agents.
TypeScript
Enhance export functionality and improve project configuration
konstantin-paulus52457f1ed7a4
diff --git a/apps/web/src/components/sidebar-right/inspector/export.tsx b/apps/web/src/components/sidebar-right/inspector/export.tsxindex e7ca730e..bd3d46ed 100644--- a/apps/web/src/components/sidebar-right/inspector/export.tsx+++ b/apps/web/src/components/sidebar-right/inspector/export.tsx@@ -28,7 +28,7 @@ import { Separator } from "@/components/ui/separator";import { SliderInput } from "@/components/ui/slider-input";import { formatBytes, formatDuration } from "@/utils/formatters";import { useTrait, useWorld } from "@diffusionstudio/koota-solid";-import { Computed, FrameRate } from "@diffusionstudio/runtime";+import { Computed, FrameRate, Source } from "@diffusionstudio/runtime";import { useDerived } from "@/engine/hooks";import { useProjectConfig } from "@/engine/project-config";import { useExport } from "@/context/export";@@ -79,7 +79,11 @@ export function ExportPanel(props: ExportPanelProps) {const [isInspectorOpen, setIsInspectorOpen] = createSignal(false);- const settings = () => config()?.exportOf(entity()) ?? undefined;+ const source = useTrait(() => entity(), Source);+ const settings = createMemo(() => {+ source();+ return config()?.exportOf(entity()) ?? undefined;+ });const frameRate = useTrait(world, FrameRate);const duration = useDerived(() => entity().get(Computed)?.duration ?? 0);const durationInSeconds = createMemo(() => duration() / (frameRate()?.value ?? 30));diff --git a/apps/web/src/context/render.ts b/apps/web/src/context/render.tsindex 9def1a69..17d2c94c 100644--- a/apps/web/src/context/render.ts+++ b/apps/web/src/context/render.ts@@ -79,7 +79,7 @@ export async function renderScene(const encoder = await createEncoder(capture.world, {...config,target,- comment: `Made with Diffusion v${version}`,+ comment: `Made with Diffusion Studio v${version}`,onProgress(p) {const percent = Math.round((p.progress / p.total) * 100);setOverlay((prev) =>diff --git a/apps/web/src/engine/project-config.ts b/apps/web/src/engine/project-config.tsindex c6eec410..d6128172 100644--- a/apps/web/src/engine/project-config.ts+++ b/apps/web/src/engine/project-config.ts@@ -168,10 +168,15 @@ export class ProjectConfig {this.exports[1](parseExports(this.raw.export));}- /** How `scene` is exported, or null until it is set up. Reactive. */+ /**+ * How `scene` is exported, or null until it is set up. Reactive: the+ * signal is read before the key, so a caller reading this for a scene the+ * mount has yet to stamp still hears about the settings when they land.+ */public exportOf(scene: Entity): ExportConfig | null {+ const exports = this.exports[0]();const key = sceneConfigKey(scene);- return (key && this.exports[0]()[key]) || null;+ return (key && exports[key]) || null;}/**