OverviewFilesCommitsIssuesDocsReleasesPeers

proc-nodes commits / fcc56da

scene: adopt the MeshOutput a published scene already carries
ProcGeometryNode builds its output children at runtime and gives them to nobody, which is why a saved scene does not carry the millions of vertices they hold — the right default for a live view. A PUBLISHED scene is the opposite case. blender-bridge now writes the baked mesh as a .res beside the scene and gives MeshOutput an owner so it is packed, precisely so the file opens without proc-nodes and without a bake. Creating a second MeshOutput on _ready would leave that baked mesh on a node nothing draws into, and the next evaluation writing into a stranger beside it. ⚠ Godot renames a clashing sibling, so the duplicate is called "MeshOutput2" — the gate that first covered this counted by NAME and reported "exactly one" with the bug present. It counts MeshInstance3D children of the ProcGeometryNode now, and goes 2 when this adoption is removed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
fcc56dab44e59ca8f84148939179075ea87a8466
by plankatron <fleeky@gmail.com> · 2026-09-09T22:15:07.000Z

Changed files (1) +15 -0

src/scene/proc_geometry_node.cpp +15 -0
……@@ -225,11 +225,26 @@ void ProcGeometryNode::set_graph(const Ref<ProcNodeGraph> &p_graph) {
225225}
226226
227227void ProcGeometryNode::_ensure_children() {
228 // ⛔ ADOPT THE ONE THAT IS ALREADY THERE.
229 //
230 // These children are built at runtime and, in a live session, belong to
231 // nobody -- which is why a saved scene does not carry the millions of
232 // vertices they hold. A PUBLISHED scene is the opposite case: it carries
233 // MeshOutput on purpose, with the baked mesh beside it, so that opening it
234 // needs neither this graph nor a bake. Creating a second one on _ready
235 // would leave the baked mesh on a node nothing draws into and the next
236 // evaluation writing into a stranger next to it.
237 if (mesh_output == nullptr) {
238 mesh_output = Object::cast_to<MeshInstance3D>(get_node_or_null(NodePath("MeshOutput")));
239 }
228240 if (mesh_output == nullptr) {
229241 mesh_output = memnew(MeshInstance3D);
230242 mesh_output->set_name("MeshOutput");
231243 add_child(mesh_output);
232244 }
245 if (multimesh_output == nullptr) {
246 multimesh_output = Object::cast_to<MultiMeshInstance3D>(get_node_or_null(NodePath("MultiMeshOutput")));
247 }
233248 if (multimesh_output == nullptr) {
234249 multimesh_output = memnew(MultiMeshInstance3D);
235250 multimesh_output->set_name("MultiMeshOutput");