Skip to content

🎥 Make videos programmatically with React

`@remotion/studio`: Move keyframe settings to easing inspector (#9065)

Jonny Burger35636729295a
diff --git a/packages/studio/src/components/InspectorPanel/EasingInspector.tsx b/packages/studio/src/components/InspectorPanel/EasingInspector.tsx
index ab0a4388f0..66f1e34460 100644
--- a/packages/studio/src/components/InspectorPanel/EasingInspector.tsx
+++ b/packages/studio/src/components/InspectorPanel/EasingInspector.tsx
@@ -30,9 +30,11 @@ import {
} from './common';
import {getEasingSelectionFromCurrentKeyframes} from './easing-inspector-selection';
import {KeyframeEasingNavigator} from './KeyframeEasingNavigator';
+import {KeyframeSettings} from './KeyframeSettings';
import {SequenceInspectorHeaderWithDivider} from './SequenceInspectorHeader';
import {
detailsContainer,
+ inspectorSectionDivider,
sectionHeaderTitle,
selectedContainer,
} from './styles';
@@ -310,7 +312,12 @@ export const EasingInspector: React.FC<{
],
);
- if (state === null || track === null || currentEasingSelection === null) {
+ if (
+ state === null ||
+ track === null ||
+ currentEasingSelection === null ||
+ easingUpdate === null
+ ) {
return <InspectorMessage>Easing unavailable</InspectorMessage>;
}
@@ -322,18 +329,22 @@ export const EasingInspector: React.FC<{
state={state}
renderHeader={renderHeader}
/>
+ <KeyframeSettings update={easingUpdate} />
{canAddKeyframeAtPlayhead ? (
- <div style={detailsContainer}>
- <InspectorInlineAction
- disabled={addKeyframeDisabled}
- onClick={onAddKeyframeAtPlayhead}
- renderIcon={(color) => (
- <Plus color={color} style={addKeyframeIcon} />
- )}
- >
- {`Add keyframe at ${addKeyframeTime}`}
- </InspectorInlineAction>
- </div>
+ <>
+ <div style={inspectorSectionDivider} />
+ <div style={detailsContainer}>
+ <InspectorInlineAction
+ disabled={addKeyframeDisabled}
+ onClick={onAddKeyframeAtPlayhead}
+ renderIcon={(color) => (
+ <Plus color={color} style={addKeyframeIcon} />
+ )}
+ >
+ {`Add keyframe at ${addKeyframeTime}`}
+ </InspectorInlineAction>
+ </div>
+ </>
) : null}
</div>
);
diff --git a/packages/studio/src/components/InspectorPanel/KeyframeSettings.tsx b/packages/studio/src/components/InspectorPanel/KeyframeSettings.tsx
new file mode 100644
index 0000000000..51eee3e048
--- /dev/null
+++ b/packages/studio/src/components/InspectorPanel/KeyframeSettings.tsx
@@ -0,0 +1,258 @@
+import type {KeyframeSettings as KeyframeSettingsValue} from '@remotion/studio-shared';
+import React, {
+ useCallback,
+ useContext,
+ useEffect,
+ useMemo,
+ useState,
+} from 'react';
+import type {ExtrapolateType, InterpolateOutputOption} from 'remotion';
+import {Internals} from 'remotion';
+import {StudioServerConnectionCtx} from '../../helpers/client-id';
+import {Combobox, type ComboboxValue} from '../NewComposition/ComboBox';
+import {InputDragger} from '../NewComposition/InputDragger';
+import {
+ callUpdateEffectKeyframeSettings,
+ callUpdateSequenceKeyframeSettings,
+} from '../Timeline/call-update-keyframe-settings';
+import type {SelectedEasingUpdate} from '../Timeline/update-selected-easing';
+import {InspectorDetailRow, InspectorSectionHeader} from './common';
+import {detailsContainer, inspectorSectionDivider} from './styles';
+
+const comboStyle: React.CSSProperties = {
+ minWidth: 120,
+};
+
+const keyframeSettingsContainer: React.CSSProperties = {
+ ...detailsContainer,
+ paddingBottom: 0,
+};
+
+const extrapolateOptions = [
+ 'extend',
+ 'clamp',
+ 'identity',
+ 'wrap',
+] as const satisfies ExtrapolateType[];
+
+const labelForExtrapolate = (value: ExtrapolateType) =>
+ value[0].toUpperCase() + value.slice(1);
+
+const getExtrapolateValues = (
+ onSelect: (value: ExtrapolateType) => void,
+ disabled: boolean,
+): ComboboxValue[] => {
+ return extrapolateOptions.map((value) => ({
+ type: 'item',
+ id: value,
+ keyHint: null,
+ label: labelForExtrapolate(value),
+ leftItem: null,
+ disabled,
+ onClick: () => onSelect(value),
+ quickSwitcherLabel: null,
+ subMenu: null,
+ value,
+ }));
+};
+
+const outputOptions = [
+ 'linear',
+ 'perceptual-scale',
+] as const satisfies InterpolateOutputOption[];
+
+const labelForOutput = (value: InterpolateOutputOption) => {
+ return value === 'perceptual-scale' ? 'Perceptual scale' : 'Linear';
+};
+
+const getOutputValues = (
+ onSelect: (value: InterpolateOutputOption) => void,
+ disabled: boolean,
+): ComboboxValue[] => {
+ return outputOptions.map((value) => ({
+ type: 'item',
+ id: value,
+ keyHint: null,
+ label: labelForOutput(value),
+ leftItem: null,
+ disabled,
+ onClick: () => onSelect(value),
+ quickSwitcherLabel: null,
+ subMenu: null,
+ value,
+ }));
+};
+
+export const KeyframeSettings: React.FC<{
+ readonly update: SelectedEasingUpdate;
+}> = ({update}) => {
+ const {setPropStatuses} = useContext(Internals.VisualModeSettersContext);
+ const {previewServerState} = useContext(StudioServerConnectionCtx);
+ const {propStatus} = update;
+ const [posterize, setPosterize] = useState(propStatus.posterize ?? 0);
+ const canEditInterpolationSettings =
+ propStatus.interpolationFunction === 'interpolate';
+ const disabled = previewServerState.type !== 'connected';
+
+ useEffect(() => {
+ setPosterize(propStatus.posterize ?? 0);
+ }, [propStatus.posterize]);
+
+ const save = useCallback(
+ (settings: KeyframeSettingsValue) => {
+ if (previewServerState.type !== 'connected') {
+ return;
+ }
+
+ if (update.type === 'sequence') {
+ callUpdateSequenceKeyframeSettings({
+ fileName: update.fileName,
+ nodePath: update.nodePath,
+ fieldKey: update.fieldKey,
+ settings,
+ schema: update.schema,
+ setPropStatuses,
+ clientId: previewServerState.clientId,
+ }).catch(() => undefined);
+ return;
+ }
+
+ callUpdateEffectKeyframeSettings({
+ fileName: update.fileName,
+ nodePath: update.nodePath,
+ effectIndex: update.effectIndex,
+ fieldKey: update.fieldKey,
+ settings,
+ schema: update.schema,
+ setPropStatuses,
+ clientId: previewServerState.clientId,
+ }).catch(() => undefined);
+ },
+ [previewServerState, setPropStatuses, update],
+ );
+
+ const saveSettings = useCallback(
+ ({
+ left = propStatus.clamping.left,
+ output = propStatus.output ?? 'linear',
+ posterize: nextPosterize = propStatus.posterize ?? 0,
+ right = propStatus.clamping.right,
+ }: {
+ readonly left?: ExtrapolateType;
+ readonly output?: InterpolateOutputOption;
+ readonly posterize?: number;
+ readonly right?: ExtrapolateType;
+ }) => {
+ save({
+ type: 'settings',
+ clamping: canEditInterpolationSettings ? {left, right} : undefined,
+ output: canEditInterpolationSettings ? output : undefined,
+ posterize: nextPosterize <= 0 ? undefined : nextPosterize,
+ });
+ },
+ [
+ canEditInterpolationSettings,
+ propStatus.clamping.left,
+ propStatus.clamping.right,
+ propStatus.output,
+ propStatus.posterize,
+ save,
+ ],
+ );
+
+ const onSelectLeft = useCallback(
+ (left: ExtrapolateType) => saveSettings({left}),
+ [saveSettings],
+ );
+ const onSelectRight = useCallback(
+ (right: ExtrapolateType) => saveSettings({right}),
+ [saveSettings],
+ );
+ const onSelectOutput = useCallback(
+ (output: InterpolateOutputOption) => saveSettings({output}),
+ [saveSettings],
+ );
+ const leftValues = useMemo(
+ () => getExtrapolateValues(onSelectLeft, disabled),
+ [disabled, onSelectLeft],
+ );
+ const rightValues = useMemo(
+ () => getExtrapolateValues(onSelectRight, disabled),
+ [disabled, onSelectRight],
+ );
+ const outputValues = useMemo(
+ () => getOutputValues(onSelectOutput, disabled),
+ [disabled, onSelectOutput],
+ );
+
+ const onPosterizeChange = useCallback((value: number) => {
+ setPosterize(Math.max(0, Math.round(value)));
+ }, []);
+ const onPosterizeChangeEnd = useCallback(
+ (value: number) => {
+ const nextPosterize = Math.max(0, Math.round(value));
+ setPosterize(nextPosterize);
+ saveSettings({posterize: nextPosterize});
+ },
+ [saveSettings],
+ );
+ const posterizeFormatter = useCallback((value: number | string) => {
+ return String(Math.round(Number(value)));
+ }, []);
+
+ return (
+ <>
+ <div style={inspectorSectionDivider} />
+ <InspectorSectionHeader>Keyframe settings</InspectorSectionHeader>
+ <div style={keyframeSettingsContainer}>
+ {canEditInterpolationSettings ? (
+ <>
+ <InspectorDetailRow label="Extrapolate left">
+ <Combobox
+ values={leftValues}
+ selectedId={propStatus.clamping.left}
+ title="Extrapolate left"
+ style={comboStyle}
+ small
+ />
+ </InspectorDetailRow>
+ <InspectorDetailRow label="Extrapolate right">
+ <Combobox
+ values={rightValues}
+ selectedId={propStatus.clamping.right}
+ title="Extrapolate right"
+ style={comboStyle}
+ small
+ />
+ </InspectorDetailRow>
+ <InspectorDetailRow label="Output">
+ <Combobox
+ values={outputValues}
+ selectedId={propStatus.output ?? 'linear'}
+ title="Output"
+ style={comboStyle}
+ small
+ />
+ </InspectorDetailRow>
+ </>
+ ) : null}
+ <InspectorDetailRow label="Posterize">
+ <InputDragger
+ type="number"
+ value={posterize}
+ status="ok"
+ onValueChange={onPosterizeChange}
+ onValueChangeEnd={onPosterizeChangeEnd}
+ onTextChange={() => undefined}
+ min={0}
+ step={1}
+ formatter={posterizeFormatter}
+ rightAlign
+ small
+ disabled={disabled}
+ />
+ </InspectorDetailRow>
+ </div>
+ </>
+ );
+};
diff --git a/packages/studio/src/components/Modals.tsx b/packages/studio/src/components/Modals.tsx
index a484198c35..b5ef922586 100644
--- a/packages/studio/src/components/Modals.tsx
+++ b/packages/studio/src/components/Modals.tsx
@@ -19,7 +19,6 @@ import QuickSwitcher from './QuickSwitcher/QuickSwitcher';
import {RenderStatusModal} from './RenderModal/RenderStatusModal';
import {RenderModalWithLoader} from './RenderModal/ServerRenderModal';
import {WebRenderModalWithLoader} from './RenderModal/WebRenderModal';
-import {KeyframeSettingsModal} from './Timeline/KeyframeSettingsModal';
import {UpdateModal} from './UpdateModal/UpdateModal';
export const Modals: React.FC<{
@@ -77,10 +76,6 @@ export const Modals: React.FC<{
{modalContextType && modalContextType.type === 'input-props-override' && (
<OverrideInputPropsModal />
)}
- {modalContextType && modalContextType.type === 'keyframe-settings' && (
- <KeyframeSettingsModal state={modalContextType} />
- )}
-
{modalContextType && modalContextType.type === 'web-render' && (
<WebRenderModalWithLoader {...modalContextType} />
)}
diff --git a/packages/studio/src/components/Timeline/KeyframeSettingsModal.tsx b/packages/studio/src/components/Timeline/KeyframeSettingsModal.tsx
deleted file mode 100644
index fb317b1653..0000000000
--- a/packages/studio/src/components/Timeline/KeyframeSettingsModal.tsx
+++ /dev/null
@@ -1,283 +0,0 @@
-import type {KeyframeSettings} from '@remotion/studio-shared';
-import React, {useCallback, useContext, useMemo, useState} from 'react';
-import type {
- CanUpdateSequencePropStatusKeyframed,
- ExtrapolateType,
- InterpolateOutputOption,
- SequencePropsSubscriptionKey,
- InteractivitySchema,
-} from 'remotion';
-import {Internals} from 'remotion';
-import {StudioServerConnectionCtx} from '../../helpers/client-id';
-import {INPUT_BACKGROUND, WHITE_ALPHA_60} from '../../helpers/colors';
-import {ModalsContext} from '../../state/modals';
-import {Button} from '../Button';
-import {Row, Spacing} from '../layout';
-import {ModalButton} from '../ModalButton';
-import {ModalFooterContainer} from '../ModalFooter';
-import {ModalHeader} from '../ModalHeader';
-import {Combobox, type ComboboxValue} from '../NewComposition/ComboBox';
-import {DismissableModal} from '../NewComposition/DismissableModal';
-import {InputDragger} from '../NewComposition/InputDragger';
-import {
- callUpdateEffectKeyframeSettings,
- callUpdateSequenceKeyframeSettings,
-} from './call-update-keyframe-settings';
-
-const container: React.CSSProperties = {
- padding: 16,
- width: 520,
-};
-
-const row: React.CSSProperties = {
- alignItems: 'center',
- display: 'flex',
- justifyContent: 'space-between',
- marginBottom: 12,
-};
-
-const label: React.CSSProperties = {
- fontSize: 13,
-};
-
-const helperText: React.CSSProperties = {
- color: WHITE_ALPHA_60,
- fontSize: 12,
- lineHeight: 1.4,
- marginTop: 4,
-};
-
-const comboStyle: React.CSSProperties = {
- minWidth: 150,
-};
-
-const posterizeInputStyle: React.CSSProperties = {
- backgroundColor: INPUT_BACKGROUND,
- borderRadius: 4,
- minWidth: 64,
- textAlign: 'right',
-};
-
-const extrapolateOptions = [
- 'extend',
- 'clamp',
- 'identity',
- 'wrap',
-] as const satisfies ExtrapolateType[];
-
-const labelForExtrapolate = (value: ExtrapolateType) =>
- value[0].toUpperCase() + value.slice(1);
-
-const getExtrapolateValues = (
- onSelect: (value: ExtrapolateType) => void,
-): ComboboxValue[] => {
- return extrapolateOptions.map((value) => ({
- type: 'item',
- id: value,
- keyHint: null,
- label: labelForExtrapolate(value),
- leftItem: null,
- disabled: false,
- onClick: () => onSelect(value),
- quickSwitcherLabel: null,
- subMenu: null,
- value,
- }));
-};
-
-const outputOptions = [
- 'linear',
- 'perceptual-scale',
-] as const satisfies InterpolateOutputOption[];
-
-const labelForOutput = (value: InterpolateOutputOption) => {
- if (value === 'perceptual-scale') {
- return 'Perceptual scale';
- }
-
- return 'Linear';
-};
-
-const getOutputValues = (
- onSelect: (value: InterpolateOutputOption) => void,
-): ComboboxValue[] => {
- return outputOptions.map((value) => ({
- type: 'item',
- id: value,
- keyHint: null,
- label: labelForOutput(value),
- leftItem: null,
- disabled: false,
- onClick: () => onSelect(value),
- quickSwitcherLabel: null,
- subMenu: null,
- value,
- }));
-};
-
-export type KeyframeSettingsModalState = {
- type: 'keyframe-settings';
- fileName: string;
- nodePath: SequencePropsSubscriptionKey;
- fieldKey: string;
- fieldLabel: string;
- status: CanUpdateSequencePropStatusKeyframed;
- schema: InteractivitySchema;
- effectIndex: number | null;
-};
-
-export const KeyframeSettingsModal: React.FC<{
- readonly state: KeyframeSettingsModalState;
-}> = ({state}) => {
- const {setSelectedModal} = useContext(ModalsContext);
- const {setPropStatuses} = useContext(Internals.VisualModeSettersContext);
- const {previewServerState} = useContext(StudioServerConnectionCtx);
- const [left, setLeft] = useState(state.status.clamping.left);
- const [right, setRight] = useState(state.status.clamping.right);
- const [output, setOutput] = useState<InterpolateOutputOption>(
- state.status.output ?? 'linear',
- );
- const [posterize, setPosterize] = useState(state.status.posterize ?? 0);
- const [saving, setSaving] = useState(false);
- const canEditClamping = state.status.interpolationFunction === 'interpolate';
- const canEditOutput = state.status.interpolationFunction === 'interpolate';
-
- const close = useCallback(() => {
- setSelectedModal(null);
- }, [setSelectedModal]);
-
- const leftOptions = useMemo(() => getExtrapolateValues(setLeft), []);
- const rightOptions = useMemo(() => getExtrapolateValues(setRight), []);
- const outputValues = useMemo(() => getOutputValues(setOutput), []);
-
- const onPosterizeChange = useCallback((value: number) => {
- setPosterize(Math.max(0, Math.round(value)));
- }, []);
-
- const posterizeFormatter = useCallback((value: number | string) => {
- const numericValue = Number(value);
- return String(Math.round(numericValue));
- }, []);
-
- const onSave = useCallback(() => {
- if (previewServerState.type !== 'connected') {
- return;
- }
-
- const settings: KeyframeSettings = {
- type: 'settings',
- clamping: canEditClamping ? {left, right} : undefined,
- output: canEditOutput ? output : undefined,
- posterize: posterize <= 0 ? undefined : posterize,
- };
-
- setSaving(true);
- const promise =
- state.effectIndex === null
- ? callUpdateSequenceKeyframeSettings({
- fileName: state.fileName,
- nodePath: state.nodePath,
- fieldKey: state.fieldKey,
- settings,
- schema: state.schema,
- setPropStatuses,
- clientId: previewServerState.clientId,
- })
- : callUpdateEffectKeyframeSettings({
- fileName: state.fileName,
- nodePath: state.nodePath,
- effectIndex: state.effectIndex,
- fieldKey: state.fieldKey,
- settings,
- schema: state.schema,
- setPropStatuses,
- clientId: previewServerState.clientId,
- });
-
- promise.then(close).finally(() => {
- setSaving(false);
- });
- }, [
- canEditClamping,
- canEditOutput,
- close,
- left,
- output,
- posterize,
- previewServerState,
- right,
- setPropStatuses,
- state,
- ]);
-
- const saveDisabled = saving || previewServerState.type !== 'connected';
-
- return (
- <DismissableModal>
- <ModalHeader title={`Keyframe settings: ${state.fieldLabel}`} />
- <div style={container}>
- {canEditClamping ? (
- <>
- <div style={row}>
- <div style={label}>Extrapolate left</div>
- <Combobox
- values={leftOptions}
- selectedId={left}
- title="Extrapolate left"
- style={comboStyle}
- />
- </div>
- <div style={row}>
- <div style={label}>Extrapolate right</div>
- <Combobox
- values={rightOptions}
- selectedId={right}
- title="Extrapolate right"
- style={comboStyle}
- />
- </div>
- {canEditOutput ? (
- <div style={row}>
- <div style={label}>Output</div>
- <Combobox
- values={outputValues}
- selectedId={output}
- title="Output"
- style={comboStyle}
- />
- </div>
- ) : null}
- </>
- ) : null}
- <div style={row}>
- <div>
- <div style={label}>Posterize</div>
- <div style={helperText}>Use 0 to turn posterization off.</div>
- </div>
- <InputDragger
- type="number"
- value={posterize}
- status="ok"
- onValueChange={onPosterizeChange}
- onValueChangeEnd={onPosterizeChange}
- onTextChange={() => undefined}
- min={0}
- step={1}
- formatter={posterizeFormatter}
- rightAlign
- style={posterizeInputStyle}
- />
- </div>
- </div>
- <ModalFooterContainer>
- <Row justify="flex-end" align="center">
- <Button onClick={close}>Cancel</Button>
- <Spacing x={1} />
- <ModalButton onClick={onSave} disabled={saveDisabled}>
- Save
- </ModalButton>
- </Row>
- </ModalFooterContainer>
- </DismissableModal>
- );
-};
diff --git a/packages/studio/src/components/Timeline/TimelineEffectPropItem.tsx b/packages/studio/src/components/Timeline/TimelineEffectPropItem.tsx
index be9ae2dc77..9ca8b49c92 100644
--- a/packages/studio/src/components/Timeline/TimelineEffectPropItem.tsx
+++ b/packages/studio/src/components/Timeline/TimelineEffectPropItem.tsx
@@ -13,7 +13,6 @@ import type {CodePosition} from '../../error-overlay/react-overlay/utils/get-sou
import {StudioServerConnectionCtx} from '../../helpers/client-id';
import type {SequenceNodePathInfo} from '../../helpers/get-timeline-sequence-sort-key';
import type {EffectSchemaFieldInfo} from '../../helpers/timeline-layout';
-import {ModalsContext} from '../../state/modals';
import {callApi} from '../call-api';
import {ContextMenu} from '../ContextMenu';
import type {ComboboxValue} from '../NewComposition/ComboBox';
@@ -362,7 +361,6 @@ export const TimelineEffectPropItem: React.FC<{
keyframeControlsMode = 'timeline',
}) => {
const {previewServerState} = useContext(StudioServerConnectionCtx);
- const {setSelectedModal} = useContext(ModalsContext);
const {setPropStatuses} = useContext(Internals.VisualModeSettersContext);
const {propStatuses} = useContext(Internals.VisualModePropStatusesContext);
const {getEffectDragOverrides} = useContext(
@@ -486,34 +484,8 @@ export const TimelineEffectPropItem: React.FC<{
validatedLocation.source,
]);
- const onOpenKeyframeSettings = useCallback(() => {
- if (propStatus === null || !isKeyframedStatus(propStatus)) {
- return;
- }
-
- setSelectedModal({
- type: 'keyframe-settings',
- fileName: validatedLocation.source,
- nodePath,
- fieldKey: field.key,
- fieldLabel: field.description ?? field.key,
- status: propStatus,
- schema: field.effectSchema,
- effectIndex: field.effectIndex,
- });
- }, [
- field.description,
- field.effectIndex,
- field.effectSchema,
- field.key,
- nodePath,
- propStatus,
- setSelectedModal,
- validatedLocation.source,
- ]);
-
const contextMenuValues = useMemo((): ComboboxValue[] => {
- const values: ComboboxValue[] = [
+ return [
{
type: 'item',
id: 'reset-effect-field',
@@ -527,30 +499,7 @@ export const TimelineEffectPropItem: React.FC<{
value: 'reset-effect-field',
},
];
-
- if (propStatus !== null && isKeyframedStatus(propStatus)) {
- values.push({
- type: 'item',
- id: 'keyframe-settings-effect-field',
- keyHint: null,
- label: 'Keyframe settings...',
- leftItem: null,
- disabled: previewServerState.type !== 'connected',
- onClick: onOpenKeyframeSettings,
- quickSwitcherLabel: null,
- subMenu: null,
- value: 'keyframe-settings-effect-field',
- });
- }
-
- return values;
- }, [
- canShowReset,
- onOpenKeyframeSettings,
- onReset,
- previewServerState,
- propStatus,
- ]);
+ }, [canShowReset, onReset]);
const seekToDisplayFrame = useCallback(
(frame: number) => {
diff --git a/packages/studio/src/components/Timeline/TimelineSequencePropItem.tsx b/packages/studio/src/components/Timeline/TimelineSequencePropItem.tsx
index e4dab6d18b..4645808a11 100644
--- a/packages/studio/src/components/Timeline/TimelineSequencePropItem.tsx
+++ b/packages/studio/src/components/Timeline/TimelineSequencePropItem.tsx
@@ -16,7 +16,6 @@ import type {
TimelineFieldOnDragValueChange,
TimelineFieldOnSave,
} from '../../helpers/timeline-layout';
-import {ModalsContext} from '../../state/modals';
import {ContextMenu} from '../ContextMenu';
import type {ComboboxValue} from '../NewComposition/ComboBox';
import {callAddSequenceKeyframe} from './call-add-keyframe';
@@ -307,7 +306,6 @@ export const TimelineSequencePropItem: React.FC<{
);
const {setPropStatuses} = useContext(Internals.VisualModeSettersContext);
const {previewServerState} = useContext(StudioServerConnectionCtx);
- const {setSelectedModal} = useContext(ModalsContext);
const selection = useTimelineRowSelection(nodePathInfo);
const {selectItems} = useTimelineSelection();
const setFrame = Internals.useTimelineSetFrame();
@@ -424,33 +422,8 @@ export const TimelineSequencePropItem: React.FC<{
propStatus,
]);
- const onOpenKeyframeSettings = useCallback(() => {
- if (propStatus === null || !isKeyframedStatus(propStatus)) {
- return;
- }
-
- setSelectedModal({
- type: 'keyframe-settings',
- fileName: validatedLocation.source,
- nodePath,
- fieldKey: field.key,
- fieldLabel: field.description ?? field.key,
- status: propStatus,
- schema,
- effectIndex: null,
- });
- }, [
- propStatus,
- field.description,
- field.key,
- nodePath,
- schema,
- setSelectedModal,
- validatedLocation.source,
- ]);
-
const contextMenuValues = useMemo((): ComboboxValue[] => {
- const values: ComboboxValue[] = [
+ return [
{
type: 'item',
id: 'reset-sequence-field',
@@ -464,30 +437,7 @@ export const TimelineSequencePropItem: React.FC<{
value: 'reset-sequence-field',
},
];
-
- if (propStatus !== null && isKeyframedStatus(propStatus)) {
- values.push({
- type: 'item',
- id: 'keyframe-settings-sequence-field',
- keyHint: null,
- label: 'Keyframe settings...',
- leftItem: null,
- disabled: previewServerState.type !== 'connected',
- onClick: onOpenKeyframeSettings,
- quickSwitcherLabel: null,
- subMenu: null,
- value: 'keyframe-settings-sequence-field',
- });
- }
-
- return values;
- }, [
- canShowReset,
- propStatus,
- onOpenKeyframeSettings,
- onReset,
- previewServerState,
- ]);
+ }, [canShowReset, onReset]);
const seekToDisplayFrame = useCallback(
(frame: number) => {
diff --git a/packages/studio/src/state/modals.ts b/packages/studio/src/state/modals.ts
index 75c62bc71c..a307638637 100644
--- a/packages/studio/src/state/modals.ts
+++ b/packages/studio/src/state/modals.ts
@@ -27,7 +27,6 @@ import type {SequencePropsSubscriptionKey, _InternalTypes} from 'remotion';
import type {CompType} from '../components/NewComposition/DuplicateComposition';
import type {QuickSwitcherMode} from '../components/QuickSwitcher/NoResults';
import type {RenderType} from '../components/RenderModal/RenderModalAdvanced';
-import type {KeyframeSettingsModalState} from '../components/Timeline/KeyframeSettingsModal';
import type {Bug, UpdateInfo} from '../components/UpdateCheck';
export type WebRenderModalState = {
@@ -173,7 +172,6 @@ export type ModalState =
| {
type: 'input-props-override';
}
- | KeyframeSettingsModalState
| RenderModalState
| WebRenderModalState
| {