Repository: bevyengine/bevy
File: crates/bevy_gltf/src/loader/mod.rs (Rust)

Code before:
    /// If empty, the gltf mesh nodes will be skipped.
    ///
    /// Otherwise, nodes will be loaded and retained in RAM/VRAM according to the active flags.
    pub load_meshes: RenderAssetUsages,
    /// If empty, the gltf materials will be skipped.
    ///
    /// Otherwise, materials will be loaded and retained in RAM/VRAM according to the active flags.
    pub load_materials: RenderAssetUsages,
    /// If true, the loader will spawn cameras for gltf camera nodes.
    pub load_cameras: bool,
    /// If true, the loader will spawn lights for gltf light nodes.
    pub load_lights: bool,
    /// If true, the loader will load `AnimationClip` assets, and also add
    /// `AnimationTarget` and `AnimationPlayer` components to hierarchies
    /// affected by animation. Requires the `bevy_animation` feature.
    pub load_animations: bool,
    /// If true, the loader will include the root of the gltf root node.
    pub include_source: bool,
    /// Overrides the default sampler. Data from sampler node is added on top of that.
    ///
    /// If None, uses the global default which is stored in the [`DefaultGltfImageSampler`](crate::DefaultGltfImageSampler) resource.
    pub default_sampler: Option<ImageSamplerDescriptor>,
    /// If true, the loader will ignore sampler data from gltf and use the default sampler.
    pub override_sampler: bool,
    /// If true, the loader will load gltf json without validation, for unsupported extension it will ignore validation check.
    pub gltf_without_validation: bool,
    /// Overrides the default glTF coordinate conversion setting.
    ///
    /// If `None`, uses the global default set by [`GltfPlugin::convert_coordinates`](crate::GltfPlugin::convert_coordinates).
    pub convert_coordinates: Option<GltfConvertCoordinates>,
    /// Optionally overrides [`GltfPlugin::skinned_mesh_bounds_policy`](crate::GltfPlugin).
    pub skinned_mesh_bounds_policy: Option<GltfSkinnedMeshBoundsPolicy>,
}

impl Default for GltfLoaderSettings {
    fn default() -> Self {
        Self {
            load_meshes: RenderAssetUsages::default(),
            load_materials: RenderAssetUsages::default(),
            load_cameras: true,
            load_lights: true,
            load_animations: true,
            include_source: false,
            default_sampler: None,
            override_sampler: false,
            gltf_without_validation: false,
            convert_coordinates: None,
            skinned_mesh_bounds_policy: None,
        }
    }
}

Review comment (suggestion):
I'm not against this as a superuser config flag, but would like to know which validation error were you running into that required it here so we can document why someone would need to use it.

Code after:
    /// If empty, the gltf mesh nodes will be skipped.
    ///
    /// Otherwise, nodes will be loaded and retained in RAM/VRAM according to the active flags.
    pub load_meshes: RenderAssetUsages,
    /// If empty, the gltf materials will be skipped.
    ///
    /// Otherwise, materials will be loaded and retained in RAM/VRAM according to the active flags.
    pub load_materials: RenderAssetUsages,
    /// If true, the loader will spawn cameras for gltf camera nodes.
    pub load_cameras: bool,
    /// If true, the loader will spawn lights for gltf light nodes.
    pub load_lights: bool,
    /// If true, the loader will load `AnimationClip` assets, and also add
    /// `AnimationTarget` and `AnimationPlayer` components to hierarchies
    /// affected by animation. Requires the `bevy_animation` feature.
    pub load_animations: bool,
    /// If true, the loader will include the root of the gltf root node.
    pub include_source: bool,
    /// Overrides the default sampler. Data from sampler node is added on top of that.
    ///
    /// If None, uses the global default which is stored in the [`DefaultGltfImageSampler`](crate::DefaultGltfImageSampler) resource.
    pub default_sampler: Option<ImageSamplerDescriptor>,
    /// If true, the loader will ignore sampler data from gltf and use the default sampler.
    pub override_sampler: bool,
    /// If false, the loader will load gltf json without validation, for unsupported extension it will ignore validation check.
    pub validate: bool,
    /// Overrides the default glTF coordinate conversion setting.
    ///
    /// If `None`, uses the global default set by [`GltfPlugin::convert_coordinates`](crate::GltfPlugin::convert_coordinates).
    pub convert_coordinates: Option<GltfConvertCoordinates>,
    /// Optionally overrides [`GltfPlugin::skinned_mesh_bounds_policy`](crate::GltfPlugin).
    pub skinned_mesh_bounds_policy: Option<GltfSkinnedMeshBoundsPolicy>,
}

impl Default for GltfLoaderSettings {
    fn default() -> Self {
        Self {
            load_meshes: RenderAssetUsages::default(),
            load_materials: RenderAssetUsages::default(),
            load_cameras: true,
            load_lights: true,
            load_animations: true,
            include_source: false,
            default_sampler: None,
            override_sampler: false,
            validate: true,
            convert_coordinates: None,
            skinned_mesh_bounds_policy: None,
        }
    }
}