{"record":{"id":"c688b7d849f352dd","repo":"bevyengine/bevy","slug":"missing-sampler-for-animation-0","errorCode":null,"errorMessage":"Missing sampler for animation {0}","messagePattern":"Missing sampler for animation (.+?)","errorType":"exception","errorClass":"GltfError","httpStatus":null,"severity":"error","filePath":"crates/bevy_gltf/src/loader/mod.rs","lineNumber":124,"sourceCode":"    InvalidBufferUri(String, ParseAssetPathError),\n    /// Invalid image mime type.\n    #[error(\"invalid image mime type: {0}\")]\n    #[from(ignore)]\n    InvalidImageMimeType(String),\n    /// Error when loading a texture. Might be due to a disabled image file format feature.\n    #[error(\"You may need to add the feature for the file format: {0}\")]\n    ImageError(#[from] TextureError),\n    /// The image URI was unable to be resolved with respect to the asset path.\n    #[error(\"invalid image uri: {0}. asset path error={1}\")]\n    InvalidImageUri(String, ParseAssetPathError),\n    /// Failed to read bytes from an asset path.\n    #[error(\"failed to read bytes from an asset path: {0}\")]\n    ReadAssetBytesError(#[from] ReadAssetBytesError),\n    /// Failed to load asset from an asset path.\n    #[error(\"failed to load asset from an asset path: {0}\")]\n    AssetLoadError(#[from] AssetLoadError),\n    /// Missing sampler for an animation.\n    #[error(\"Missing sampler for animation {0}\")]\n    #[from(ignore)]\n    MissingAnimationSampler(usize),\n    /// Failed to generate tangents.\n    #[error(\"failed to generate tangents: {0}\")]\n    GenerateTangentsError(#[from] bevy_mesh::GenerateTangentsError),\n    /// Failed to generate morph targets.\n    #[error(\"failed to generate morph targets: {0}\")]\n    MorphTarget(#[from] bevy_mesh::morph::MorphBuildError),\n    /// Circular children in Nodes\n    #[error(\"GLTF model must be a tree, found cycle instead at node indices: {0:?}\")]\n    #[from(ignore)]\n    CircularChildren(String),\n    /// Failed to load a file.\n    #[error(\"failed to load file: {0}\")]\n    Io(#[from] Error),\n}\n\n/// Loads glTF files with all of their data as their corresponding bevy representations.","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_gltf/src/loader/mod.rs#L106-L142","documentation":"Raised while building AnimationClips (feature bevy_animation) when an animation channel's reader produces no sampler input: reader.read_inputs() returns None, so the keyframe timestamps cannot be read, and GltfError::MissingAnimationSampler(animation.index()) is returned at loader/mod.rs:340 (and again at 561 for the named-animation pass). Concretely the channel's sampler 'input' accessor is missing or unreadable from the loaded buffer data.","triggerScenarios":"Animation JSON whose sampler.input points to a nonexistent accessor index, an input accessor whose buffer data could not be loaded, or exporters emitting empty sampler inputs. (Distinct from sparse inputs, which only warn and skip at mod.rs:333-336.)","commonSituations":"Hand-written or procedurally generated animations, broken shape-key/mocap exporters, models whose animation buffers were stripped during optimization.","solutions":["Validate the file with gltf-validator and fix/re-export the animation track it flags.","Delete the offending animation in a DCC if it is unused.","Load with animations disabled via GltfLoaderSettings { load_animations: false } to get the mesh while you repair the clip.","Ensure animation buffer data ships with the model (no missing .bin)."],"exampleFix":"// (before)\nlet h = asset_server.load(\"models/rigged.gltf\");\n// (after) skip the broken clip, keep the mesh\nlet h = asset_server.load_with_settings(\n    \"models/rigged.gltf\",\n    |s: &mut GltfLoaderSettings| s.load_animations = false,\n);","handlingStrategy":"validation","validationCode":"fn animations_have_inputs(path: &std::path::Path) -> bool {\n    let (doc, mut blob, _) = gltf::import(path).unwrap();\n    let data = blob.drain(..).map(Vec::from).collect::<Vec<_>>();\n    doc.animations().all(|a| a.channels().all(|c| {\n        c.reader(|b| data.get(b.index()).map(|v| v.as_slice()))\n            .read_inputs().is_some()\n    }))\n}","typeGuard":null,"tryCatchPattern":"match err {\n    GltfError::MissingAnimationSampler(idx) => {\n        warn!(\"animation {idx} has no sampler input; load with load_animations = false until fixed\");\n    }\n    other => return Err(other.into()),\n}","preventionTips":["Validate animations with gltf-validator before import.","Strip unused animation tracks at export.","Know the escape hatch: GltfLoaderSettings::load_animations = false."],"tags":["gltf","animation","sampler","bevy"],"backgroundTag":"gltf-missing-animation-sampler","analyzedSha":"396ca727080776bd313bb892423b7d94e03b81b4","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}