[Bf-blender-cvs] [946bc4d3c1d] blender2.8: Fix object selection doversion issue since Workspace

Dalai Felinto noreply at git.blender.org
Fri Jun 16 18:15:21 CEST 2017


Commit: 946bc4d3c1da45b11f7da045074bb297d45487cd
Author: Dalai Felinto
Date:   Fri Jun 16 18:12:20 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB946bc4d3c1da45b11f7da045074bb297d45487cd

Fix object selection doversion issue since Workspace

Workspace commit (7f564d74f9edaaa41ce27c6e854869096f70b4da) made
selection to not be carried away from 2.7x files into 2.8.

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

M	source/blender/blenloader/intern/versioning_280.c

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

diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index e9146ba86dd..97df428ee22 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -172,6 +172,13 @@ void do_versions_after_linking_280(Main *main)
 							BKE_collection_object_add(scene, collections[i], base->object);
 						}
 					}
+
+					if (base->flag & SELECT) {
+						base->object->flag |= SELECT;
+					}
+					else {
+						base->object->flag &= ~SELECT;
+					}
 				}
 
 				scene->active_layer = 0;
@@ -208,6 +215,12 @@ void do_versions_after_linking_280(Main *main)
 							sl->basact = BKE_scene_layer_base_find(sl, scene->basact->object);
 						}
 
+						for (Base *base = sl->object_bases.first; base; base = base->next) {
+							if ((base->flag & BASE_SELECTABLED) && (base->object->flag & SELECT)) {
+								base->flag |= BASE_SELECTED;
+							}
+						}
+
 						/* TODO: passes, samples, mask_layesr, exclude, ... */
 					}
 
@@ -234,18 +247,12 @@ void do_versions_after_linking_280(Main *main)
 
 				/* convert selected bases */
 				for (Base *base = scene->base.first; base; base = base->next) {
-					Base *ob_base = BKE_scene_layer_base_find(sl, base->object);
-					if ((base->flag & SELECT) != 0) {
-						if ((ob_base->flag & BASE_SELECTABLED) != 0) {
-							ob_base->flag |= BASE_SELECTED;
-						}
-					}
-					else {
-						ob_base->flag &= ~BASE_SELECTED;
+					if ((base->flag & BASE_SELECTABLED) && (base->object->flag & SELECT)) {
+						base->flag |= BASE_SELECTED;
 					}
 
 					/* keep lay around for forward compatibility (open those files in 2.79) */
-					ob_base->lay = base->lay;
+					base->lay = base->object->lay;
 				}
 
 				/* TODO: copy scene render data to layer */




More information about the Bf-blender-cvs mailing list