[Bf-blender-cvs] [f159ad47c00] temp-sybren-usd-patch-01: USD: use BKE_object_visibility()

Sybren A. Stüvel noreply at git.blender.org
Tue Nov 26 18:23:08 CET 2019


Commit: f159ad47c0091e972dd72178425585cb53c8a765
Author: Sybren A. Stüvel
Date:   Tue Nov 26 17:03:45 2019 +0100
Branches: temp-sybren-usd-patch-01
https://developer.blender.org/rBf159ad47c0091e972dd72178425585cb53c8a765

USD: use BKE_object_visibility()

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

M	source/blender/usd/intern/usd_writer_mesh.cc

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

diff --git a/source/blender/usd/intern/usd_writer_mesh.cc b/source/blender/usd/intern/usd_writer_mesh.cc
index d497f2b504c..410ffe7b3f7 100644
--- a/source/blender/usd/intern/usd_writer_mesh.cc
+++ b/source/blender/usd/intern/usd_writer_mesh.cc
@@ -33,6 +33,7 @@ extern "C" {
 #include "BKE_material.h"
 #include "BKE_mesh.h"
 #include "BKE_modifier.h"
+#include "BKE_object.h"
 
 #include "DEG_depsgraph.h"
 
@@ -49,15 +50,9 @@ USDGenericMeshWriter::USDGenericMeshWriter(const USDExporterContext &ctx) : USDA
 
 bool USDGenericMeshWriter::is_supported(const Object *object) const
 {
-  // Reject meshes that have a particle system that should have its emitter hidden.
-  if (object->particlesystem.first != NULL) {
-    char check_flag = usd_export_context_.export_params.evaluation_mode == DAG_EVAL_RENDER ?
-                          OB_DUPLI_FLAG_RENDER :
-                          OB_DUPLI_FLAG_VIEWPORT;
-    return object->duplicator_visibility_flag & check_flag;
-  }
-
-  return true;
+  int visibility = BKE_object_visibility(object,
+                                         usd_export_context_.export_params.evaluation_mode);
+  return (visibility & OB_VISIBLE_SELF) != 0;
 }
 
 void USDGenericMeshWriter::do_write(HierarchyContext &context)



More information about the Bf-blender-cvs mailing list