diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2019-03-25 12:19:56 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2019-03-25 12:19:56 +0300 |
commit | 14b60c3a1cafb070b5848ab7b7a32827c58e354e (patch) | |
tree | 5388bf593b1910db4f5e9aea06bf1ab0bf1f1e13 /source/blender/editors/space_view3d/view3d_ops.c | |
parent | 94388d69bb8082945e95f1b7583320cd43d90c69 (diff) |
Cleanup: UI messages of copy/paste in 3DView.
Remove references to buffer or temp file, some other minor edits.
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_ops.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_ops.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c index 1ec75e06cc9..e4a6ffb0707 100644 --- a/source/blender/editors/space_view3d/view3d_ops.c +++ b/source/blender/editors/space_view3d/view3d_ops.c @@ -65,31 +65,34 @@ static int view3d_copybuffer_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); char str[FILE_MAX]; + int num_copied = 0; BKE_copybuffer_begin(bmain); /* context, selection, could be generalized */ CTX_DATA_BEGIN (C, Object *, ob, selected_objects) { - BKE_copybuffer_tag_ID(&ob->id); + if ((ob->id.tag & LIB_TAG_DOIT) == 0) { + BKE_copybuffer_tag_ID(&ob->id); + num_copied++; + } } CTX_DATA_END; BLI_make_file_string("/", str, BKE_tempdir_base(), "copybuffer.blend"); BKE_copybuffer_save(bmain, str, op->reports); - BKE_report(op->reports, RPT_INFO, "Copied selected objects to buffer"); + BKE_reportf(op->reports, RPT_INFO, "Copied %d selected objects", num_copied); return OPERATOR_FINISHED; } static void VIEW3D_OT_copybuffer(wmOperatorType *ot) { - /* identifiers */ - ot->name = "Copy Selection to Buffer"; + ot->name = "Copy Objects"; ot->idname = "VIEW3D_OT_copybuffer"; - ot->description = "Selected objects are saved in a temp file"; + ot->description = "Selected objects are copied to the clipboard"; /* api callbacks */ ot->exec = view3d_copybuffer_exec; @@ -110,13 +113,13 @@ static int view3d_pastebuffer_exec(bContext *C, wmOperator *op) const int num_pasted = BKE_copybuffer_paste(C, str, flag, op->reports, FILTER_ID_OB); if (num_pasted == 0) { - BKE_report(op->reports, RPT_INFO, "No buffer to paste from"); + BKE_report(op->reports, RPT_INFO, "No objects to paste"); return OPERATOR_CANCELLED; } WM_event_add_notifier(C, NC_WINDOW, NULL); - BKE_reportf(op->reports, RPT_INFO, "%d objects pasted from buffer", num_pasted); + BKE_reportf(op->reports, RPT_INFO, "%d objects pasted", num_pasted); return OPERATOR_FINISHED; } @@ -125,9 +128,9 @@ static void VIEW3D_OT_pastebuffer(wmOperatorType *ot) { /* identifiers */ - ot->name = "Paste Selection from Buffer"; + ot->name = "Paste Objects"; ot->idname = "VIEW3D_OT_pastebuffer"; - ot->description = "Contents of copy buffer gets pasted"; + ot->description = "Objects from the clipboard are pasted"; /* api callbacks */ ot->exec = view3d_pastebuffer_exec; @@ -137,7 +140,8 @@ static void VIEW3D_OT_pastebuffer(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; RNA_def_boolean(ot->srna, "autoselect", true, "Select", "Select pasted objects"); - RNA_def_boolean(ot->srna, "active_collection", true, "Active Collection", "Put pasted objects on the active collection"); + RNA_def_boolean(ot->srna, "active_collection", true, + "Active Collection", "Put pasted objects in the active collection"); } /* ************************** registration **********************************/ |