Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSonny Campbell <SonnyCampbell_Unity>2022-06-14 13:16:40 +0300
committerSybren A. Stüvel <sybren@blender.org>2022-06-14 13:29:56 +0300
commitd209629806aa8c3cd688082027ac5e8f6fefc206 (patch)
tree12b4c854157cd573f5d25bec5f2fc60cae1cf23a
parent28f4fc664fbf872e72cf8fb9b5b96394c2ff2dfc (diff)
Fix T85729: Crash when exporting for USD and Alembic
Ensure the "null" node graph, which is the root node of the export graph, always exists. The crash occured when "Use Settings For" was set to Render, "Visible Objects Only" was ticked, and a single parent object is in the scene but disabled for render. Because the only object attached to the root of the project was disabled for export, there was no "null" root node added to the export graph. This change will always add an empty "null" node with no children to the graph at the start. Other objects will get added to its children as required. Reviewed By: sybren Maniphest Tasks: T85729 Differential Revision: https://developer.blender.org/D15182
-rw-r--r--source/blender/io/common/intern/abstract_hierarchy_iterator.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/io/common/intern/abstract_hierarchy_iterator.cc b/source/blender/io/common/intern/abstract_hierarchy_iterator.cc
index 82bb1c57833..1fbddc45964 100644
--- a/source/blender/io/common/intern/abstract_hierarchy_iterator.cc
+++ b/source/blender/io/common/intern/abstract_hierarchy_iterator.cc
@@ -267,6 +267,11 @@ void AbstractHierarchyIterator::export_graph_construct()
{
Scene *scene = DEG_get_evaluated_scene(depsgraph_);
+ /* Add a "null" root node with no children immediately for the case where the top-most node in
+ * the scene is not being exported and a root node otherwise wouldn't get added. */
+ ExportGraph::key_type root_node_id = ObjectIdentifier::for_real_object(nullptr);
+ export_graph_[root_node_id] = ExportChildren();
+
DEG_OBJECT_ITER_BEGIN (depsgraph_,
object,
DEG_ITER_OBJECT_FLAG_LINKED_DIRECTLY |