From 563ef943c741eebd2fc7eaecd3984a0f5a17b7b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 6 Jul 2021 17:49:12 +0200 Subject: Cleanup: Keyframing, remove duplicate code Remove duplicate code from the `ANIM_OT_keyframe_delete` operator. The actions of the removed code are already performed by the preceding `keyingset_get_from_op_with_error()` call. No functional changes. --- source/blender/editors/animation/keyframing.c | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 3751555f18c..08756252001 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -2087,29 +2087,6 @@ static int delete_key_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - const int prop_type = RNA_property_type(op->type->prop); - if (prop_type == PROP_ENUM) { - int type = RNA_property_enum_get(op->ptr, op->type->prop); - ks = ANIM_keyingset_get_from_enum_type(scene, type); - if (ks == NULL) { - BKE_report(op->reports, RPT_ERROR, "No active Keying Set"); - return OPERATOR_CANCELLED; - } - } - else if (prop_type == PROP_STRING) { - char type_id[MAX_ID_NAME - 2]; - RNA_property_string_get(op->ptr, op->type->prop, type_id); - ks = ANIM_keyingset_get_from_idname(scene, type_id); - - if (ks == NULL) { - BKE_reportf(op->reports, RPT_ERROR, "Active Keying Set '%s' not found", type_id); - return OPERATOR_CANCELLED; - } - } - else { - BLI_assert(0); - } - /* report failure */ if (ks == NULL) { BKE_report(op->reports, RPT_ERROR, "No active Keying Set"); -- cgit v1.2.3