diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-05-08 14:42:46 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-05-08 16:10:28 +0300 |
commit | d931981d24f80ab3bbf50f25935bba0b6b044d5f (patch) | |
tree | 47c6c9d780a8246e825e101525310ee42794d25c | |
parent | f9d9bf41f6bf48866b4da0f85782db2f757a2633 (diff) |
Cleanup: USD, added some clarifying comments
No functional changes.
-rw-r--r-- | source/blender/io/usd/intern/abstract_hierarchy_iterator.cc | 1 | ||||
-rw-r--r-- | source/blender/io/usd/intern/abstract_hierarchy_iterator.h | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/io/usd/intern/abstract_hierarchy_iterator.cc b/source/blender/io/usd/intern/abstract_hierarchy_iterator.cc index 3c7a86b2c34..060a65a68eb 100644 --- a/source/blender/io/usd/intern/abstract_hierarchy_iterator.cc +++ b/source/blender/io/usd/intern/abstract_hierarchy_iterator.cc @@ -508,6 +508,7 @@ void AbstractHierarchyIterator::make_writers(const HierarchyContext *parent_cont } for (HierarchyContext *context : graph_children(parent_context)) { + // Update the context so that it is correct for this parent-child relation. copy_m4_m4(context->parent_matrix_inv_world, parent_matrix_inv_world); // Get or create the transform writer. diff --git a/source/blender/io/usd/intern/abstract_hierarchy_iterator.h b/source/blender/io/usd/intern/abstract_hierarchy_iterator.h index 295430d903f..89ea31c7037 100644 --- a/source/blender/io/usd/intern/abstract_hierarchy_iterator.h +++ b/source/blender/io/usd/intern/abstract_hierarchy_iterator.h @@ -195,6 +195,7 @@ class AbstractHierarchyIterator { void determine_duplication_references(const HierarchyContext *parent_context, std::string indent); + /* These three functions create writers and call their write() method. */ void make_writers(const HierarchyContext *parent_context); void make_writer_object_data(const HierarchyContext *context); void make_writers_particle_systems(const HierarchyContext *context); @@ -244,7 +245,10 @@ class AbstractHierarchyIterator { * data/hair/particle will NOT prevent the transform to be written. * * The returned writer is owned by the AbstractHierarchyWriter, and should be freed in - * delete_object_writer(). */ + * delete_object_writer(). + * + * The created AbstractHierarchyWriter instances should NOT keep a copy of the context pointer. + * The context can be stack-allocated and go out of scope. */ virtual AbstractHierarchyWriter *create_transform_writer(const HierarchyContext *context) = 0; virtual AbstractHierarchyWriter *create_data_writer(const HierarchyContext *context) = 0; virtual AbstractHierarchyWriter *create_hair_writer(const HierarchyContext *context) = 0; |