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:
Diffstat (limited to 'source/blender/io/alembic/exporter/abc_hierarchy_iterator.cc')
-rw-r--r--source/blender/io/alembic/exporter/abc_hierarchy_iterator.cc24
1 files changed, 17 insertions, 7 deletions
diff --git a/source/blender/io/alembic/exporter/abc_hierarchy_iterator.cc b/source/blender/io/alembic/exporter/abc_hierarchy_iterator.cc
index e8ca06d75fc..5fc5c47d4b9 100644
--- a/source/blender/io/alembic/exporter/abc_hierarchy_iterator.cc
+++ b/source/blender/io/alembic/exporter/abc_hierarchy_iterator.cc
@@ -126,17 +126,27 @@ AbstractHierarchyIterator::ExportGraph::key_type ABCHierarchyIterator::determine
context, dupli_object, dupli_parent_finder);
}
-Alembic::Abc::OObject ABCHierarchyIterator::get_alembic_parent(
- const HierarchyContext *context) const
+Alembic::Abc::OObject ABCHierarchyIterator::get_alembic_object(
+ const std::string &export_path) const
{
- Alembic::Abc::OObject parent;
+ if (export_path.empty()) {
+ return Alembic::Abc::OObject();
+ }
- if (!context->higher_up_export_path.empty()) {
- AbstractHierarchyWriter *writer = get_writer(context->higher_up_export_path);
- ABCAbstractWriter *abc_writer = static_cast<ABCAbstractWriter *>(writer);
- parent = abc_writer->get_alembic_object();
+ AbstractHierarchyWriter *writer = get_writer(export_path);
+ if (writer == nullptr) {
+ return Alembic::Abc::OObject();
}
+ ABCAbstractWriter *abc_writer = static_cast<ABCAbstractWriter *>(writer);
+ return abc_writer->get_alembic_object();
+}
+
+Alembic::Abc::OObject ABCHierarchyIterator::get_alembic_parent(
+ const HierarchyContext *context) const
+{
+ Alembic::Abc::OObject parent = get_alembic_object(context->higher_up_export_path);
+
if (!parent.valid()) {
/* An invalid parent object means "no parent", which should be translated to Alembic's top
* archive object. */