Rename SequenceStep to SequenceClip and update related functions

This commit is contained in:
2026-04-15 00:18:56 +02:00
parent f13188bf32
commit 07bf28e53d

View File

@@ -12,8 +12,8 @@ import {
import { import {
getProjectSequenceHeldSteps, getProjectSequenceHeldSteps,
getProjectSequenceImpulseSteps, getProjectSequenceImpulseSteps,
getSequenceStepLabel, getSequenceClipLabel,
type SequenceStep type SequenceClip
} from "../sequencer/project-sequence-steps"; } from "../sequencer/project-sequence-steps";
import { import {
getProjectSequences, getProjectSequences,
@@ -82,8 +82,8 @@ function commitOnEnter(
commit(); commit();
} }
function getControlStepNumericValue(step: Extract<SequenceStep, { type: "controlEffect" }>): number | null { function getControlClipNumericValue(clip: Extract<SequenceClip, { type: "controlEffect" }>): number | null {
switch (step.effect.type) { switch (clip.effect.type) {
case "setSoundVolume": case "setSoundVolume":
return step.effect.volume; return step.effect.volume;
case "setLightIntensity": case "setLightIntensity":
@@ -95,8 +95,8 @@ function getControlStepNumericValue(step: Extract<SequenceStep, { type: "control
} }
} }
function getControlStepColorValue(step: Extract<SequenceStep, { type: "controlEffect" }>): string | null { function getControlClipColorValue(clip: Extract<SequenceClip, { type: "controlEffect" }>): string | null {
switch (step.effect.type) { switch (clip.effect.type) {
case "setLightColor": case "setLightColor":
case "setAmbientLightColor": case "setAmbientLightColor":
case "setSunLightColor": case "setSunLightColor":
@@ -158,6 +158,8 @@ export function ProjectSequencesPanel({
> >
<span className="outliner-item__title">{sequence.title}</span> <span className="outliner-item__title">{sequence.title}</span>
<span className="outliner-item__meta"> <span className="outliner-item__meta">
{sequence.clips.length} clip
{sequence.clips.length === 1 ? "" : "s"} ·{" "}
{getProjectSequenceHeldSteps(sequence).length} held ·{" "} {getProjectSequenceHeldSteps(sequence).length} held ·{" "}
{getProjectSequenceImpulseSteps(sequence).length} impulse {getProjectSequenceImpulseSteps(sequence).length} impulse
</span> </span>
@@ -189,8 +191,9 @@ export function ProjectSequencesPanel({
) : ( ) : (
<div className="form-section"> <div className="form-section">
<div className="material-summary"> <div className="material-summary">
Held steps are resolved by sequencer timeline clips. Impulse steps Build a sequence from clips. Held clips resolve over a timeline
can be started immediately from interaction links. placement; impulse clips can be started immediately from
interaction links.
</div> </div>
<label className="form-field"> <label className="form-field">
<span className="label">Title</span> <span className="label">Title</span>
@@ -210,17 +213,17 @@ export function ProjectSequencesPanel({
</label> </label>
<div className="label">Steps</div> <div className="label">Steps</div>
{selectedSequence.steps.length === 0 ? ( {selectedSequence.clips.length === 0 ? (
<div className="outliner-empty"> <div className="outliner-empty">
Add held control, impulse control, or dialogue steps. Interaction Add held control, impulse control, or dialogue clips. Interaction
links can only run sequences that contain at least one impulse links can only run sequences that contain at least one impulse
step. clip.
</div> </div>
) : ( ) : (
<div className="outliner-list"> <div className="outliner-list">
{selectedSequence.steps.map((step, stepIndex) => { {selectedSequence.clips.map((clip, clipIndex) => {
if (step.type === "controlEffect") { if (clip.type === "controlEffect") {
const targetKey = getControlTargetRefKey(step.effect.target); const targetKey = getControlTargetRefKey(clip.effect.target);
const targetOption = const targetOption =
getProjectScheduleTargetOptionByKey(targetOptions, targetKey); getProjectScheduleTargetOptionByKey(targetOptions, targetKey);
const effectOptions = const effectOptions =
@@ -232,7 +235,7 @@ export function ProjectSequencesPanel({
? null ? null
: (() => { : (() => {
try { try {
return getProjectScheduleEffectOptionId(step.effect); return getProjectScheduleEffectOptionId(clip.effect);
} catch { } catch {
return null; return null;
} }
@@ -244,15 +247,15 @@ export function ProjectSequencesPanel({
null; null;
return ( return (
<div key={`${selectedSequence.id}-${stepIndex}`} className="outliner-item"> <div key={`${selectedSequence.id}-${clipIndex}`} className="outliner-item">
<div className="outliner-item__row"> <div className="outliner-item__row">
<div className="outliner-item__meta"> <div className="outliner-item__meta">
{getSequenceStepLabel(step)} {getSequenceClipLabel(clip)}
</div> </div>
<button <button
className="outliner-item__delete" className="outliner-item__delete"
type="button" type="button"
onClick={() => onDeleteStep(selectedSequence.id, stepIndex)} onClick={() => onDeleteStep(selectedSequence.id, clipIndex)}
> >
x x
</button> </button>
@@ -260,7 +263,7 @@ export function ProjectSequencesPanel({
{targetOption === null || effectOptionId === null ? ( {targetOption === null || effectOptionId === null ? (
<div className="material-summary"> <div className="material-summary">
{formatControlEffectValue(step.effect)}. This control step {formatControlEffectValue(clip.effect)}. This control clip
is preserved, but the current sequence editor can only edit is preserved, but the current sequence editor can only edit
control targets/effects that are exposed through the control targets/effects that are exposed through the
existing sequencer target catalog. existing sequencer target catalog.
@@ -285,7 +288,7 @@ export function ProjectSequencesPanel({
onChange={(event) => onChange={(event) =>
onSetControlStepTarget( onSetControlStepTarget(
selectedSequence.id, selectedSequence.id,
stepIndex, clipIndex,
event.currentTarget.value event.currentTarget.value
) )
} }
@@ -306,7 +309,7 @@ export function ProjectSequencesPanel({
onChange={(event) => onChange={(event) =>
onSetControlStepEffectOption( onSetControlStepEffectOption(
selectedSequence.id, selectedSequence.id,
stepIndex, clipIndex,
event.currentTarget event.currentTarget
.value as ProjectScheduleEffectOptionId .value as ProjectScheduleEffectOptionId
) )
@@ -330,11 +333,11 @@ export function ProjectSequencesPanel({
type="number" type="number"
min={selectedEffectOption.min ?? 0} min={selectedEffectOption.min ?? 0}
step={selectedEffectOption.step ?? 0.1} step={selectedEffectOption.step ?? 0.1}
defaultValue={getControlStepNumericValue(step) ?? 0} defaultValue={getControlClipNumericValue(clip) ?? 0}
onBlur={(event) => onBlur={(event) =>
onSetControlStepNumericValue( onSetControlStepNumericValue(
selectedSequence.id, selectedSequence.id,
stepIndex, clipIndex,
Number(event.currentTarget.value) Number(event.currentTarget.value)
) )
} }
@@ -342,7 +345,7 @@ export function ProjectSequencesPanel({
commitOnEnter(event, () => commitOnEnter(event, () =>
onSetControlStepNumericValue( onSetControlStepNumericValue(
selectedSequence.id, selectedSequence.id,
stepIndex, clipIndex,
Number(event.currentTarget.value) Number(event.currentTarget.value)
) )
) )
@@ -359,11 +362,11 @@ export function ProjectSequencesPanel({
<input <input
className="color-input" className="color-input"
type="color" type="color"
value={getControlStepColorValue(step) ?? "#ffffff"} value={getControlClipColorValue(clip) ?? "#ffffff"}
onChange={(event) => onChange={(event) =>
onSetControlStepColorValue( onSetControlStepColorValue(
selectedSequence.id, selectedSequence.id,
stepIndex, clipIndex,
event.currentTarget.value event.currentTarget.value
) )
} }
@@ -378,15 +381,15 @@ export function ProjectSequencesPanel({
<select <select
className="select-input" className="select-input"
value={ value={
step.effect.type === "playModelAnimation" clip.effect.type === "playModelAnimation"
? step.effect.clipName ? clip.effect.clipName
: targetOption.defaults.animationClipNames?.[0] ?? : targetOption.defaults.animationClipNames?.[0] ??
"" ""
} }
onChange={(event) => onChange={(event) =>
onSetControlStepAnimationClip( onSetControlStepAnimationClip(
selectedSequence.id, selectedSequence.id,
stepIndex, clipIndex,
event.currentTarget.value event.currentTarget.value
) )
} }
@@ -404,14 +407,14 @@ export function ProjectSequencesPanel({
<input <input
type="checkbox" type="checkbox"
checked={ checked={
step.effect.type === "playModelAnimation" clip.effect.type === "playModelAnimation"
? step.effect.loop !== false ? clip.effect.loop !== false
: true : true
} }
onChange={(event) => onChange={(event) =>
onSetControlStepAnimationLoop( onSetControlStepAnimationLoop(
selectedSequence.id, selectedSequence.id,
stepIndex, clipIndex,
event.currentTarget.checked event.currentTarget.checked
) )
} }
@@ -426,17 +429,17 @@ export function ProjectSequencesPanel({
); );
} }
if (step.type === "startDialogue") { if (clip.type === "startDialogue") {
return ( return (
<div key={`${selectedSequence.id}-${stepIndex}`} className="outliner-item"> <div key={`${selectedSequence.id}-${clipIndex}`} className="outliner-item">
<div className="outliner-item__row"> <div className="outliner-item__row">
<div className="outliner-item__meta"> <div className="outliner-item__meta">
{getSequenceStepLabel(step)} {getSequenceClipLabel(clip)}
</div> </div>
<button <button
className="outliner-item__delete" className="outliner-item__delete"
type="button" type="button"
onClick={() => onDeleteStep(selectedSequence.id, stepIndex)} onClick={() => onDeleteStep(selectedSequence.id, clipIndex)}
> >
x x
</button> </button>
@@ -446,11 +449,11 @@ export function ProjectSequencesPanel({
<span className="label">Dialogue</span> <span className="label">Dialogue</span>
<select <select
className="select-input" className="select-input"
value={step.dialogueId} value={clip.dialogueId}
onChange={(event) => onChange={(event) =>
onSetDialogueStepDialogueId( onSetDialogueStepDialogueId(
selectedSequence.id, selectedSequence.id,
stepIndex, clipIndex,
event.currentTarget.value event.currentTarget.value
) )
} }
@@ -467,22 +470,22 @@ export function ProjectSequencesPanel({
} }
return ( return (
<div key={`${selectedSequence.id}-${stepIndex}`} className="outliner-item"> <div key={`${selectedSequence.id}-${clipIndex}`} className="outliner-item">
<div className="outliner-item__row"> <div className="outliner-item__row">
<div className="outliner-item__meta"> <div className="outliner-item__meta">
{getSequenceStepLabel(step)} {getSequenceClipLabel(clip)}
</div> </div>
<button <button
className="outliner-item__delete" className="outliner-item__delete"
type="button" type="button"
onClick={() => onDeleteStep(selectedSequence.id, stepIndex)} onClick={() => onDeleteStep(selectedSequence.id, clipIndex)}
> >
x x
</button> </button>
</div> </div>
<div className="material-summary"> <div className="material-summary">
This impulse step is preserved, but the current sequence This impulse clip is preserved, but the current sequence
editor only exposes direct dialogue authoring for authored editor only exposes direct dialogue authoring for authored
project sequences. project sequences.
</div> </div>
@@ -501,7 +504,7 @@ export function ProjectSequencesPanel({
onAddHeldControlStep(selectedSequence.id, targetOptions[0]?.key ?? "") onAddHeldControlStep(selectedSequence.id, targetOptions[0]?.key ?? "")
} }
> >
Add Held Control Step Add Held Control Clip
</button> </button>
<button <button
className="toolbar__button" className="toolbar__button"
@@ -514,7 +517,7 @@ export function ProjectSequencesPanel({
) )
} }
> >
Add Impulse Control Step Add Impulse Control Clip
</button> </button>
<button <button
className="toolbar__button" className="toolbar__button"
@@ -524,7 +527,7 @@ export function ProjectSequencesPanel({
onAddDialogueStep(selectedSequence.id, dialogueList[0]?.id ?? "") onAddDialogueStep(selectedSequence.id, dialogueList[0]?.id ?? "")
} }
> >
Add Dialogue Step Add Dialogue Clip
</button> </button>
</div> </div>
</div> </div>