{"record":{"id":"43526d129c4e5a67","repo":"FyroxEngine/Fyrox","slug":"node-and-its-children-will-be-deleted","errorCode":null,"errorMessage":"Node {} ({}:{}) and its children will be deleted, because it does not exist in the parent asset!","messagePattern":"Node (.+?) \\((.+?):(.+?)\\) and its children will be deleted, because it does not exist in the parent asset!","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"fyrox-graph/src/lib.rs","lineNumber":1237,"sourceCode":"            })\n            .collect::<Vec<_>>();\n\n        let instance_count = instances.len();\n        let mut restored_count = 0;\n\n        for (instance_root, resource) in instances.iter().cloned() {\n            // Step 1. Find and remove orphaned nodes.\n            let mut nodes_to_delete = Vec::new();\n            for (_, node) in self.traverse_iter(instance_root) {\n                if let Some(resource) = node.resource() {\n                    if let Some(model) = resource.state().data() {\n                        if !model\n                            .graph()\n                            .is_valid_handle(node.original_handle_in_resource())\n                        {\n                            nodes_to_delete.push(node.self_handle());\n\n                            Log::warn(format!(\n                                \"Node {} ({}:{}) and its children will be deleted, because it \\\n                    does not exist in the parent asset!\",\n                                node.name(),\n                                node.self_handle().index(),\n                                node.self_handle().generation(),\n                            ))\n                        }\n                    } else {\n                        Log::warn(format!(\n                            \"Node {} ({}:{}) and its children will be deleted, because its \\\n                    parent asset failed to load!\",\n                            node.name(),\n                            node.self_handle().index(),\n                            node.self_handle().generation(),\n                        ))\n                    }\n                }\n            }","sourceCodeStart":1219,"sourceCodeEnd":1255,"githubUrl":"https://github.com/FyroxEngine/Fyrox/blob/76c91aad8eca488ce527b1af707be8b3b24ad72d/fyrox-graph/src/lib.rs#L1219-L1255","documentation":"During restore_integrity, instance nodes are checked against the parent resource: if a node's original handle is no longer valid in the resource's graph (node was deleted there), the node and all its children cannot be synchronized and are queued for deletion with this warning. This keeps instances consistent with their source asset.","triggerScenarios":"restore_integrity (called on scene sync / resource reload) encounters an instance node whose original_handle_in_resource() is invalid — the corresponding node was removed from the prefab after the instance was created.","commonSituations":"Editing a prefab in the editor and deleting a node that a scene instance uses; loading an older scene against a newer prefab; version-control merge changed the prefab.","solutions":["Accept the deletion (intended behavior) and re-add the node in the parent prefab if it was removed accidentally.","Restore the deleted node in the parent resource so the instance keeps its subtree.","Update the scene instance by re-instantiating the prefab and reapplying your overrides.","Check prefab file history to find which node disappeared and why."],"exampleFix":"// before\n// prefab.toml: node 12 removed, but scene still references original handle 12:0\n// after\n// re-add node 12 in the prefab, or re-instantiate:\nlet handle = resource.data_ref().instantiate(graph);","handlingStrategy":"validation","validationCode":"// detect orphaned instance nodes before sync deletes them\nfn orphans(instance: &SceneResourceInstance, res: &Model) -> Vec<Handle<Node>> {\n    instance.nodes()\n        .filter(|n| !res.data_ref().graph().is_valid_handle(n.original_handle_in_resource()))\n        .map(|n| n.self_handle())\n        .collect()\n}","typeGuard":null,"tryCatchPattern":"let doomed = orphans(&instance, &resource);\nif !doomed.is_empty() {\n    log::warn!(\"nodes {:?} will be deleted on sync; re-add them in the prefab first\", doomed);\n}","preventionTips":["Don't delete prefab nodes that scene instances depend on without checking usages","Search the project for instance references before removing prefab nodes","Keep prefab edits and scene updates in the same commit","Back up scenes before large prefab refactors"],"tags":["graph","prefab","sync","resource"],"backgroundTag":"node-missing-in-parent-asset","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"}