{"record":{"id":"c705e5f7d2b7321a","repo":"stride3d/stride","slug":"the-type-icomputecurve-typeof-tvalue-name-is-not-supported","errorCode":null,"errorMessage":"The type IComputeCurve<{typeof(TValue).Name}> is not supported by this editor.","messagePattern":"The type IComputeCurve<(.+?)> is not supported by this editor\\.","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"sources/editor/Stride.Assets.Presentation/CurveEditor/ViewModels/CurveEditorViewModel.CurveFactory.cs","lineNumber":51,"sourceCode":"                return CreateCurveHierarchy<float, FloatCurveViewModel, FloatKeyFrameCurveViewModel>(floatCurve, parent, name);\n\n            var rotationCurve = computeCurve as IComputeCurve<Quaternion>;\n            if (rotationCurve != null)\n                return CreateCurveHierarchy<Quaternion, RotationCurveViewModel, RotationKeyFrameCurveViewModel>(rotationCurve, parent, name);\n\n            var vector2Curve = computeCurve as IComputeCurve<Vector2>;\n            if (vector2Curve != null)\n                return CreateCurveHierarchy<Vector2, Vector2CurveViewModel, Vector2KeyFrameCurveViewModel>(vector2Curve, parent, name);\n\n            var vector3Curve = computeCurve as IComputeCurve<Vector3>;\n            if (vector3Curve != null)\n                return CreateCurveHierarchy<Vector3, Vector3CurveViewModel, Vector3KeyFrameCurveViewModel>(vector3Curve, parent, name);\n\n            var vector4Curve = computeCurve as IComputeCurve<Vector4>;\n            if (vector4Curve != null)\n                return CreateCurveHierarchy<Vector4, Vector4CurveViewModel, Vector4KeyFrameCurveViewModel>(vector4Curve, parent, name);\n\n            throw new NotSupportedException($\"The type IComputeCurve<{typeof(TValue).Name}> is not supported by this editor.\");\n        }\n\n        /// <summary>\n        /// Creates a hierarchy of curves to represent the given <paramref name=\"computeCurve\"/>.\n        /// </summary>\n        /// <typeparam name=\"TValue\">The data type of the curve.</typeparam>\n        /// <typeparam name=\"TCurveViewModel\">The type of a view model to display the curve.</typeparam>\n        /// <typeparam name=\"TKeyFrameCurveViewModel\">The type of a view model to display and edit the animation curve.</typeparam>\n        /// <param name=\"computeCurve\"></param>\n        /// <param name=\"parent\"></param>\n        /// <param name=\"name\"></param>\n        /// <returns></returns>\n        [NotNull]\n        private CurveViewModelBase<TValue> CreateCurveHierarchy<TValue, TCurveViewModel, TKeyFrameCurveViewModel>([NotNull] IComputeCurve<TValue> computeCurve, CurveViewModelBase parent = null, string name = null)\n            where TValue : struct\n            where TCurveViewModel : CurveViewModelBase<TValue>\n            where TKeyFrameCurveViewModel : CurveViewModelBase<TValue>\n        {","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/editor/Stride.Assets.Presentation/CurveEditor/ViewModels/CurveEditorViewModel.CurveFactory.cs#L33-L69","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Use a supported curve value type: float, Vector2, Vector3 or Vector4","Add a new branch in CreateCurveHierarchy plus the corresponding view models to support the new type","Change the asset/animation to a supported curve type","Convert the curve externally (e.g. sample into a Vector4-backed curve) before editing"],"exampleFix":"// before\nCreateCurveHierarchy<Quaternion, ...>(quaternionCurve, parent, name); // unsupported\n// after\nCreateCurveHierarchy<Vector4, Vector4CurveViewModel, Vector4KeyFrameCurveViewModel>(vector4Curve, parent, name);","handlingStrategy":"type-guard","validationCode":"var supported = computeCurve is IComputeCurve<float> or IComputeCurve<Vector2>\n    or IComputeCurve<Vector3> or IComputeCurve<Vector4>;\nif (!supported) return null; // or convert before editing","typeGuard":"bool IsSupportedCurve<TValue>(IComputeCurve<TValue> c) =>\n    c is IComputeCurve<float> or IComputeCurve<Vector2>\n    or IComputeCurve<Vector3> or IComputeCurve<Vector4>;","tryCatchPattern":"try { hierarchy = CreateCurveHierarchy(curve, parent, name); }\ncatch (NotSupportedException ex) { Log.Warning(ex, \"Curve type not editable\"); }","preventionTips":["Restrict curve asset types to float/Vector2/Vector3/Vector4","Add editor support (factory branch + view models) when introducing new curve value types","Check the curve type before opening the curve editor on user assets"],"tags":["not-supported-exception","curve-editor","curve-factory"],"backgroundTag":"unsupported-operation","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}