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/editors/io | |
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/editors/io')
-rw-r--r-- | source/blender/editors/io/io_usd.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/editors/io/io_usd.c b/source/blender/editors/io/io_usd.c index 096dc44c758..45ea52bdebc 100644 --- a/source/blender/editors/io/io_usd.c +++ b/source/blender/editors/io/io_usd.c @@ -113,6 +113,7 @@ static int wm_usd_export_exec(bContext *C, wmOperator *op) MEM_SAFE_FREE(op->customdata); const bool selected_objects_only = RNA_boolean_get(op->ptr, "selected_objects_only"); + const bool visible_objects_only = RNA_boolean_get(op->ptr, "visible_objects_only"); const bool export_animation = RNA_boolean_get(op->ptr, "export_animation"); const bool export_hair = RNA_boolean_get(op->ptr, "export_hair"); const bool export_uvmaps = RNA_boolean_get(op->ptr, "export_uvmaps"); @@ -128,6 +129,7 @@ static int wm_usd_export_exec(bContext *C, wmOperator *op) export_normals, export_materials, selected_objects_only, + visible_objects_only, use_instancing, evaluation_mode, }; @@ -149,6 +151,7 @@ static void wm_usd_export_draw(bContext *UNUSED(C), wmOperator *op) col = uiLayoutColumn(box, true); uiItemR(col, ptr, "selected_objects_only", 0, NULL, ICON_NONE); + uiItemR(col, ptr, "visible_objects_only", 0, NULL, ICON_NONE); col = uiLayoutColumn(box, true); uiItemR(col, ptr, "export_animation", 0, NULL, ICON_NONE); @@ -192,6 +195,13 @@ void WM_OT_usd_export(struct wmOperatorType *ot) "exported as empty transform"); RNA_def_boolean(ot->srna, + "visible_objects_only", + true, + "Visible Only", + "Only visible objects are exported. Invisible parents of exported objects are " + "exported as empty transform"); + + RNA_def_boolean(ot->srna, "export_animation", false, "Animation", |