diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-08-14 17:48:39 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-08-17 18:56:05 +0300 |
commit | 108f3284a7311068e3bb7742f813b4612c70dd03 (patch) | |
tree | 914ac8b6bf08e4c2f340ed4fe16198a93f6f4ee1 /source/blender/io/usd/intern/usd_capi.cc | |
parent | 271361e31f9e4bdd222b78833a42a5b268da3e89 (diff) |
USD: Allow exporting of invisible objects
The fix for T75936 made it possible to export invisible objects to
Alembic. This commit applies the same approach to the USD exporter.
The USD and Alembic code is slightly different in terms of where in the
exported file the visibility attribute is stored. In USD the visibility
is used to prune the scene graph, and thus there are only two options:
"hidden" and "inherited". Setting the visiblity of a node in the scene
graph to "hidden" immediately hides all its children. To allow hidden
parents with visible children, the visibility is stored on the object
data (so the geometry/camera/lamp/etc) instead.
Diffstat (limited to 'source/blender/io/usd/intern/usd_capi.cc')
-rw-r--r-- | source/blender/io/usd/intern/usd_capi.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/io/usd/intern/usd_capi.cc b/source/blender/io/usd/intern/usd_capi.cc index 98aef62f38e..a7c5ff1a305 100644 --- a/source/blender/io/usd/intern/usd_capi.cc +++ b/source/blender/io/usd/intern/usd_capi.cc @@ -76,7 +76,12 @@ static void export_startjob(void *customdata, // Construct the depsgraph for exporting. Scene *scene = DEG_get_input_scene(data->depsgraph); ViewLayer *view_layer = DEG_get_input_view_layer(data->depsgraph); - DEG_graph_build_from_view_layer(data->depsgraph, data->bmain, scene, view_layer); + if (data->params.visible_objects_only) { + DEG_graph_build_from_view_layer(data->depsgraph, data->bmain, scene, view_layer); + } + else { + DEG_graph_build_for_all_objects(data->depsgraph, data->bmain, scene, view_layer); + } BKE_scene_graph_update_tagged(data->depsgraph, data->bmain); *progress = 0.0f; |