diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-08-17 17:58:09 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-08-17 18:56:05 +0300 |
commit | a95f8635967360e07ecb556e2b82099880ec1e63 (patch) | |
tree | bd978790bcb23007fbc52c0e80205a6c82fcc0df /source/blender/io/alembic/exporter/abc_export_capi.cc | |
parent | fd3086833afea8b414506de6bb9ab6a5beaa7faa (diff) |
Fix T75936: Alembic, allow exporting of invisible objects
Add a new depsgraph builder class that includes invisible objects and
use that in the Alembic exporter.
Alembic supports three options for visibility, "visible", "inherited",
and "hidden". This means that parents can be hidden and still have
visible children (contrary to USD, where invisibility is used to prune
an entire scene graph subtree). Because of this, the visibility is
stored on the transform node, as that represents the Object in Blender
and thus keeps the Alembic file as close to Blender's own structure as
possible.
Reviewed By: Sergey
Differential Revision: https://developer.blender.org/D8595
Diffstat (limited to 'source/blender/io/alembic/exporter/abc_export_capi.cc')
-rw-r--r-- | source/blender/io/alembic/exporter/abc_export_capi.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/io/alembic/exporter/abc_export_capi.cc b/source/blender/io/alembic/exporter/abc_export_capi.cc index 8c5f3d89870..c4966a965eb 100644 --- a/source/blender/io/alembic/exporter/abc_export_capi.cc +++ b/source/blender/io/alembic/exporter/abc_export_capi.cc @@ -67,11 +67,17 @@ namespace io { namespace alembic { // Construct the depsgraph for exporting. -static void build_depsgraph(Depsgraph *depsgraph, Main *bmain) +static void build_depsgraph(Depsgraph *depsgraph, Main *bmain, const bool visible_objects_only) { Scene *scene = DEG_get_input_scene(depsgraph); ViewLayer *view_layer = DEG_get_input_view_layer(depsgraph); - DEG_graph_build_from_view_layer(depsgraph, bmain, scene, view_layer); + + if (visible_objects_only) { + DEG_graph_build_from_view_layer(depsgraph, bmain, scene, view_layer); + } + else { + DEG_graph_build_for_all_objects(depsgraph, bmain, scene, view_layer); + } } static void export_startjob(void *customdata, @@ -91,7 +97,7 @@ static void export_startjob(void *customdata, *progress = 0.0f; *do_update = true; - build_depsgraph(data->depsgraph, data->bmain); + build_depsgraph(data->depsgraph, data->bmain, data->params.visible_objects_only); SubdivModifierDisabler subdiv_disabler(data->depsgraph); if (!data->params.apply_subdiv) { subdiv_disabler.disable_modifiers(); |