[Bf-blender-cvs] [6a3c42da63f] temp-workspace_mode: Merge branch 'blender2.8' into temp-workspace_mode
Julian Eisel
noreply at git.blender.org
Sat Dec 23 16:36:39 CET 2017
Commit: 6a3c42da63f09f3c9eb2318e0d62fd0b298ed78d
Author: Julian Eisel
Date: Fri Dec 22 18:38:40 2017 +0100
Branches: temp-workspace_mode
https://developer.blender.org/rB6a3c42da63f09f3c9eb2318e0d62fd0b298ed78d
Merge branch 'blender2.8' into temp-workspace_mode
===================================================================
===================================================================
diff --cc source/blender/blenloader/intern/versioning_280.c
index 478f7aeabf7,b864c75c90f..84f96b64a8c
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@@ -602,35 -599,37 +599,67 @@@ void do_versions_after_linking_280(Mai
}
}
+ {
+ for (Object *object = main->object.first; object; object = object->id.next) {
+ #ifndef VERSION_280_SUBVERSION_4
+ /* If any object already has an initialized value for
+ * duplicator_visibility_flag it means we've already doversioned it.
+ * TODO(all) remove the VERSION_280_SUBVERSION_4 code once the subversion was bumped. */
+ if (object->duplicator_visibility_flag != 0) {
+ break;
+ }
+ #endif
+ if (object->particlesystem.first) {
+ object->duplicator_visibility_flag = OB_DUPLI_FLAG_VIEWPORT;
+ for (ParticleSystem *psys = object->particlesystem.first; psys; psys=psys->next) {
+ if (psys->part->draw & PART_DRAW_EMITTER) {
+ object->duplicator_visibility_flag |= OB_DUPLI_FLAG_RENDER;
+ #ifndef VERSION_280_SUBVERSION_4
+ psys->part->draw &= ~PART_DRAW_EMITTER;
+ #else
+ break;
+ #endif
+ }
+ }
+ }
+ else if (object->transflag & OB_DUPLI){
+ object->duplicator_visibility_flag = OB_DUPLI_FLAG_VIEWPORT;
+ }
+ else {
+ object->duplicator_visibility_flag = OB_DUPLI_FLAG_VIEWPORT | OB_DUPLI_FLAG_RENDER;
+ }
+ }
+ }
++
+ {
+ for (wmWindowManager *wm = main->wm.first; wm; wm = wm->id.next) {
+ for (wmWindow *win = wm->windows.first; win; win = win->next) {
+ WorkSpace *workspace = BKE_workspace_active_get(win->workspace_hook);
+
+ if (workspace->preferred_mode == OB_MODE_OBJECT) { /* Should never be the case! */
+ const Base *base = BKE_workspace_active_base_get(workspace, win->scene);
+
+ if (!base) {
+ /* skip */
+ }
+ else if (base->object->mode == OB_MODE_OBJECT) {
+ workspace->preferred_mode = (base->object->restore_mode == OB_MODE_OBJECT) ?
+ OB_MODE_EDIT : base->object->restore_mode;
+ }
+ else {
+ workspace->preferred_mode = base->object->mode;
+ workspace->flags |= WORKSPACE_USE_PREFERED_MODE;
+ }
+ }
+ }
+ }
+
+ for (WorkSpace *workspace = main->workspaces.first; workspace; workspace = workspace->id.next) {
+ if (workspace->preferred_mode == OB_MODE_OBJECT) { /* Should never be the case! */
+ workspace->preferred_mode = OB_MODE_EDIT;
+ }
+ }
+ }
}
static void do_version_layer_collections_idproperties(ListBase *lb)
More information about the Bf-blender-cvs
mailing list