[Bf-blender-cvs] [5711b851472] master: Cleanup: Remove unused IDProperty function

Hans Goudey noreply at git.blender.org
Wed Oct 28 02:12:47 CET 2020


Commit: 5711b8514726a15a1cb1783fd56a0dda48b5b0a2
Author: Hans Goudey
Date:   Tue Oct 27 20:12:42 2020 -0500
Branches: master
https://developer.blender.org/rB5711b8514726a15a1cb1783fd56a0dda48b5b0a2

Cleanup: Remove unused IDProperty function

This function from 2017 came with a comment: "TODO Nuke this once its
only user has been correctly converted to use generic IDmanagement"
Since it is unused after rB91462fbb31ba, now is time to remove it.

Differential Revision: https://developer.blender.org/D9368

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

M	source/blender/blenkernel/BKE_idprop.h
M	source/blender/blenkernel/intern/idprop.c

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

diff --git a/source/blender/blenkernel/BKE_idprop.h b/source/blender/blenkernel/BKE_idprop.h
index 37a83a94079..9c250240e5e 100644
--- a/source/blender/blenkernel/BKE_idprop.h
+++ b/source/blender/blenkernel/BKE_idprop.h
@@ -147,8 +147,6 @@ void IDP_FreeProperty(struct IDProperty *prop);
 
 void IDP_ClearProperty(IDProperty *prop);
 
-void IDP_RelinkProperty(struct IDProperty *prop);
-
 void IDP_Reset(IDProperty *prop, const IDProperty *reference);
 
 #define IDP_Int(prop) ((prop)->data.val)
diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c
index 8f3bff7e9af..b0991f1d343 100644
--- a/source/blender/blenkernel/intern/idprop.c
+++ b/source/blender/blenkernel/intern/idprop.c
@@ -791,43 +791,6 @@ void IDP_CopyPropertyContent(IDProperty *dst, IDProperty *src)
   IDP_FreeProperty(idprop_tmp);
 }
 
-/* Updates ID pointers after an object has been copied */
-/* TODO Nuke this once its only user has been correctly converted
- * to use generic ID management from BKE_library! */
-void IDP_RelinkProperty(struct IDProperty *prop)
-{
-  if (!prop) {
-    return;
-  }
-
-  switch (prop->type) {
-    case IDP_GROUP: {
-      LISTBASE_FOREACH (IDProperty *, loop, &prop->data.group) {
-        IDP_RelinkProperty(loop);
-      }
-      break;
-    }
-    case IDP_IDPARRAY: {
-      IDProperty *idp_array = IDP_Array(prop);
-      for (int i = 0; i < prop->len; i++) {
-        IDP_RelinkProperty(&idp_array[i]);
-      }
-      break;
-    }
-    case IDP_ID: {
-      ID *id = IDP_Id(prop);
-      if (id && id->newid) {
-        id_us_min(IDP_Id(prop));
-        prop->data.pointer = id->newid;
-        id_us_plus(IDP_Id(prop));
-      }
-      break;
-    }
-    default:
-      break; /* Nothing to do for other IDProp types. */
-  }
-}
-
 /**
  * Get the Group property that contains the id properties for ID id.  Set create_if_needed
  * to create the Group property and attach it to id if it doesn't exist; otherwise



More information about the Bf-blender-cvs mailing list