[Bf-blender-cvs] [5f5540eaf69] sybren-usd: USD: Removed debug prints

Sybren A. Stüvel noreply at git.blender.org
Thu Jul 25 15:41:56 CEST 2019


Commit: 5f5540eaf69b668f80335918664107096dab4820
Author: Sybren A. Stüvel
Date:   Thu Jul 25 12:59:11 2019 +0200
Branches: sybren-usd
https://developer.blender.org/rB5f5540eaf69b668f80335918664107096dab4820

USD: Removed debug prints

No functional changes.

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

M	source/blender/usd/intern/abstract_hierarchy_iterator.cc
M	source/blender/usd/intern/usd_capi.cc
M	source/blender/usd/intern/usd_hierarchy_iterator.cc
M	source/blender/usd/intern/usd_writer_abstract.cc
M	source/blender/usd/intern/usd_writer_hair.cc
M	source/blender/usd/intern/usd_writer_mesh.cc

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

diff --git a/source/blender/usd/intern/abstract_hierarchy_iterator.cc b/source/blender/usd/intern/abstract_hierarchy_iterator.cc
index d0492b76d30..9eb3c5d6ff2 100644
--- a/source/blender/usd/intern/abstract_hierarchy_iterator.cc
+++ b/source/blender/usd/intern/abstract_hierarchy_iterator.cc
@@ -128,7 +128,6 @@ void AbstractHierarchyIterator::export_graph_construct()
 {
   Scene *scene = DEG_get_evaluated_scene(depsgraph);
 
-  // printf("====== Visiting objects:\n");
   DEG_OBJECT_ITER_BEGIN (depsgraph,
                          object,
                          DEG_ITER_OBJECT_FLAG_LINKED_DIRECTLY |
@@ -192,13 +191,6 @@ void AbstractHierarchyIterator::visit_object(Object *object,
   copy_m4_m4(context->matrix_world, object->obmat);
 
   export_graph[std::make_pair(export_parent, nullptr)].insert(context);
-
-  // std::string export_parent_name = export_parent ? get_object_name(export_parent) : "/";
-  // printf("    OB %30s %p (export-parent=%s; world x = %f)\n",
-  //        context->export_name.c_str(),
-  //        context->object,
-  //        export_parent_name.c_str(),
-  //        context->matrix_world[3][0]);
 }
 
 void AbstractHierarchyIterator::visit_dupli_object(DupliObject *dupli_object,
@@ -244,16 +236,6 @@ void AbstractHierarchyIterator::visit_dupli_object(DupliObject *dupli_object,
   context->export_name = make_valid_name(get_object_name(context->object) + suffix_stream.str());
 
   export_graph[graph_index].insert(context);
-
-  // std::string export_parent_name = context->export_parent ?
-  //                                      get_object_name(context->export_parent) :
-  //                                      "/";
-  // printf("    DU %30s %p (export-parent=%s; duplicator = %s; world x = %f)\n",
-  //        context->export_name.c_str(),
-  //        context->object,
-  //        export_parent_name.c_str(),
-  //        duplicator->id.name + 2,
-  //        context->matrix_world[3][0]);
 }
 
 static bool prune_the_weak(const HierarchyContext *context,
@@ -365,10 +347,6 @@ void AbstractHierarchyIterator::determine_duplication_references(
         if (it == originals_export_paths.end()) {
           // The original was not found, so mark this instance as "original".
           std::string data_path = get_object_data_path(context);
-          // printf(
-          //     "%s\033[93mUSD issue\033[0m: %s is DATA instance of %p, but no original DATA path
-          //     " "is known\n", indent.c_str(), data_path.c_str(), orig_data_id);
-
           context->mark_as_not_instanced();
           originals_export_paths[orig_id] = context->export_path;
           originals_export_paths[orig_data_id] = data_path;
diff --git a/source/blender/usd/intern/usd_capi.cc b/source/blender/usd/intern/usd_capi.cc
index d1b84c453bc..ecf20b737ce 100644
--- a/source/blender/usd/intern/usd_capi.cc
+++ b/source/blender/usd/intern/usd_capi.cc
@@ -128,7 +128,6 @@ static void export_startjob(void *customdata, short *stop, short *do_update, flo
           break;
         }
 
-        printf("\033[35;1mFRAME\033[0m %f\n", frame);
         // Update the scene for the next frame to render.
         scene->r.cfra = static_cast<int>(frame);
         scene->r.subframe = frame - scene->r.cfra;
diff --git a/source/blender/usd/intern/usd_hierarchy_iterator.cc b/source/blender/usd/intern/usd_hierarchy_iterator.cc
index 3214f25386e..2202d132293 100644
--- a/source/blender/usd/intern/usd_hierarchy_iterator.cc
+++ b/source/blender/usd/intern/usd_hierarchy_iterator.cc
@@ -70,9 +70,6 @@ USDExporterContext USDHierarchyIterator::create_usd_export_context(const Hierarc
 
 AbstractHierarchyWriter *USDHierarchyIterator::create_xform_writer(const HierarchyContext *context)
 {
-  // printf(
-  //     "\033[32;1mCREATE\033[0m %s at %s\n", context->object->id.name,
-  //     context->export_path.c_str());
   return new USDTransformWriter(create_usd_export_context(context));
 }
 
@@ -102,9 +99,6 @@ AbstractHierarchyWriter *USDHierarchyIterator::create_data_writer(const Hierarch
     case OB_LATTICE:
     case OB_ARMATURE:
     case OB_GPENCIL:
-      // printf("USD-\033[34mXFORM-ONLY\033[0m object %s  type=%d (no data writer)\n",
-      //        context->object->id.name,
-      //        context->object->type);
       return nullptr;
     case OB_TYPE_MAX:
       BLI_assert(!"OB_TYPE_MAX should not be used");
@@ -112,9 +106,6 @@ AbstractHierarchyWriter *USDHierarchyIterator::create_data_writer(const Hierarch
   }
 
   if (!data_writer->is_supported(context->object)) {
-    // printf("USD-\033[34mXFORM-ONLY\033[0m object %s  type=%d (data writer rejects the data)\n",
-    //        context->object->id.name,
-    //        context->object->type);
     delete data_writer;
     return nullptr;
   }
diff --git a/source/blender/usd/intern/usd_writer_abstract.cc b/source/blender/usd/intern/usd_writer_abstract.cc
index 6c2787f7384..4b5724e6ba2 100644
--- a/source/blender/usd/intern/usd_writer_abstract.cc
+++ b/source/blender/usd/intern/usd_writer_abstract.cc
@@ -50,10 +50,6 @@ void USDAbstractWriter::write(HierarchyContext &context)
   }
   else {
     is_animated_ = export_params.export_animation && check_is_animated(context);
-    // printf("%sANIMATION\033[0m: %20s: %s\n",
-    //        is_animated_ ? "\033[32;1m" : "\033[31;1m",
-    //        context.export_path.c_str(),
-    //        is_animated_ ? "true" : "false");
   }
 
   do_write(context);
diff --git a/source/blender/usd/intern/usd_writer_hair.cc b/source/blender/usd/intern/usd_writer_hair.cc
index 9b53659ed6a..d96acb4be93 100644
--- a/source/blender/usd/intern/usd_writer_hair.cc
+++ b/source/blender/usd/intern/usd_writer_hair.cc
@@ -12,7 +12,6 @@ extern "C" {
 
 USDHairWriter::USDHairWriter(const USDExporterContext &ctx) : USDAbstractWriter(ctx)
 {
-  printf("\033[39;1mHAIR writer\033[0m created at %s\n", ctx.usd_path.GetString().c_str());
 }
 
 void USDHairWriter::do_write(HierarchyContext &context)
@@ -24,10 +23,6 @@ void USDHairWriter::do_write(HierarchyContext &context)
   }
 
   pxr::UsdTimeCode timecode = get_export_time_code();
-
-  printf("\033[34;1mHAIR writer\033[0m writing %s %s\n",
-         context.object->id.name + 2,
-         psys->part->id.name + 2);
   pxr::UsdGeomBasisCurves curves = pxr::UsdGeomBasisCurves::Define(stage, usd_path_);
 
   // TODO: deal with (psys->part->flag & PART_HAIR_BSPLINE)
diff --git a/source/blender/usd/intern/usd_writer_mesh.cc b/source/blender/usd/intern/usd_writer_mesh.cc
index 7bee84cbe36..3bcad763018 100644
--- a/source/blender/usd/intern/usd_writer_mesh.cc
+++ b/source/blender/usd/intern/usd_writer_mesh.cc
@@ -40,9 +40,6 @@ void USDGenericMeshWriter::do_write(HierarchyContext &context)
   Mesh *mesh = get_export_mesh(object_eval, needsfree);
 
   if (mesh == NULL) {
-    printf("USD-\033[31mSKIPPING\033[0m object %s  type=%d mesh = NULL\n",
-           object_eval->id.name,
-           object_eval->type);
     return;
   }
 
@@ -117,10 +114,6 @@ void USDGenericMeshWriter::write_uv_maps(const Mesh *mesh, pxr::UsdGeomMesh usd_
 void USDGenericMeshWriter::write_mesh(HierarchyContext &context, Mesh *mesh)
 {
   pxr::UsdTimeCode timecode = get_export_time_code();
-  // printf("USD-\033[32mexporting\033[0m mesh  %s → %s  mesh = %p\n",
-  //        mesh->id.name,
-  //        usd_path_.GetString().c_str(),
-  //        mesh);
 
   pxr::UsdGeomMesh usd_mesh = pxr::UsdGeomMesh::Define(stage, usd_path_);
   USDMeshData usd_mesh_data;
@@ -134,9 +127,6 @@ void USDGenericMeshWriter::write_mesh(HierarchyContext &context, Mesh *mesh)
     }
     pxr::SdfPath ref_path(context.original_export_path);
     if (usd_mesh.GetPrim().GetReferences().AddInternalReference(ref_path)) {
-      // printf("USD ref \033[92mOK\033[0m %s → %s\n",
-      //        context.export_path.c_str(),
-      //        context.original_export_path.c_str());
       /* The material path will be of the form </_materials/{material name}>, which is outside the
       subtree pointed to by ref_path. As a result, the referenced data is not allowed to point out
       of its own subtree. It does work when we override the material with exactly the same path,



More information about the Bf-blender-cvs mailing list