{"record":{"id":"7e429de3504b10f4","repo":"stride3d/stride","slug":"animation-1-is-not-set","errorCode":null,"errorMessage":"Animation 1 is not set","messagePattern":"Animation 1 is not set","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"sources/editor/Stride.Assets.Presentation/Templates/Assets/Scripts/Animation/AnimationBlend.cs","lineNumber":42,"sourceCode":"    [Display(\"Blend Lerp\")]\n    public float BlendLerp = 0.5f;\n\n    [Display(\"Time Scale\")]\n    public double TimeFactor = 1;\n\n    private AnimationClipEvaluator anim1Evaluator;\n    private AnimationClipEvaluator anim2Evaluator;\n    private double currentTime = 0;\n\n    public override void Start()\n    {\n        base.Start();\n\n        if (AnimationComponent == null)\n            throw new InvalidOperationException(\"The animation component is not set\");\n\n        if (Animation1 == null)\n            throw new InvalidOperationException(\"Animation 1 is not set\");\n\n        if (Animation2 == null)\n            throw new InvalidOperationException(\"Animation 2 is not set\");\n\n        AnimationComponent.BlendTreeBuilder = this;\n\n        anim1Evaluator = AnimationComponent.Blender.CreateEvaluator(Animation1);\n        anim2Evaluator = AnimationComponent.Blender.CreateEvaluator(Animation2);\n    }\n\n    public override void Cancel()\n    {\n        AnimationComponent.Blender.ReleaseEvaluator(anim1Evaluator);\n        AnimationComponent.Blender.ReleaseEvaluator(anim2Evaluator);\n    }\n\n    public override void Update()\n    {","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/editor/Stride.Assets.Presentation/Templates/Assets/Scripts/Animation/AnimationBlend.cs#L24-L60","documentation":"AnimationBlend.Start() checks its two required animation inputs after validating AnimationComponent. If Animation1 is null the blend tree cannot be built and the script throws InvalidOperationException at startup.","triggerScenarios":"Running a scene with the AnimationBlend script where the Animation1 property (first AnimationClip) was never assigned in the editor Property Grid or via code.","commonSituations":"Dropping the blend script onto an entity and assigning only one of the two clips; forgetting to reassign Animation1 after renaming/deleting an animation asset.","solutions":["Assign an AnimationClip to the script's Animation1 property in the editor","Set Animation1 in code before Start, e.g. Blend.Animation1 = myClip","Verify the referenced animation asset still exists and is imported correctly"],"exampleFix":"// before\nnew AnimationBlend { AnimationComponent = anim, Animation2 = clip2 };\n// after\nnew AnimationBlend { AnimationComponent = anim, Animation1 = clip1, Animation2 = clip2 };","handlingStrategy":"type-guard","validationCode":"if (blend.Animation1 == null) blend.Animation1 = defaultClip; // assign before scene runs","typeGuard":"bool ReadyToBlend(AnimationBlend b) => b.AnimationComponent != null && b.Animation1 != null && b.Animation2 != null;","tryCatchPattern":"try { scene.Run(); }\ncatch (InvalidOperationException ex) when (ex.Message == \"Animation 1 is not set\") { // fix asset reference and restart\n}","preventionTips":["Assign both Animation1 and Animation2 immediately when adding the script","Check the referenced animation assets still exist after asset moves/renames","Prefer assigning clips in code where references are compile-checked by asset ids"],"tags":["stride","animation","script"],"backgroundTag":"null-argument","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"}