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.
This commit is contained in:
Bastien Montagne 2021-03-02 11:52:49 +01:00
parent 2d4b638a67
commit 00f27a8568
1 changed files with 1 additions and 18 deletions

View File

@ -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");