[Bf-blender-cvs] [7644d6f7520] temp-sybren-usd-patch-01: USD: clarification of NULL-safety of `get_object_(data_)name`

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


Commit: 7644d6f75202a8016e4c7eefe15479b51d3bbf6b
Author: Sybren A. Stüvel
Date:   Tue Nov 26 12:51:59 2019 +0100
Branches: temp-sybren-usd-patch-01
https://developer.blender.org/rB7644d6f75202a8016e4c7eefe15479b51d3bbf6b

USD: clarification of NULL-safety of `get_object_(data_)name`

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

M	source/blender/usd/intern/abstract_hierarchy_iterator.h

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

diff --git a/source/blender/usd/intern/abstract_hierarchy_iterator.h b/source/blender/usd/intern/abstract_hierarchy_iterator.h
index f1152230219..438b5b571be 100644
--- a/source/blender/usd/intern/abstract_hierarchy_iterator.h
+++ b/source/blender/usd/intern/abstract_hierarchy_iterator.h
@@ -159,7 +159,8 @@ class AbstractHierarchyIterator {
   virtual std::string make_valid_name(const std::string &name) const;
 
   /* Return the name of this ID datablock that is valid for the exported file format. Overriding is
-   * only necessary if make_valid_name(id->name+2) is not suitable for the exported file format. */
+   * only necessary if make_valid_name(id->name+2) is not suitable for the exported file format.
+   * NULL-safe: when `id == nullptr` this returns an empty string. */
   virtual std::string get_id_name(const ID *id) const;
 
   /* Given a HierarchyContext of some Object *, return an export path that is valid for its
@@ -189,6 +190,7 @@ class AbstractHierarchyIterator {
   void make_writer_object_data(const HierarchyContext *context);
   void make_writers_particle_systems(const HierarchyContext *context);
 
+  /* Convenience wrappers around get_id_name(). */
   std::string get_object_name(const Object *object) const;
   std::string get_object_data_name(const Object *object) const;



More information about the Bf-blender-cvs mailing list