stride3d/stride · error · NotSupportedException

The type IComputeCurve<

Error message

The type IComputeCurve<{typeof(TValue).Name}> is not supported by this editor.

What it means

CurveEditorViewModel.CurveFactory.CreateCurveHierarchy only supports IComputeCurve over float, Vector2, Vector3 and Vector4. If TValue is any other type (or the runtime object matches none of the checked interfaces), it throws NotSupportedException naming the unsupported IComputeCurve<TValue> type.

Solutions

  1. Use a supported curve value type: float, Vector2, Vector3 or Vector4
  2. Add a new branch in CreateCurveHierarchy plus the corresponding view models to support the new type
  3. Change the asset/animation to a supported curve type
  4. Convert the curve externally (e.g. sample into a Vector4-backed curve) before editing

Example fix

// before
CreateCurveHierarchy<Quaternion, ...>(quaternionCurve, parent, name); // unsupported
// after
CreateCurveHierarchy<Vector4, Vector4CurveViewModel, Vector4KeyFrameCurveViewModel>(vector4Curve, parent, name);
Defensive patterns

Strategy: type-guard

Validate before calling

var supported = computeCurve is IComputeCurve<float> or IComputeCurve<Vector2>
    or IComputeCurve<Vector3> or IComputeCurve<Vector4>;
if (!supported) return null; // or convert before editing

Type guard

bool IsSupportedCurve<TValue>(IComputeCurve<TValue> c) =>
    c is IComputeCurve<float> or IComputeCurve<Vector2>
    or IComputeCurve<Vector3> or IComputeCurve<Vector4>;

Try / catch

try { hierarchy = CreateCurveHierarchy(curve, parent, name); }
catch (NotSupportedException ex) { Log.Warning(ex, "Curve type not editable"); }

Prevention

When it happens

Trigger: Calling CreateCurveHierarchy<TValue> (directly or via CurveEditorViewModel.curve) with a TValue such as Quaternion, Color, bool, or a custom struct, or passing an object that implements IComputeCurve of an unsupported type.

Common situations: Binding a new animation curve type to the curve editor before adding editor support; changing a keyframe's type in an asset (e.g. float to Quaternion) and reopening the editor; plugin code creating curves of custom value types.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14). Data as JSON: /api/errors/c705e5f7d2b7321a. Report an issue: GitHub.

Appendix: source

Thrown at sources/editor/Stride.Assets.Presentation/CurveEditor/ViewModels/CurveEditorViewModel.CurveFactory.cs:51

                return CreateCurveHierarchy<float, FloatCurveViewModel, FloatKeyFrameCurveViewModel>(floatCurve, parent, name);

            var rotationCurve = computeCurve as IComputeCurve<Quaternion>;
            if (rotationCurve != null)
                return CreateCurveHierarchy<Quaternion, RotationCurveViewModel, RotationKeyFrameCurveViewModel>(rotationCurve, parent, name);

            var vector2Curve = computeCurve as IComputeCurve<Vector2>;
            if (vector2Curve != null)
                return CreateCurveHierarchy<Vector2, Vector2CurveViewModel, Vector2KeyFrameCurveViewModel>(vector2Curve, parent, name);

            var vector3Curve = computeCurve as IComputeCurve<Vector3>;
            if (vector3Curve != null)
                return CreateCurveHierarchy<Vector3, Vector3CurveViewModel, Vector3KeyFrameCurveViewModel>(vector3Curve, parent, name);

            var vector4Curve = computeCurve as IComputeCurve<Vector4>;
            if (vector4Curve != null)
                return CreateCurveHierarchy<Vector4, Vector4CurveViewModel, Vector4KeyFrameCurveViewModel>(vector4Curve, parent, name);

            throw new NotSupportedException($"The type IComputeCurve<{typeof(TValue).Name}> is not supported by this editor.");
        }

        /// <summary>
        /// Creates a hierarchy of curves to represent the given <paramref name="computeCurve"/>.
        /// </summary>
        /// <typeparam name="TValue">The data type of the curve.</typeparam>
        /// <typeparam name="TCurveViewModel">The type of a view model to display the curve.</typeparam>
        /// <typeparam name="TKeyFrameCurveViewModel">The type of a view model to display and edit the animation curve.</typeparam>
        /// <param name="computeCurve"></param>
        /// <param name="parent"></param>
        /// <param name="name"></param>
        /// <returns></returns>
        [NotNull]
        private CurveViewModelBase<TValue> CreateCurveHierarchy<TValue, TCurveViewModel, TKeyFrameCurveViewModel>([NotNull] IComputeCurve<TValue> computeCurve, CurveViewModelBase parent = null, string name = null)
            where TValue : struct
            where TCurveViewModel : CurveViewModelBase<TValue>
            where TKeyFrameCurveViewModel : CurveViewModelBase<TValue>
        {

View on GitHub (pinned to 96fad776d2)