Fix T62970: Scene Copy: remove 'linked objects/obdata', add 'linked collections'.

'Linked objects' option was not behaving correctly before, effectively
linking in collections, so this one has been renamed to just 'Linked Copy',
and gives a fully shallow copy of current scene.

'Linked Obdata' was not really useful, kind of confusing, and was
painful to maintain, so dropping it now.
This commit is contained in:
Bastien Montagne 2019-04-02 16:15:17 +02:00
parent d986b04bd3
commit 0554b2e177
Notes: blender-bot 2023-02-14 11:08:33 +01:00
Referenced by issue #62970, Behavior of New Scene's Link Object mode
3 changed files with 15 additions and 16 deletions

View File

@ -42,11 +42,10 @@ struct ViewRender;
struct WorkSpace;
typedef enum eSceneCopyMethod {
SCE_COPY_NEW = 0,
SCE_COPY_EMPTY = 1,
SCE_COPY_LINK_OB = 2,
SCE_COPY_LINK_DATA = 3,
SCE_COPY_FULL = 4,
SCE_COPY_NEW = 0,
SCE_COPY_EMPTY = 1,
SCE_COPY_LINK_COLLECTION = 2,
SCE_COPY_FULL = 3,
} eSceneCopyMethod;
/* Use as the contents of a 'for' loop: for (SETLOOPER(...)) { ... */

View File

@ -431,12 +431,12 @@ Scene *BKE_scene_copy(Main *bmain, Scene *sce, int type)
BKE_sequencer_editing_free(sce_copy, true);
}
/* NOTE: part of SCE_COPY_LINK_DATA and SCE_COPY_FULL operations
/* NOTE: part of SCE_COPY_FULL operations
* are done outside of blenkernel with ED_object_single_users! */
/* camera */
/* XXX This is most certainly useless? Object have not yet been duplicated... */
if (ELEM(type, SCE_COPY_LINK_DATA, SCE_COPY_FULL)) {
if (type == SCE_COPY_FULL) {
ID_NEW_REMAP(sce_copy->camera);
}

View File

@ -70,10 +70,7 @@ Scene *ED_scene_add(Main *bmain, bContext *C, wmWindow *win, eSceneCopyMethod me
scene_new = BKE_scene_copy(bmain, scene_old, method);
/* these can't be handled in blenkernel currently, so do them here */
if (method == SCE_COPY_LINK_DATA) {
ED_object_single_users(bmain, scene_new, false, true);
}
else if (method == SCE_COPY_FULL) {
if (method == SCE_COPY_FULL) {
ED_editors_flush_edits(bmain, false);
ED_object_single_users(bmain, scene_new, true, true);
}
@ -205,11 +202,14 @@ static int scene_new_exec(bContext *C, wmOperator *op)
static void SCENE_OT_new(wmOperatorType *ot)
{
static EnumPropertyItem type_items[] = {
{SCE_COPY_NEW, "NEW", 0, "New", "Add new scene"},
{SCE_COPY_EMPTY, "EMPTY", 0, "Copy Settings", "Make a copy without any objects"},
{SCE_COPY_LINK_OB, "LINK_OBJECTS", 0, "Link Objects", "Link to the objects from the current scene"},
{SCE_COPY_LINK_DATA, "LINK_OBJECT_DATA", 0, "Link Object Data", "Copy objects linked to data from the current scene"},
{SCE_COPY_FULL, "FULL_COPY", 0, "Full Copy", "Make a full copy of the current scene"},
{SCE_COPY_NEW, "NEW", 0, "New",
"Add a new, empty scene with default settings"},
{SCE_COPY_EMPTY, "EMPTY", 0, "Copy Settings",
"Add a new, empty scene, and copy settings from the current scene"},
{SCE_COPY_LINK_COLLECTION, "LINK_COPY", 0, "Linked Copy",
"Link in the collections from the current scene (shallow copy)"},
{SCE_COPY_FULL, "FULL_COPY", 0, "Full Copy",
"Make a full copy of the current scene"},
{0, NULL, 0, NULL, NULL},
};