[Bf-blender-cvs] [9d956c65a64] topbar: Merge branch 'blender2.8' into topbar

Julian Eisel noreply at git.blender.org
Wed Dec 6 17:42:46 CET 2017


Commit: 9d956c65a64ea6f8b1dec1a1fe11f7c67d7a0709
Author: Julian Eisel
Date:   Wed Dec 6 17:42:39 2017 +0100
Branches: topbar
https://developer.blender.org/rB9d956c65a64ea6f8b1dec1a1fe11f7c67d7a0709

Merge branch 'blender2.8' into topbar

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



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

diff --cc source/blender/blenloader/intern/readfile.c
index 861952ff181,6df5a505788..94f5f790f1c
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@@ -7046,38 -6532,102 +7119,40 @@@ static void direct_link_windowmanager(F
  	wm->addonconf = NULL;
  	wm->userconf = NULL;
  	
 -	wm->message_bus = NULL;
 -
 -	BLI_listbase_clear(&wm->jobs);
 -	BLI_listbase_clear(&wm->drags);
 -	
 -	wm->windrawable = NULL;
 -	wm->winactive = NULL;
 -	wm->initialized = 0;
 -	wm->op_undo_depth = 0;
 -	wm->is_interface_locked = 0;
 -}
 -
 -static void lib_link_windowmanager(FileData *fd, Main *main)
 -{
 -	wmWindowManager *wm;
 -	wmWindow *win;
 -	
 -	for (wm = main->wm.first; wm; wm = wm->id.next) {
 -		if (wm->id.tag & LIB_TAG_NEED_LINK) {
 -			/* Note: WM IDProperties are never written to file, hence no need to read/link them here. */
 -			for (win = wm->windows.first; win; win = win->next) {
 -				if (win->workspace_hook) { /* NULL for old files */
 -					lib_link_workspace_instance_hook(fd, win->workspace_hook, &wm->id);
 -				}
 -				win->scene = newlibadr(fd, wm->id.lib, win->scene);
 -				/* deprecated, but needed for versioning (will be NULL'ed then) */
 -				win->screen = newlibadr(fd, NULL, win->screen);
 -			}
 -			
 -			wm->id.tag &= ~LIB_TAG_NEED_LINK;
 -		}
 -	}
 -}
 -
 -/* ****************** READ GREASE PENCIL ***************** */
 -
 -/* relink's grease pencil data's refs */
 -static void lib_link_gpencil(FileData *fd, Main *main)
 -{
 -	for (bGPdata *gpd = main->gpencil.first; gpd; gpd = gpd->id.next) {
 -		if (gpd->id.tag & LIB_TAG_NEED_LINK) {
 -			IDP_LibLinkProperty(gpd->id.properties, fd);
 -			lib_link_animdata(fd, &gpd->id, gpd->adt);
 -
 -			gpd->id.tag &= ~LIB_TAG_NEED_LINK;
 -		}
 -	}
 -}
 -
 -/* relinks grease-pencil data - used for direct_link and old file linkage */
 -static void direct_link_gpencil(FileData *fd, bGPdata *gpd)
 -{
 -	bGPDlayer *gpl;
 -	bGPDframe *gpf;
 -	bGPDstroke *gps;
 -	bGPDpalette *palette;
 -
 -	/* we must firstly have some grease-pencil data to link! */
 -	if (gpd == NULL)
 -		return;
 -	
 -	/* relink animdata */
 -	gpd->adt = newdataadr(fd, gpd->adt);
 -	direct_link_animdata(fd, gpd->adt);
++	wm->message_bus = NULL;
+ 
 -	/* relink palettes */
 -	link_list(fd, &gpd->palettes);
 -	for (palette = gpd->palettes.first; palette; palette = palette->next) {
 -		link_list(fd, &palette->colors);
 -	}
 +	BLI_listbase_clear(&wm->jobs);
 +	BLI_listbase_clear(&wm->drags);
 +	
 +	wm->windrawable = NULL;
 +	wm->winactive = NULL;
 +	wm->initialized = 0;
 +	wm->op_undo_depth = 0;
 +	wm->is_interface_locked = 0;
 +}
  
 -	/* relink layers */
 -	link_list(fd, &gpd->layers);
 +static void lib_link_windowmanager(FileData *fd, Main *main)
 +{
 +	wmWindowManager *wm;
 +	wmWindow *win;
  	
 -	for (gpl = gpd->layers.first; gpl; gpl = gpl->next) {
 -		/* parent */
 -		gpl->parent = newlibadr(fd, gpd->id.lib, gpl->parent);
 -		/* relink frames */
 -		link_list(fd, &gpl->frames);
 -		gpl->actframe = newdataadr(fd, gpl->actframe);
 -		
 -		for (gpf = gpl->frames.first; gpf; gpf = gpf->next) {
 -			/* relink strokes (and their points) */
 -			link_list(fd, &gpf->strokes);
 -			
 -			for (gps = gpf->strokes.first; gps; gps = gps->next) {
 -				gps->points = newdataadr(fd, gps->points);
 -				
 -				/* the triangulation is not saved, so need to be recalculated */
 -				gps->triangles = NULL;
 -				gps->tot_triangles = 0;
 -				gps->flag |= GP_STROKE_RECALC_CACHES;
 -				/* the color pointer is not saved, so need to be recalculated using the color name */
 -				gps->palcolor = NULL;
 -				gps->flag |= GP_STROKE_RECALC_COLOR;
 +	for (wm = main->wm.first; wm; wm = wm->id.next) {
 +		if (wm->id.tag & LIB_TAG_NEED_LINK) {
 +			/* Note: WM IDProperties are never written to file, hence no need to read/link them here. */
 +			for (win = wm->windows.first; win; win = win->next) {
 +				if (win->workspace_hook) { /* NULL for old files */
 +					lib_link_workspace_instance_hook(fd, win->workspace_hook, &wm->id);
 +				}
 +				win->scene = newlibadr(fd, wm->id.lib, win->scene);
 +				/* deprecated, but needed for versioning (will be NULL'ed then) */
 +				win->screen = newlibadr(fd, NULL, win->screen);
 +	
 +				for (ScrArea *area = win->global_areas.first; area; area = area->next) {
 +					lib_link_area(fd, &wm->id, area);
 +				}
  			}
 +
 +			wm->id.tag &= ~LIB_TAG_NEED_LINK;
  		}
  	}
  }
diff --cc source/blender/blenloader/intern/versioning_280.c
index 00d578918fa,163df9987bb..84aab78ff18
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@@ -541,18 -554,60 +555,71 @@@ void do_versions_after_linking_280(Mai
  			}
  			BLI_freelistN(&scene->r.layers);
  		}
 +
 +		/* Avoid including ED_ stuff here. */
 +		extern void ED_screen_global_topbar_area_create(const struct bContext *, wmWindow *, const bScreen *);
 +
 +		for (wmWindowManager *wm = main->wm.first; wm; wm = wm->id.next) {
 +			for (wmWindow *win = wm->windows.first; win; win = win->next) {
 +				const bScreen *screen = BKE_workspace_active_screen_get(win->workspace_hook);
 +				/* Not sure if passing NULL as context is so great... */
 +				ED_screen_global_topbar_area_create(NULL, win, screen);
 +			}
 +		}
  	}
+ 
+ 	{
+ 		for (WorkSpace *workspace = main->workspaces.first; workspace; workspace = workspace->id.next) {
+ 			if (workspace->view_layer) {
+ 				/* During 2.8 work we temporarly stored view-layer in the
+ 				 * workspace directly, but should be stored there per-scene. */
+ 				for (Scene *scene = main->scene.first; scene; scene = scene->id.next) {
+ 					if (BLI_findindex(&scene->view_layers, workspace->view_layer) != -1) {
+ 						BKE_workspace_view_layer_set(workspace, workspace->view_layer, scene);
+ 						workspace->view_layer = NULL;
+ 					}
+ 				}
+ 			}
+ 			BLI_assert(workspace->view_layer == NULL);
+ 		}
+ 	}
+ 
+ 	{
+ 		/* Since we don't have access to FileData we check the (always valid) master collection of the group. */
+ 		for (Group *group = main->group.first; group; group = group->id.next) {
+ 			if (group->collection == NULL) {
+ 				BKE_group_init(group);
+ 				SceneCollection *sc = GROUP_MASTER_COLLECTION(group);
+ 				SceneCollection *sc_hidden = NULL;
+ 
+ 				for (GroupObject *go = group->gobject.first; go; go = go->next) {
+ 					if (go->ob->lay & group->layer) {
+ 						BKE_collection_object_add(&group->id, sc, go->ob);
+ 					}
+ 					else {
+ 						if (sc_hidden == NULL) {
+ 							sc_hidden = BKE_collection_add(&group->id, sc, COLLECTION_TYPE_GROUP_INTERNAL, "Hidden");
+ 						}
+ 						BKE_collection_object_add(&group->id, sc_hidden, go->ob);
+ 					}
+ 				}
+ 
+ 				if (sc_hidden != NULL) {
+ 					LayerCollection *layer_collection_master, *layer_collection_hidden;
+ 
+ 					layer_collection_master = group->view_layer->layer_collections.first;
+ 					layer_collection_hidden = layer_collection_master->layer_collections.first;
+ 
+ 					layer_collection_hidden->flag &= ~COLLECTION_VISIBLE;
+ 				}
+ 			}
+ 
+ 			GroupObject *go;
+ 			while ((go = BLI_pophead(&group->gobject))) {
+ 				MEM_freeN(go);
+ 			}
+ 		}
+ 	}
  }
  
  static void do_version_layer_collections_idproperties(ListBase *lb)



More information about the Bf-blender-cvs mailing list