Page MenuHome

Add copy/paste of any IDs in Outliner.
ClosedPublic

Authored by Bastien Montagne (mont29) on Mar 21 2019, 3:09 PM.
Tags
None
Subscribers
None
Tokens
"Yellow Medal" token, awarded by duarteframos."Love" token, awarded by pablovazquez.

Diff Detail

Repository
rB Blender

Event Timeline

Think this is pretty straight forward… :)

Only design question I had here is whether we want to use the same buffer as for 3DView copy/paste (which now only handles objects)? Or have two separated ones?

Also note that if this is accepted, changes to BKE_copybuffer API will be committed separately of course.

Great! IMO I don’t think we need different buffers. It might just end up being confusing then.

If the buffers are separate, you might copy object A in the Outliner and paste inside the 3D View, only to paste object B, because that was the last item copied in the 3D View.

I think users just expect there to be one buffer for this stuff.

Great! IMO I don’t think we need different buffers. It might just end up being confusing then.
I think users just expect there to be one buffer for this stuff.

Not always. Some cases were having different buffers can be handy to copy between .blend files:

  • Storing copied objects in the 3D view.
  • Storing copied nodes in the node editor. (bonus points for distinguishing Shader nodes from Compositor! :)
  • Storing keyframes from animation editors.
  • Storing Sequencer strips.
  • Ctrl+C in the image editor to copy to clipboard. (!)

These might not all apply to this patch in particular (Outliner), but good to keep in mind for compatibility in the future!

If you think of copying and pasting text, it works because everything goes into the same buffer. It would be very confusing if each text editor had its own clipboard buffer. The you would not be able to copy and paste between them, which is largely the point of copy/paste to begin with.

So, for copying and pasting objects in the Outliner, I think it should use the same buffer as in the 3D View.

I would say same buffer too. It will be confusing to copy from outliner, paste into viewport and not see the objects you just copied.

I think the main confusing thing with this will be if you paste e.g. a material, it's not obvious where it ends up. Objects appear in the viewport but for other datablocks it's not clear.

I don't really have a good solution for that. It might help if the messages said something like "Pasted 5 materials into the file" instead of "Data-blocks pasted from buffer", though not sure it helps that much.

source/blender/editors/space_outliner/outliner_edit.c
636

I would remove the term "buffer" here and in other descriptions. Not sure that helps explain anything to users, it's just copy/paste to them.

651

Capitalize Data.

667–677

I suggest to organize code like this, where the normal/successful path stays at the same indent level.

BLI_make_file_string("/", str, BKE_tempdir_base(), "copybuffer.blend");
if (!BKE_copybuffer_paste(C, str, flag, op->reports, 0)) {
    BKE_report(op->reports, RPT_INFO, "No buffer to paste from");

    return OPERATOR_CANCELLED;
}

WM_event_add_notifier(C, NC_WINDOW, NULL);

BKE_report(op->reports, RPT_INFO, "Data-blocks pasted from buffer");

return OPERATOR_FINISHED;
683

Capitalize Data.

Bastien Montagne (mont29) marked 4 inline comments as done.Mar 21 2019, 4:58 PM

I think the main confusing thing with this will be if you paste e.g. a material, it's not obvious where it ends up. Objects appear in the viewport but for other datablocks it's not clear.

I don't really have a good solution for that. It might help if the messages said something like "Pasted 5 materials into the file" instead of "Data-blocks pasted from buffer", though not sure it helps that much.

Added the global amount of data-blocks pasted (going into detailed number per data-type would make it a bit too much verbose imho…). Agree this can be confusing, but we have the same issue with Append/Link then…

Updated from review.

Also, if we agree on removing the 'buffer' from most UI messages, will do cleanup in 3DView copy/paste operators as well, but in other commit…

Probably we should also add Duplicate here, in addition to Copy and Paste?

Looks to me, but please also commit the tooltips change because a description like "buffer (temp .blend file)" is not at all relevant to users.

This revision is now accepted and ready to land.Mar 22 2019, 6:23 PM
This revision was automatically updated to reflect the committed changes.