{"record":{"id":"a222db082a41db90","repo":"FyroxEngine/Fyrox","slug":"failed-to-load-brush-tool-data-due-to-err","errorCode":null,"errorMessage":"Failed to load brush tool data due to: {err}","messagePattern":"Failed to load brush tool data due to: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"fyrox-impl/src/scene/tilemap/brush.rs","lineNumber":146,"sourceCode":"\n/// Custom Visit implementation to prevent the visit from completely failing if\n/// it encounters data that cannot be visited.\nimpl Visit for BrushMacroInstanceList {\n    fn visit(&mut self, name: &str, visitor: &mut Visitor) -> VisitResult {\n        let mut region = visitor.enter_region(name)?;\n\n        let mut count = self.0.len() as u32;\n        count.visit(\"Count\", &mut region)?;\n\n        if region.is_reading() {\n            self.clear();\n            for i in 0..(count as usize) {\n                let name = i.to_string();\n                // If one value fails to read, skip it and read the remaining data.\n                let mut value = BrushMacroData::default();\n                match value.visit(&name, &mut region) {\n                    Ok(()) => self.0.push(value),\n                    Err(err) => Log::err(format!(\"Failed to load brush tool data due to: {err}\")),\n                }\n            }\n        } else {\n            for (i, value) in self.0.iter_mut().enumerate() {\n                let name = i.to_string();\n                value.visit(&name, &mut region)?;\n            }\n        }\n\n        Ok(())\n    }\n}\n\n/// A brush can have zero or more instances of a macro, and each instance\n/// has its own configuration data.\n#[derive(Debug, Default, Clone, Visit, PartialEq, Reflect)]\n#[reflect(type_uuid = \"3aa87ac2-c05f-4e9b-86eb-ee846a364585\")]\npub struct BrushMacroData {","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/FyroxEngine/Fyrox/blob/76c91aad8eca488ce527b1af707be8b3b24ad72d/fyrox-impl/src/scene/tilemap/brush.rs#L128-L164","documentation":"While deserializing a TileBrush's macro data, one BrushMacroData value failed to read from the region. The library logs the error and skips that value, continuing to read the remaining data, so a brush loads with potentially missing macro entries.","triggerScenarios":"Loading a scene/resource containing a TileBrush whose saved macro data count does not match readable entries — e.g. a version format change or corrupted brush data.","commonSituations":"Opening a scene saved by a different Fyrox version with a different brush macro layout; hand-edited or corrupted brush resources.","solutions":["Re-save the brush/tile map in the current editor version to regenerate compatible data.","Check the logged error text for the specific field that failed to read.","Update the Fyrox version on the side that produced the resource so formats match.","If data was hand-edited, restore it and edit through the editor API instead."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// the library already catches per-entry failures; react afterwards\nif brush_macros.len() < expected_count {\n    Log::warn(\"some brush macros failed to load, re-saving brush recommended\");\n}","preventionTips":["Re-save brushes after upgrading Fyrox versions.","Avoid hand-editing serialized brush data.","Keep scene files in version control to detect corruption early."],"tags":["fyrox","tilemap","brush","deserialization"],"backgroundTag":"json-unmarshal-failed","analyzedSha":"76c91aad8eca488ce527b1af707be8b3b24ad72d","analyzedAt":"2026-09-10T16:04:01.633Z","contentChangedAt":"2026-09-10T16:04:01.633Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}