[Bf-blender-cvs] [0554b2e177e] master: Fix T62970: Scene Copy: remove 'linked objects/obdata', add 'linked collections'.

Bastien Montagne noreply at git.blender.org
Tue Apr 2 16:22:12 CEST 2019


Commit: 0554b2e177e95cf0560a7e4ea969fad647eb4a5f
Author: Bastien Montagne
Date:   Tue Apr 2 16:15:17 2019 +0200
Branches: master
https://developer.blender.org/rB0554b2e177e95cf0560a7e4ea969fad647eb4a5f

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.

===================================================================

M	source/blender/blenkernel/BKE_scene.h
M	source/blender/blenkernel/intern/scene.c
M	source/blender/editors/scene/scene_edit.c

===================================================================

diff --git a/source/blender/blenkernel/BKE_scene.h b/source/blender/blenkernel/BKE_scene.h
index a0525a4e9f7..4e4883222cc 100644
--- a/source/blender/blenkernel/BKE_scene.h
+++ b/source/blender/blenkernel/BKE_scene.h
@@ -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(...)) { ... */
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 50216d2e69a..f33939f0a3f 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -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);
 		}
 
diff --git a/source/blender/editors/scene/scene_edit.c b/source/blender/editors/scene/scene_edit.c
index 3ad5ba5722a..ec0a851de97 100644
--- a/source/blender/editors/scene/scene_edit.c
+++ b/source/blender/editors/scene/scene_edit.c
@@ -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},
 	};



More information about the Bf-blender-cvs mailing list