diff options
author | Hans Goudey <h.goudey@me.com> | 2020-09-01 20:35:14 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2020-09-01 20:38:05 +0300 |
commit | baca8611e5fe4b3dcd6f5065fb125bc0a9d65934 (patch) | |
tree | bb1230387cd53b15f9621f10c4d0e5e2050b5580 /source/blender/io/alembic/exporter/abc_writer_abstract.cc | |
parent | 31705201dddebf7e3be5c4533b89f380aad1ede1 (diff) | |
parent | 2930d4fcea405985f2212c5f28c061af7c4849f8 (diff) |
Merge branch 'master' into active-fcurve-keyframeactive-fcurve-keyframe
Diffstat (limited to 'source/blender/io/alembic/exporter/abc_writer_abstract.cc')
-rw-r--r-- | source/blender/io/alembic/exporter/abc_writer_abstract.cc | 16 |
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 |