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:
authorSybren A. Stüvel <sybren@blender.org>2020-05-08 12:59:08 +0300
committerSybren A. Stüvel <sybren@blender.org>2020-05-08 13:26:25 +0300
commitd9a9e64e8cb0b7c15fc310dc0f286f593f7c5801 (patch)
tree7376f2578a44faa1256f4a797d6f417e588da989 /source/blender/io/usd/intern/abstract_hierarchy_iterator.h
parent163a48f2035bbb40e6d437c7522f587d690456f6 (diff)
Cleanup: USD, refactored export graph construction
The construction of the export graph is now split into a few steps: - Construct a `HierarchyContext` object for the to-be-exported object. - Determine the graph index, i.e. the export-parent and the duplicator. - Update the `HierarchyContext` object for this graph index. This allows the upcoming new Alembic exporter to override the location of an object in the export graph, in order to support "flattened" exports. Aside from that, this also simply makes the code cleaner. No functional changes.
Diffstat (limited to 'source/blender/io/usd/intern/abstract_hierarchy_iterator.h')
-rw-r--r--source/blender/io/usd/intern/abstract_hierarchy_iterator.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/io/usd/intern/abstract_hierarchy_iterator.h b/source/blender/io/usd/intern/abstract_hierarchy_iterator.h
index 08b50e2560d..295430d903f 100644
--- a/source/blender/io/usd/intern/abstract_hierarchy_iterator.h
+++ b/source/blender/io/usd/intern/abstract_hierarchy_iterator.h
@@ -56,7 +56,7 @@ class AbstractHierarchyWriter;
* struct contains everything necessary to export a single object to a file. */
struct HierarchyContext {
/*********** Determined during hierarchy iteration: ***************/
- Object *object;
+ Object *object; /* Evaluated object. */
Object *export_parent;
Object *duplicator;
float matrix_world[4][4];
@@ -188,6 +188,8 @@ class AbstractHierarchyIterator {
const std::set<Object *> &dupli_set);
ExportChildren &graph_children(const HierarchyContext *parent_context);
+ void context_update_for_graph_index(HierarchyContext *context,
+ const ExportGraph::key_type &graph_index) const;
void determine_export_paths(const HierarchyContext *parent_context);
void determine_duplication_references(const HierarchyContext *parent_context,
@@ -233,6 +235,10 @@ class AbstractHierarchyIterator {
virtual bool should_visit_dupli_object(const DupliObject *dupli_object) const;
+ virtual ExportGraph::key_type determine_graph_index_object(const HierarchyContext *context);
+ virtual ExportGraph::key_type determine_graph_index_dupli(const HierarchyContext *context,
+ const std::set<Object *> &dupli_set);
+
/* These functions should create an AbstractHierarchyWriter subclass instance, or return
* nullptr if the object or its data should not be exported. Returning a nullptr for
* data/hair/particle will NOT prevent the transform to be written.