Fix errors and inconsistencies in confirmation popup removal.
* Improve some clip editor messages * Remove popup for metastrips, seems unnecessary * Renamed some variables for consistency * Avoid unnecessary call to CTX_DATA_COUNT Reviewed By: sergey, campbellbarton, aligorith Differential Revision: http://developer.blender.org/D44
This commit is contained in:
@@ -1476,7 +1476,7 @@ void ANIM_OT_keyframe_delete(wmOperatorType *ot)
|
||||
|
||||
static int clear_anim_v3d_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
int removed_tot = 0;
|
||||
int num_deleted = 0;
|
||||
|
||||
CTX_DATA_BEGIN (C, Object *, ob, selected_objects)
|
||||
{
|
||||
@@ -1517,7 +1517,7 @@ static int clear_anim_v3d_exec(bContext *C, wmOperator *op)
|
||||
/* delete F-Curve completely */
|
||||
if (can_delete) {
|
||||
ANIM_fcurve_delete_from_animdata(NULL, adt, fcu);
|
||||
removed_tot++;
|
||||
num_deleted++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1527,8 +1527,8 @@ static int clear_anim_v3d_exec(bContext *C, wmOperator *op)
|
||||
}
|
||||
CTX_DATA_END;
|
||||
|
||||
if (removed_tot > 0)
|
||||
BKE_reportf(op->reports, RPT_INFO, "Deleted %d animation f-curves from selected objects", removed_tot);
|
||||
if (num_deleted > 0)
|
||||
BKE_reportf(op->reports, RPT_INFO, "Deleted %d animation F-Curves from selected objects", num_deleted);
|
||||
|
||||
/* send updates */
|
||||
WM_event_add_notifier(C, NC_OBJECT | ND_KEYS, NULL);
|
||||
|
||||
@@ -989,6 +989,7 @@ static int armature_align_bones_exec(bContext *C, wmOperator *op)
|
||||
bArmature *arm = (bArmature *)ob->data;
|
||||
EditBone *actbone = CTX_data_active_bone(C);
|
||||
EditBone *actmirb = NULL;
|
||||
int num_selected_bones;
|
||||
|
||||
/* there must be an active bone */
|
||||
if (actbone == NULL) {
|
||||
@@ -1011,7 +1012,8 @@ static int armature_align_bones_exec(bContext *C, wmOperator *op)
|
||||
/* if there is only 1 selected bone, we assume that that is the active bone,
|
||||
* since a user will need to have clicked on a bone (thus selecting it) to make it active
|
||||
*/
|
||||
if (CTX_DATA_COUNT(C, selected_editable_bones) <= 1) {
|
||||
num_selected_bones = CTX_DATA_COUNT(C, selected_editable_bones);
|
||||
if (num_selected_bones <= 1) {
|
||||
/* When only the active bone is selected, and it has a parent,
|
||||
* align it to the parent, as that is the only possible outcome.
|
||||
*/
|
||||
@@ -1045,7 +1047,7 @@ static int armature_align_bones_exec(bContext *C, wmOperator *op)
|
||||
}
|
||||
CTX_DATA_END;
|
||||
|
||||
BKE_reportf(op->reports, RPT_INFO, "%d bones aligned to bone '%s'", CTX_DATA_COUNT(C, selected_editable_bones), actbone->name);
|
||||
BKE_reportf(op->reports, RPT_INFO, "%d bones aligned to bone '%s'", num_selected_bones, actbone->name);
|
||||
}
|
||||
|
||||
/* note, notifier might evolve */
|
||||
@@ -1117,7 +1119,7 @@ static int armature_delete_selected_exec(bContext *C, wmOperator *op)
|
||||
EditBone *curBone, *ebone_next;
|
||||
bConstraint *con;
|
||||
Object *obedit = CTX_data_edit_object(C); // XXX get from context
|
||||
int removed_tot = 0;
|
||||
int num_deleted = 0;
|
||||
arm = obedit->data;
|
||||
|
||||
/* cancel if nothing selected */
|
||||
@@ -1174,12 +1176,12 @@ static int armature_delete_selected_exec(bContext *C, wmOperator *op)
|
||||
if (curBone->flag & BONE_SELECTED) {
|
||||
if (curBone == arm->act_edbone) arm->act_edbone = NULL;
|
||||
ED_armature_edit_bone_remove(arm, curBone);
|
||||
removed_tot++;
|
||||
num_deleted++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BKE_reportf(op->reports, RPT_INFO, "Deleted %d bones", removed_tot);
|
||||
BKE_reportf(op->reports, RPT_INFO, "Deleted %d bones", num_deleted);
|
||||
|
||||
ED_armature_sync_selection(arm->edbo);
|
||||
|
||||
|
||||
@@ -1036,19 +1036,17 @@ static int delete_exec(bContext *C, wmOperator *op)
|
||||
}
|
||||
}
|
||||
|
||||
if (num_deleted == 0) {
|
||||
if (num_deleted == 0)
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
else {
|
||||
/* TODO: only update edited splines */
|
||||
BKE_mask_update_display(mask, CFRA);
|
||||
|
||||
WM_event_add_notifier(C, NC_MASK | NA_EDITED, mask);
|
||||
/* TODO: only update edited splines */
|
||||
BKE_mask_update_display(mask, CFRA);
|
||||
|
||||
BKE_reportf(op->reports, RPT_INFO, "Deleted selected control points from mask '%s'", mask->id.name);
|
||||
WM_event_add_notifier(C, NC_MASK | NA_EDITED, mask);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
BKE_reportf(op->reports, RPT_INFO, "Deleted %d control points from mask '%s'", num_deleted, mask->id.name);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
void MASK_OT_delete(wmOperatorType *ot)
|
||||
|
||||
@@ -1057,7 +1057,7 @@ static int object_delete_exec(bContext *C, wmOperator *op)
|
||||
wmWindowManager *wm = CTX_wm_manager(C);
|
||||
wmWindow *win;
|
||||
const short use_global = RNA_boolean_get(op->ptr, "use_global");
|
||||
int deleted_num = 0;
|
||||
int num_deleted = 0;
|
||||
|
||||
if (CTX_data_edit_object(C))
|
||||
return OPERATOR_CANCELLED;
|
||||
@@ -1069,7 +1069,7 @@ static int object_delete_exec(bContext *C, wmOperator *op)
|
||||
|
||||
/* remove from current scene only */
|
||||
ED_base_object_free_and_unlink(bmain, scene, base);
|
||||
deleted_num++;
|
||||
num_deleted++;
|
||||
|
||||
if (use_global) {
|
||||
Scene *scene_iter;
|
||||
@@ -1104,8 +1104,8 @@ static int object_delete_exec(bContext *C, wmOperator *op)
|
||||
}
|
||||
}
|
||||
|
||||
if (deleted_num > 0)
|
||||
BKE_reportf(op->reports, RPT_INFO, "Deleted %d objects", deleted_num);
|
||||
if (num_deleted > 0)
|
||||
BKE_reportf(op->reports, RPT_INFO, "Deleted %d objects", num_deleted);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
@@ -482,7 +482,7 @@ static int delete_curve_exec(bContext *C, wmOperator *op)
|
||||
if (act_track) {
|
||||
clip_delete_track(C, clip, act_track);
|
||||
|
||||
BKE_report(op->reports, RPT_INFO, "Deleted all selected curves");
|
||||
BKE_report(op->reports, RPT_INFO, "Deleted track");
|
||||
}
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
@@ -492,7 +492,7 @@ void CLIP_OT_graph_delete_curve(wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
ot->name = "Delete Curve";
|
||||
ot->description = "Delete selected curves";
|
||||
ot->description = "Delete track corresponding to the selected curve";
|
||||
ot->idname = "CLIP_OT_graph_delete_curve";
|
||||
|
||||
/* api callbacks */
|
||||
|
||||
@@ -263,8 +263,10 @@ static int delete_track_exec(bContext *C, wmOperator *op)
|
||||
while (track) {
|
||||
next = track->next;
|
||||
|
||||
if (TRACK_VIEW_SELECTED(sc, track))
|
||||
if (TRACK_VIEW_SELECTED(sc, track)) {
|
||||
clip_delete_track(C, clip, track);
|
||||
changed = true;
|
||||
}
|
||||
|
||||
track = next;
|
||||
}
|
||||
@@ -273,7 +275,7 @@ static int delete_track_exec(bContext *C, wmOperator *op)
|
||||
sc->flag &= ~SC_LOCK_SELECTION;
|
||||
|
||||
if (changed) {
|
||||
BKE_report(op->reports, RPT_INFO, "Deleted all selected tracks");
|
||||
BKE_report(op->reports, RPT_INFO, "Deleted selected tracks");
|
||||
WM_event_add_notifier(C, NC_MOVIECLIP | NA_EDITED, clip);
|
||||
}
|
||||
|
||||
@@ -307,6 +309,7 @@ static int delete_marker_exec(bContext *C, wmOperator *op)
|
||||
MovieTrackingPlaneTrack *plane_track, *plane_track_next;
|
||||
int framenr = ED_space_clip_get_clip_frame_number(sc);
|
||||
int has_selection = 0;
|
||||
bool changed = false;
|
||||
|
||||
while (track) {
|
||||
next = track->next;
|
||||
@@ -318,6 +321,7 @@ static int delete_marker_exec(bContext *C, wmOperator *op)
|
||||
has_selection |= track->markersnr > 1;
|
||||
|
||||
clip_delete_marker(C, clip, track, marker);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -341,6 +345,8 @@ static int delete_marker_exec(bContext *C, wmOperator *op)
|
||||
else {
|
||||
BKE_tracking_plane_marker_delete(plane_track, framenr);
|
||||
}
|
||||
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -350,7 +356,10 @@ static int delete_marker_exec(bContext *C, wmOperator *op)
|
||||
sc->flag &= ~SC_LOCK_SELECTION;
|
||||
}
|
||||
|
||||
BKE_report(op->reports, RPT_INFO, "Deleted all selected markers");
|
||||
if (!changed)
|
||||
return OPERATOR_CANCELLED;
|
||||
|
||||
BKE_report(op->reports, RPT_INFO, "Deleted markers for current frame from selected tracks");
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
@@ -2064,8 +2064,6 @@ static int sequencer_meta_make_exec(bContext *C, wmOperator *op)
|
||||
|
||||
WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
|
||||
|
||||
BKE_report(op->reports, RPT_INFO, "Grouped selected strips into a metastrip");
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
@@ -2095,7 +2093,7 @@ static int seq_depends_on_meta(Sequence *seq, Sequence *seqm)
|
||||
}
|
||||
|
||||
/* separate_meta_make operator */
|
||||
static int sequencer_meta_separate_exec(bContext *C, wmOperator *op)
|
||||
static int sequencer_meta_separate_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
{
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
|
||||
@@ -2136,8 +2134,6 @@ static int sequencer_meta_separate_exec(bContext *C, wmOperator *op)
|
||||
|
||||
WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
|
||||
|
||||
BKE_report(op->reports, RPT_INFO, "Metastrip content put back into the sequencer");
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user