diff --git a/package.json b/package.json index f1f35a2..41cc20b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "animatr", "private": true, - "version": "0.9.0", + "version": "0.9.1", "type": "module", "scripts": { "dev": "vite", diff --git a/src/components/ActionEditor.vue b/src/components/ActionEditor.vue index 4542115..fdf9107 100644 --- a/src/components/ActionEditor.vue +++ b/src/components/ActionEditor.vue @@ -19,6 +19,10 @@ const markerNames = computed(() => (store.scene.markers ?? []).map((m) => m.name), ) +const sceneOptions = computed(() => + store.project.scenes.map((s) => ({ id: s.id, name: s.name })), +) + const ACTION_TYPES: Action['type'][] = [ 'play', 'pause', @@ -26,6 +30,7 @@ const ACTION_TYPES: Action['type'][] = [ 'jumpTo', 'jumpToFrame', 'jumpToMarker', + 'jumpToScene', 'script', ] @@ -45,6 +50,14 @@ function makeDefault(type: Action['type']): Action { return { type: 'jumpToFrame', frame: 0 } case 'jumpToMarker': return { type: 'jumpToMarker', name: markerNames.value[0] ?? '' } + case 'jumpToScene': { + // Default to the first scene that ISN'T the current one so the + // action is immediately useful; fall back to the first if there's + // only one scene. + const others = sceneOptions.value.filter((s) => s.id !== store.project.activeSceneId) + const target = others[0] ?? sceneOptions.value[0] + return { type: 'jumpToScene', sceneId: target?.id ?? '' } + } case 'script': return { type: 'script', source: '' } } @@ -152,6 +165,18 @@ function onTypeChange(index: number, newType: Action['type']) { +
+ +