From ecdc60b231cfb6b82ef9c9f7e344c1eb9590caa1 Mon Sep 17 00:00:00 2001 From: Petru Conduraru Date: Sun, 19 Jul 2026 21:29:19 +0300 Subject: [PATCH] GltfSerializer: name hierarchy group nodes after their own element With --element-hierarchy, the intermediate nodes representing spatial structure (storey, building, site) were all named after whichever leaf element triggered their creation, instead of their own entity. Use the ancestor element at the current tree level, so --use-element-guids and default naming both identify group nodes correctly. Generated with the assistance of an AI coding tool. --- src/serializers/GltfSerializer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/serializers/GltfSerializer.cpp b/src/serializers/GltfSerializer.cpp index adc5b0961f..bce50bc11a 100644 --- a/src/serializers/GltfSerializer.cpp +++ b/src/serializers/GltfSerializer.cpp @@ -249,7 +249,7 @@ void GltfSerializer::write(const IfcGeom::TriangulationElement* o) { size_t new_node_index = json_["nodes"].size(); node_indices_[(*it)->product()] = new_node_index; node_array_.push_back(new_node_index); - parent_node["name"] = object_id(o); + parent_node["name"] = object_id(*it); parent_node["children"] = json::array({current_node_index}); json_["nodes"].push_back(parent_node);