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_writer_abstract.cc')
-rw-r--r--source/blender/io/alembic/exporter/abc_writer_abstract.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/io/alembic/exporter/abc_writer_abstract.cc b/source/blender/io/alembic/exporter/abc_writer_abstract.cc
index e43b394e27f..84527a12e85 100644
--- a/source/blender/io/alembic/exporter/abc_writer_abstract.cc
+++ b/source/blender/io/alembic/exporter/abc_writer_abstract.cc
@@ -25,6 +25,10 @@
#include "DNA_modifier_types.h"
+#include "DEG_depsgraph.h"
+
+#include <Alembic/AbcGeom/Visibility.h>
+
#include "CLG_log.h"
static CLG_LogRef LOG = {"io.alembic"};
@@ -96,6 +100,18 @@ void ABCAbstractWriter::update_bounding_box(Object *object)
bounding_box_.max.z = -bb->vec[0][1];
}
+void ABCAbstractWriter::write_visibility(const HierarchyContext &context)
+{
+ const bool is_visible = context.is_object_visible(DAG_EVAL_RENDER);
+ Alembic::Abc::OObject abc_object = get_alembic_object();
+
+ if (!abc_visibility_.valid()) {
+ abc_visibility_ = Alembic::AbcGeom::CreateVisibilityProperty(abc_object, timesample_index_);
+ }
+ abc_visibility_.set(is_visible ? Alembic::AbcGeom::kVisibilityVisible :
+ Alembic::AbcGeom::kVisibilityHidden);
+}
+
} // namespace alembic
} // namespace io
} // namespace blender