[Bf-blender-cvs] [cf0f066c2d6] master: USD Exporter: removed 'Visible Objects Only' exporter option

Sybren A. Stüvel noreply at git.blender.org
Thu Jan 9 15:53:00 CET 2020


Commit: cf0f066c2d62234cb0ed228c25a496c2ecab142e
Author: Sybren A. Stüvel
Date:   Thu Jan 9 15:31:53 2020 +0100
Branches: master
https://developer.blender.org/rBcf0f066c2d62234cb0ed228c25a496c2ecab142e

USD Exporter: removed 'Visible Objects Only' exporter option

The way the USD exporter currently works, it is not possible to export
invisible objects. As such, the 'Visible Objects Only' option was
confusing.

Exporting invisible objects means obtaining invisible evaluated objects
from the depsgraph, which is not something that's currently implemented.
Once that's done, we can reintroduce this option.

===================================================================

M	source/blender/editors/io/io_usd.c
M	source/blender/usd/intern/usd_hierarchy_iterator.cc
M	source/blender/usd/usd.h

===================================================================

diff --git a/source/blender/editors/io/io_usd.c b/source/blender/editors/io/io_usd.c
index 2818b134509..ecd8af8d5a2 100644
--- a/source/blender/editors/io/io_usd.c
+++ b/source/blender/editors/io/io_usd.c
@@ -111,7 +111,6 @@ 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");
@@ -127,7 +126,6 @@ static int wm_usd_export_exec(bContext *C, wmOperator *op)
       export_normals,
       export_materials,
       selected_objects_only,
-      visible_objects_only,
       use_instancing,
       evaluation_mode,
   };
@@ -147,7 +145,6 @@ static void wm_usd_export_draw(bContext *UNUSED(C), wmOperator *op)
 
   col = uiLayoutColumn(layout, true);
   uiItemR(col, ptr, "selected_objects_only", 0, NULL, ICON_NONE);
-  uiItemR(col, ptr, "visible_objects_only", 0, NULL, ICON_NONE);
 
   col = uiLayoutColumn(layout, true);
   uiItemR(col, ptr, "export_animation", 0, NULL, ICON_NONE);
@@ -187,13 +184,6 @@ void WM_OT_usd_export(struct wmOperatorType *ot)
                   "Only selected objects are exported. Unselected parents of selected objects are "
                   "exported as empty transform");
 
-  RNA_def_boolean(ot->srna,
-                  "visible_objects_only",
-                  true,
-                  "Only Export Visible Objects",
-                  "Only visible objects are exported. Invisible parents of visible objects are "
-                  "exported as empty transform");
-
   RNA_def_boolean(ot->srna,
                   "export_animation",
                   false,
diff --git a/source/blender/usd/intern/usd_hierarchy_iterator.cc b/source/blender/usd/intern/usd_hierarchy_iterator.cc
index f53cba8b2c6..d56de8cff13 100644
--- a/source/blender/usd/intern/usd_hierarchy_iterator.cc
+++ b/source/blender/usd/intern/usd_hierarchy_iterator.cc
@@ -56,9 +56,6 @@ bool USDHierarchyIterator::mark_as_weak_export(const Object *object) const
   if (params_.selected_objects_only && (object->base_flag & BASE_SELECTED) == 0) {
     return true;
   }
-  if (params_.visible_objects_only && (object->base_flag & BASE_VISIBLE_VIEWLAYER) == 0) {
-    return true;
-  }
   return false;
 }
 
diff --git a/source/blender/usd/usd.h b/source/blender/usd/usd.h
index 1a6f5819e21..c8e559c59f5 100644
--- a/source/blender/usd/usd.h
+++ b/source/blender/usd/usd.h
@@ -36,7 +36,6 @@ struct USDExportParams {
   bool export_normals;
   bool export_materials;
   bool selected_objects_only;
-  bool visible_objects_only;
   bool use_instancing;
   enum eEvaluationMode evaluation_mode;
 };



More information about the Bf-blender-cvs mailing list