[Bf-blender-cvs] [00f27a85689] master: Cleanup: RNA: Remove useless setter of PoseBone's custom shape.

Bastien Montagne noreply at git.blender.org
Tue Mar 2 11:54:27 CET 2021


Commit: 00f27a85689ba52d77924a7f7741f724caf831de
Author: Bastien Montagne
Date:   Tue Mar 2 11:52:49 2021 +0100
Branches: master
https://developer.blender.org/rB00f27a85689ba52d77924a7f7741f724caf831de

Cleanup: RNA: Remove useless setter of PoseBone's custom shape.

If the property is properly tagged, RNA knows how to deal with ID
usercount by itself, no need of a custom setter callback for that.

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

M	source/blender/makesrna/intern/rna_pose.c

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

diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c
index 90a860e87e2..8eda1b4f49e 100644
--- a/source/blender/makesrna/intern/rna_pose.c
+++ b/source/blender/makesrna/intern/rna_pose.c
@@ -425,22 +425,6 @@ static void rna_Itasc_update_rebuild(Main *bmain, Scene *scene, PointerRNA *ptr)
   rna_Itasc_update(bmain, scene, ptr);
 }
 
-static void rna_PoseChannel_bone_custom_set(PointerRNA *ptr,
-                                            PointerRNA value,
-                                            struct ReportList *UNUSED(reports))
-{
-  bPoseChannel *pchan = (bPoseChannel *)ptr->data;
-
-  if (pchan->custom) {
-    id_us_min(&pchan->custom->id);
-    pchan->custom = NULL;
-  }
-
-  pchan->custom = value.data;
-
-  id_us_plus(&pchan->custom->id);
-}
-
 static PointerRNA rna_PoseChannel_bone_group_get(PointerRNA *ptr)
 {
   Object *ob = (Object *)ptr->owner_id;
@@ -1368,9 +1352,8 @@ static void rna_def_pose_channel(BlenderRNA *brna)
   prop = RNA_def_property(srna, "custom_shape", PROP_POINTER, PROP_NONE);
   RNA_def_property_pointer_sdna(prop, NULL, "custom");
   RNA_def_property_struct_type(prop, "Object");
-  RNA_def_property_flag(prop, PROP_EDITABLE);
+  RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT);
   RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
-  RNA_def_property_pointer_funcs(prop, NULL, "rna_PoseChannel_bone_custom_set", NULL, NULL);
   RNA_def_property_ui_text(
       prop, "Custom Object", "Object that defines custom draw type for this bone");
   RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");



More information about the Bf-blender-cvs mailing list