From 00f27a85689ba52d77924a7f7741f724caf831de Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Tue, 2 Mar 2021 11:52:49 +0100 Subject: 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. --- source/blender/makesrna/intern/rna_pose.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to '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"); -- cgit v1.2.3