Add path control options to ProjectSequencesPanel

This commit is contained in:
2026-04-15 06:20:36 +02:00
parent 409107b1ad
commit b5791a973a

View File

@@ -91,6 +91,21 @@ interface ProjectSequencesPanelProps {
stepIndex: number, stepIndex: number,
loop: boolean loop: boolean
): void; ): void;
onSetControlStepPathId(
sequenceId: string,
stepIndex: number,
pathId: string
): void;
onSetControlStepPathSpeed(
sequenceId: string,
stepIndex: number,
speed: number
): void;
onSetControlStepPathLoop(
sequenceId: string,
stepIndex: number,
loop: boolean
): void;
onSetDialogueStepDialogueId( onSetDialogueStepDialogueId(
sequenceId: string, sequenceId: string,
stepIndex: number, stepIndex: number,
@@ -189,6 +204,9 @@ export function ProjectSequencesPanel({
onSetControlStepColorValue, onSetControlStepColorValue,
onSetControlStepAnimationClip, onSetControlStepAnimationClip,
onSetControlStepAnimationLoop, onSetControlStepAnimationLoop,
onSetControlStepPathId,
onSetControlStepPathSpeed,
onSetControlStepPathLoop,
onSetDialogueStepDialogueId, onSetDialogueStepDialogueId,
onSetTeleportStepTarget, onSetTeleportStepTarget,
onSetSceneTransitionStepTarget, onSetSceneTransitionStepTarget,
@@ -444,7 +462,8 @@ export function ProjectSequencesPanel({
</label> </label>
) : null} ) : null}
{effect.effect.type === "playModelAnimation" ? ( {effect.effect.type === "playModelAnimation" ||
effect.effect.type === "playActorAnimation" ? (
<> <>
<label className="form-field"> <label className="form-field">
<span className="label">Clip</span> <span className="label">Clip</span>
@@ -459,13 +478,15 @@ export function ProjectSequencesPanel({
) )
} }
> >
{(targetOption.defaults.animationClipNames ?? []).map( {(
(clipName) => ( effect.effect.type === "playActorAnimation"
? targetOption.defaults.actorAnimationClipNames
: targetOption.defaults.animationClipNames
)?.map((clipName) => (
<option key={clipName} value={clipName}> <option key={clipName} value={clipName}>
{clipName} {clipName}
</option> </option>
) ))}
)}
</select> </select>
</label> </label>
<label className="form-field form-field--inline"> <label className="form-field form-field--inline">
@@ -484,6 +505,77 @@ export function ProjectSequencesPanel({
</label> </label>
</> </>
) : null} ) : null}
{effect.effect.type === "followActorPath" ? (
<>
<label className="form-field">
<span className="label">Path</span>
<select
className="select-input"
value={effect.effect.pathId}
onChange={(event) =>
onSetControlStepPathId(
selectedSequence.id,
effectIndex,
event.currentTarget.value
)
}
>
{(targetOption.defaults.actorPathOptions ?? []).map(
(pathOption) => (
<option
key={pathOption.pathId}
value={pathOption.pathId}
>
{pathOption.label}
</option>
)
)}
</select>
</label>
<label className="form-field">
<span className="label">Speed</span>
<input
key={`${selectedSequence.id}-${effectIndex}-path-speed`}
className="text-input"
type="number"
min="0.01"
step="0.1"
defaultValue={effect.effect.speed}
onBlur={(event) =>
onSetControlStepPathSpeed(
selectedSequence.id,
effectIndex,
Number(event.currentTarget.value)
)
}
onKeyDown={(event) =>
commitOnEnter(event, () =>
onSetControlStepPathSpeed(
selectedSequence.id,
effectIndex,
Number(event.currentTarget.value)
)
)
}
/>
</label>
<label className="form-field form-field--inline">
<input
type="checkbox"
checked={effect.effect.loop}
onChange={(event) =>
onSetControlStepPathLoop(
selectedSequence.id,
effectIndex,
event.currentTarget.checked
)
}
/>
<span className="label">Loop</span>
</label>
</>
) : null}
</> </>
)} )}
</div> </div>