Commit: 0c3d04e7c7e7b7de40f9eaa4c4d5ed9778fd0d67 Author: Sybren A. Stüvel Date: Tue Jun 25 14:58:09 2019 +0200 Branches: sybren-usd https://developer.blender.org/rB0c3d04e7c7e7b7de40f9eaa4c4d5ed9778fd0d67
USD: Commented-out most debug prints Things are starting to work, so the debug prints aren't necessary any more. They will be completely removed at some point, but I'm keeping them in the code for now so that I can quickly enable them when necessary. No functional changes. =================================================================== M source/blender/usd/intern/abstract_hierarchy_iterator.cc M source/blender/usd/intern/usd_hierarchy_iterator.cc =================================================================== diff --git a/source/blender/usd/intern/abstract_hierarchy_iterator.cc b/source/blender/usd/intern/abstract_hierarchy_iterator.cc index bb49da9958d..4af2c93e83b 100644 --- a/source/blender/usd/intern/abstract_hierarchy_iterator.cc +++ b/source/blender/usd/intern/abstract_hierarchy_iterator.cc @@ -40,7 +40,7 @@ void AbstractHierarchyIterator::iterate() { Scene *scene = DEG_get_evaluated_scene(depsgraph); - printf("====== Visiting objects:\n"); + // printf("====== Visiting objects:\n"); DEG_OBJECT_ITER_BEGIN (depsgraph, object, DEG_ITER_OBJECT_FLAG_LINKED_DIRECTLY | @@ -97,32 +97,32 @@ void AbstractHierarchyIterator::iterate() } DEG_OBJECT_ITER_END; - // For debug: print the export graph. - printf("====== Export graph pre-prune:\n"); - for (auto it : export_graph) { - printf(" OB %s:\n", it.first == nullptr ? "/" : (it.first->id.name + 2)); - for (auto child_it : it.second) { - printf(" - %s (weak_export=%s)\n", - child_it.object->id.name + 2, - child_it.weak_export ? "true" : "false"); - } - } + // // For debug: print the export graph. + // printf("====== Export graph pre-prune:\n"); + // for (auto it : export_graph) { + // printf(" OB %s:\n", it.first == nullptr ? "/" : (it.first->id.name + 2)); + // for (auto child_it : it.second) { + // printf(" - %s (weak_export=%s)\n", + // child_it.object->id.name + 2, + // child_it.weak_export ? "true" : "false"); + // } + // } prune_export_graph(); - // For debug: print the export graph. - printf("====== Export graph post-prune:\n"); - for (auto it : export_graph) { - printf(" OB %s (%p):\n", it.first == nullptr ? "/" : (it.first->id.name + 2), it.first); - for (auto child_it : it.second) { - printf(" - %s (weak_export=%s)\n", - child_it.object->id.name + 2, - child_it.weak_export ? "true" : "false"); - } - } + // // For debug: print the export graph. + // printf("====== Export graph post-prune:\n"); + // for (auto it : export_graph) { + // printf(" OB %s (%p):\n", it.first == nullptr ? "/" : (it.first->id.name + 2), it.first); + // for (auto child_it : it.second) { + // printf(" - %s (weak_export=%s)\n", + // child_it.object->id.name + 2, + // child_it.weak_export ? "true" : "false"); + // } + // } // For debug: print the export paths. - printf("====== Export paths:\n"); + // printf("====== Export paths:\n"); make_writers(nullptr, "", nullptr); } @@ -175,11 +175,11 @@ void AbstractHierarchyIterator::make_writers(Object *parent_object, context.parent_writer = parent_writer; context.export_path = export_path; - const char *color = context.weak_export ? "31;1" : "30"; - printf("%s \033[%sm%s\033[0m\n", - export_path.c_str(), - color, - context.weak_export ? "true" : "false"); + // const char *color = context.weak_export ? "31;1" : "30"; + // printf("%s \033[%sm%s\033[0m\n", + // export_path.c_str(), + // color, + // context.weak_export ? "true" : "false"); // Get or create the transform writer. xform_writer = ensure_xform_writer(context); @@ -265,15 +265,15 @@ void AbstractHierarchyIterator::visit_object(Object *object, }; export_graph[export_parent].insert(context); - std::string export_parent_name = export_parent ? get_object_name(export_parent) : "/"; - printf(" OB %30s %p (parent=%s %p; xform-only=%s; instance=%s)\n", - get_object_name(object).c_str(), - object, - export_parent_name.c_str(), - export_parent, - context.weak_export ? "\033[31;1mtrue\033[0m" : "false", - context.object->base_flag & BASE_FROM_DUPLI ? "\033[35;1mtrue\033[0m" : - "\033[30;1mfalse\033[0m"); + // std::string export_parent_name = export_parent ? get_object_name(export_parent) : "/"; + // printf(" OB %30s %p (parent=%s %p; xform-only=%s; instance=%s)\n", + // get_object_name(object).c_str(), + // object, + // export_parent_name.c_str(), + // export_parent, + // context.weak_export ? "\033[31;1mtrue\033[0m" : "false", + // context.object->base_flag & BASE_FROM_DUPLI ? "\033[35;1mtrue\033[0m" : + // "\033[30;1mfalse\033[0m"); } AbstractHierarchyWriter *AbstractHierarchyIterator::get_writer(const std::string &name) diff --git a/source/blender/usd/intern/usd_hierarchy_iterator.cc b/source/blender/usd/intern/usd_hierarchy_iterator.cc index c27cd64d07d..be6c1e44563 100644 --- a/source/blender/usd/intern/usd_hierarchy_iterator.cc +++ b/source/blender/usd/intern/usd_hierarchy_iterator.cc @@ -52,8 +52,9 @@ std::string USDHierarchyIterator::get_id_name(const ID *const id) const 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()); + // printf( + // "\033[32;1mCREATE\033[0m %s at %s\n", context.object->id.name, + // context.export_path.c_str()); USDExporterContext usd_export_context = {depsgraph, stage, pxr::SdfPath(context.export_path)}; return new USDTransformWriter(usd_export_context); @@ -81,9 +82,9 @@ 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); + // 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"); @@ -91,9 +92,9 @@ AbstractHierarchyWriter *USDHierarchyIterator::create_data_writer(const Hierarch } if (!data_writer->is_supported()) { - printf("USD-\033[34mXFORM-ONLY\033[0m object %s type=%d (data writer rejects the data)\n", - context.object->id.name, - context.object->type); + // 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; } _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs