{"record":{"id":"f3f06c6a03bd6600","repo":"stride3d/stride","slug":"blendoperation","errorCode":null,"errorMessage":"blendOperation","messagePattern":"blendOperation","errorType":"exception","errorClass":"ArgumentOutOfRangeException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Engine/Animations/AnimationBlender.cs","lineNumber":286,"sourceCode":"                                    Vector3 rightValue3;\n                                    Vector3.Subtract(ref *(Vector3*)sourceLeftData, ref *(Vector3*)sourceRightData, out rightValue3);\n                                    Vector3.Lerp(ref *(Vector3*)sourceLeftData, ref rightValue3, blendFactor, out *(Vector3*)resultData);\n                                    break;\n                                case BlendType.Quaternion:\n                                    Quaternion rightValueQ;\n                                    // blend between left (0.0) and left * conjugate(right) (1.0)\n                                    Quaternion.Invert(ref *(Quaternion*)sourceRightData, out rightValueQ);\n                                    Quaternion.Multiply(ref rightValueQ, ref *(Quaternion*)sourceLeftData, out rightValueQ);\n                                    Quaternion.Normalize(ref rightValueQ, out rightValueQ);\n                                    //throw new NotImplementedException();\n                                    Quaternion.Slerp(ref *(Quaternion*)sourceLeftData, ref rightValueQ, blendFactor, out *(Quaternion*)resultData);\n                                    break;\n                                default:\n                                    throw new ArgumentOutOfRangeException();\n                            }\n                            break;\n                        default:\n                            throw new ArgumentOutOfRangeException(\"blendOperation\");\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Computes the specified animation operations.\n        /// </summary>\n        /// <param name=\"animationOperations\">The animation operations to perform.</param>\n        /// <param name=\"result\">The optional result (if not null, it expects the final stack to end up with this element).</param>\n        public void Compute(List<AnimationOperation> animationOperations, ref AnimationClipResult result)\n        {\n            // Clear animation stack\n            animationStack.Clear();\n\n            // Apply first operation (should be a push), directly into result (considered first item in the stack)\n            var animationOperation0 = animationOperations[0];\n","sourceCodeStart":268,"sourceCodeEnd":304,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Engine/Animations/AnimationBlender.cs#L268-L304","documentation":"AnimationBlender's operation-processing switch handles a fixed set of blend operations; the default branch throws ArgumentOutOfRangeException(\"blendOperation\") when the blend operation enum value is outside the known set. It is a guard against corrupt or newer-version animation operation data the blender cannot interpret.","triggerScenarios":"ComputeAnimationBlending (or the inner operation loop) encounters an AnimationOperation/blendOperation value not covered by the switch cases at AnimationBlender.cs:286 — i.e. an undefined or out-of-range enum value.","commonSituations":"Deserializing animation blend data saved by a newer Stride version with added enum members; corrupted or hand-edited animation assets; a new BinaryCurveOperator/blend operation added upstream without updating this switch.","solutions":["Inspect the asset producing the animation operations and fix/remove the invalid blend operation value.","Re-save/reimport the animation asset with the current Stride version.","Extend the switch in AnimationBlender to handle the new enum member if you added one.","Ensure editor and runtime Stride versions match so serialized enum values are valid."],"exampleFix":"// before\ndefault:\n    throw new ArgumentOutOfRangeException(\"blendOperation\");\n\n// after (graceful fallback)\ndefault:\n    blendOperation = BlendOperation.LinearBlend; // safe default\n    break;","handlingStrategy":"validation","validationCode":"// Validate blend operation before building animation operations\nif (!Enum.IsDefined(typeof(MyBlendOperation), blendOperation))\n    throw new InvalidOperationException($\"Unknown blend operation: {blendOperation}\");","typeGuard":"bool IsValidBlendOperation(object op) => op is Enum e && Enum.IsDefined(e.GetType(), e);","tryCatchPattern":"try { blender.ComputeAnimationBlending(ops, ref result); }\ncatch (ArgumentOutOfRangeException ex) when (ex.ParamName == \"blendOperation\") { /* reimport asset / use default blend */ }","preventionTips":["Reimport animation assets after Stride upgrades","Never cast raw ints to blend-operation enums without Enum.IsDefined","Add switch cases for every new enum member you introduce"],"tags":["animation","enum","argument-out-of-range","blending"],"backgroundTag":"argument-out-of-range","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"}