[Bf-blender-cvs] [92e4f85686] workspaces: Merge branch 'blender2.8' into workspaces

Julian Eisel noreply at git.blender.org
Fri Feb 10 03:52:06 CET 2017


Commit: 92e4f8568626bd38ae4f87c713417a2906fcfd49
Author: Julian Eisel
Date:   Fri Feb 10 03:51:18 2017 +0100
Branches: workspaces
https://developer.blender.org/rB92e4f8568626bd38ae4f87c713417a2906fcfd49

Merge branch 'blender2.8' into workspaces

Conflicts:
	source/blender/blenkernel/intern/context.c
	source/blender/blenkernel/intern/depsgraph.c
	source/blender/blenkernel/intern/library_query.c
	source/blender/blenloader/intern/readfile.c
	source/blender/blenloader/intern/readfile.h
	source/blender/blenloader/intern/versioning_270.c
	source/blender/editors/workspace/screen_context.c
	source/blender/makesdna/intern/makesdna.c
	source/blenderplayer/bad_level_call_stubs/stubs.c

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



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

diff --cc source/blender/blenkernel/intern/library.c
index 40a323713a,2398c6724e..617b1360cf
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@@ -1668,10 -1787,15 +1798,15 @@@ void BKE_library_make_local
  
  		/* Do not explicitly make local non-linkable IDs (shapekeys, in fact), they are assumed to be handled
  		 * by real datablocks responsible of them. */
 -		const bool do_skip = (id && !BKE_idcode_is_linkable(GS(id->name)));
 +		const bool do_skip = (id && !BKE_idcode_is_appendable(GS(id->name)));
  
  		for (; id; id = id->next) {
+ 			ID *ntree = (ID *)ntreeFromID(id);
+ 
  			id->tag &= ~LIB_TAG_DOIT;
+ 			if (ntree != NULL) {
+ 				ntree->tag &= ~LIB_TAG_DOIT;
+ 			}
  
  			if (id->lib == NULL) {
  				id->tag &= ~(LIB_TAG_EXTERN | LIB_TAG_INDIRECT | LIB_TAG_NEW);
diff --cc source/blender/blenkernel/intern/library_query.c
index 4f385b3692,a071b3202b..52cf29fe92
--- a/source/blender/blenkernel/intern/library_query.c
+++ b/source/blender/blenkernel/intern/library_query.c
@@@ -866,42 -914,7 +909,42 @@@ void BKE_library_foreach_ID_link(Main *
  				break;
  			}
  
 +			case ID_WM:
 +			{
 +				wmWindowManager *wm = (wmWindowManager *)id;
 +
 +				for (wmWindow *win = wm->windows.first; win; win = win->next) {
 +					ID *workspace = BKE_workspace_id_get(win->workspace);
 +
- 					CALLBACK_INVOKE(win->scene, IDWALK_USER_ONE);
++					CALLBACK_INVOKE(win->scene, IDWALK_CB_USER_ONE);
 +
- 					CALLBACK_INVOKE_ID(workspace, IDWALK_NOP);
++					CALLBACK_INVOKE_ID(workspace, IDWALK_CB_NOP);
 +					/* allow callback to set a different workspace */
 +					win->workspace = (WorkSpace *)workspace;
 +				}
 +				break;
 +			}
 +
 +			case ID_WS:
 +			{
 +				WorkSpace *workspace = (WorkSpace *)id;
 +				ListBase *layouts = BKE_workspace_layouts_get(workspace);
 +
 +				BKE_workspace_layout_iter_begin(layout, layouts->first);
 +				{
 +					bScreen *screen = BKE_workspace_layout_screen_get(layout);
 +
- 					CALLBACK_INVOKE(screen, IDWALK_NOP);
++					CALLBACK_INVOKE(screen, IDWALK_CB_NOP);
 +					/* allow callback to set a different screen */
 +					BKE_workspace_layout_screen_set(layout, screen);
 +				}
 +				BKE_workspace_layout_iter_end;
 +
 +				break;
 +			}
 +
  			/* Nothing needed for those... */
 +			case ID_SCR:
  			case ID_IM:
  			case ID_VF:
  			case ID_TXT:
diff --cc source/blender/blenloader/intern/readfile.c
index 7ec2c0c1e9,da0650d02f..eb3f55492b
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@@ -5918,33 -5920,46 +5961,72 @@@ static void direct_link_view_settings(F
  		direct_link_curvemapping(fd, view_settings->curve_mapping);
  }
  
+ static void direct_link_scene_collection(FileData *fd, SceneCollection *sc)
+ {
+ 	link_list(fd, &sc->objects);
+ 	link_list(fd, &sc->filter_objects);
+ 	link_list(fd, &sc->scene_collections);
+ 
+ 	for (SceneCollection *nsc = sc->scene_collections.first; nsc; nsc = nsc->next) {
+ 		direct_link_scene_collection(fd, nsc);
+ 	}
+ }
+ 
+ static void direct_link_engine_settings(FileData *fd, ListBase *lb)
+ {
+ 	link_list(fd, lb);
+ 	for (CollectionEngineSettings *ces = lb->first; ces; ces = ces->next) {
+ 		link_list(fd, &ces->properties);
+ 	}
+ }
+ 
+ static void direct_link_layer_collections(FileData *fd, ListBase *lb)
+ {
+ 	link_list(fd, lb);
+ 	for (LayerCollection *lc = lb->first; lc; lc = lc->next) {
+ 		lc->scene_collection = newdataadr(fd, lc->scene_collection);
+ 
+ 		link_list(fd, &lc->object_bases);
+ 
+ 		for (LinkData *link = lc->object_bases.first; link; link = link->next) {
+ 			link->data = newdataadr(fd, link->data);
+ 		}
+ 
+ 		link_list(fd, &lc->overrides);
+ 
+ 		direct_link_engine_settings(fd, &lc->engine_settings);
+ 
+ 		direct_link_layer_collections(fd, &lc->layer_collections);
+ 	}
+ }
+ 
 -static void direct_link_scene(FileData *fd, Scene *sce)
 +/**
 + * bScreen data may use pointers to Scene data. bScreens are however read before Scenes, meaning
 + * FileData.datamap doesn't contain the Scene data when reading bScreens. This function should
 + * be called during Scene direct linking to update needed pointers within bScreen data.
 + *
 + * Maybe we could change read order so that screens are read after scene. But guess that
 + * would be asking for trouble. Depending on the write/read order sounds ugly anyway...
 + * -- Julian
 + */
 +static void direct_link_scene_update_screens(FileData *fd, const ListBase *screens)
 +{
 +	for (bScreen *screen = screens->first; screen; screen = screen->id.next) {
 +		for (ScrArea *area = screen->areabase.first; area; area = area->next) {
 +			for (SpaceLink *sl = area->spacedata.first; sl; sl = sl->next) {
 +				if (sl->spacetype == SPACE_VIEW3D) {
 +					View3D *v3d = (View3D *)sl;
 +
 +					if (v3d->custom_orientation) {
 +						v3d->custom_orientation = newdataadr(fd, v3d->custom_orientation);
 +					}
 +				}
 +			}
 +		}
 +	}
 +}
 +
 +static void direct_link_scene(FileData *fd, Scene *sce, Main *bmain)
  {
  	Editing *ed;
  	Sequence *seq;
@@@ -6201,7 -6218,23 +6285,25 @@@
  
  	direct_link_curvemapping(fd, &sce->r.mblur_shutter_curve);
  
+ 	/* this runs before the very first doversion */
+ 	if (sce->collection) {
+ 		sce->collection = newdataadr(fd, sce->collection);
+ 		direct_link_scene_collection(fd, sce->collection);
+ 	}
+ 
+ 	link_list(fd, &sce->render_layers);
+ 	for (sl = sce->render_layers.first; sl; sl = sl->next) {
+ 		link_list(fd, &sl->object_bases);
+ 		sl->basact = newdataadr(fd, sl->basact);
+ 		direct_link_layer_collections(fd, &sl->layer_collections);
+ 	}
+ 
+ 	link_list(fd, &sce->engines_settings);
+ 	for (res = sce->engines_settings.first; res; res = res->next) {
+ 		res->data = newdataadr(fd, res->data);
+ 	}
++
 +	direct_link_scene_update_screens(fd, &bmain->screen);
  }
  
  /* ************ READ WM ***************** */
@@@ -8482,11 -8505,12 +8593,13 @@@ static void do_versions(FileData *fd, L
  	/* don't forget to set version number in BKE_blender_version.h! */
  }
  
 -static void do_versions_after_linking(Main *main)
 +static void do_versions_after_linking(FileData *fd, Main *main)
  {
 +	blo_do_versions_after_linking_270(fd, main);
  //	printf("%s for %s (%s), %d.%d\n", __func__, main->curlib ? main->curlib->name : main->name,
  //	       main->curlib ? "LIB" : "MAIN", main->versionfile, main->subversionfile);
+ 	do_versions_after_linking_270(main);
+ 	do_versions_after_linking_280(main);
  }
  
  static void lib_link_all(FileData *fd, Main *main)
diff --cc source/blender/blenloader/intern/readfile.h
index 8d1471de78,50cdeca16b..446cbbc744
--- a/source/blender/blenloader/intern/readfile.h
+++ b/source/blender/blenloader/intern/readfile.h
@@@ -169,7 -171,10 +171,11 @@@ void blo_do_versions_pre250(struct File
  void blo_do_versions_250(struct FileData *fd, struct Library *lib, struct Main *main);
  void blo_do_versions_260(struct FileData *fd, struct Library *lib, struct Main *main);
  void blo_do_versions_270(struct FileData *fd, struct Library *lib, struct Main *main);
+ void blo_do_versions_280(struct FileData *fd, struct Library *lib, struct Main *main);
+ 
 +void blo_do_versions_after_linking_270(struct FileData *fd, struct Main *main);
+ void do_versions_after_linking_270(struct Main *main);
+ void do_versions_after_linking_280(struct Main *main);
  
  #endif
  
diff --cc source/blender/blenloader/intern/versioning_270.c
index 14d2dc0393,3bd84c5f5c..136cb8fdaa
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@@ -196,53 -200,54 +201,101 @@@ static void do_version_bones_super_bbon
  	}
  }
  
+ /* TODO(sergey): Consider making it somewhat more generic function in BLI_anim.h. */
+ static void anim_change_prop_name(FCurve *fcu,
+                                   const char *prefix,
+                                   const char *old_prop_name,
+                                   const char *new_prop_name)
+ {
+ 	const char *old_path = BLI_sprintfN("%s.%s", prefix, old_prop_name);
+ 	if (STREQ(fcu->rna_path, old_path)) {
+ 		MEM_freeN(fcu->rna_path);
+ 		fcu->rna_path = BLI_sprintfN("%s.%s", prefix, new_prop_name);
+ 	}
+ 	MEM_freeN((char *)old_path);
+ }
+ 
+ static void do_version_hue_sat_node(bNodeTree *ntree, bNode *node)
+ {
+ 	if (node->storage == NULL) {
+ 		return;
+ 	}
+ 
+ 	/* Make sure new sockets are properly created. */
+ 	node_verify_socket_templates(ntree, node);
+ 	/* Convert value from old storage to new sockets. */
+ 	NodeHueSat *nhs = node->storage;
+ 	bNodeSocket *hue = nodeFindSocket(node, SOCK_IN, "Hue"),
+ 	            *saturation = nodeFindSocket(node, SOCK_IN, "Saturation"),
+ 	            *value = nodeFindSocket(node, SOCK_IN, "Value");
+ 	((bNodeSocketValueFloat *)hue->default_value)->value = nhs->hue;
+ 	((bNodeSocketValueFloat *)saturation->default_value)->value = nhs->sat;
+ 	((bNodeSocketValueFloat *)value->default_value)->value = nhs->val;
+ 	/* Take care of possible animation. */
+ 	AnimData *adt = BKE_animdata_from_id(&ntree->id);
+ 	if (adt != NULL && adt->action != NULL) {
+ 		const char *prefix = BLI_sprintfN("nodes[\"%s\"]", node->name);
+ 		for (FCurve *fcu = adt->action->curves.first; fcu != NULL; fcu = fcu->next) {
+ 			if (STRPREFIX(fcu->rna_path, prefix)) {
+ 				anim_change_prop_name(fcu, prefix, "color_hue", "inputs[1].default_value");
+ 				anim_change_prop_name(fcu, prefix, "color_saturation", "inputs[2].default_value");
+ 				anim_change_prop_name(fcu, prefix, "color_value", "inputs[3].default_value");
+ 			}
+ 		}
+ 		MEM_freeN((char *)prefix);
+ 	}
+ 	/* Free storage, it is no longer used. */
+ 	MEM_freeN(node->storage);
+ 	node->storage = NULL;
+ }
+ 
 +/**
 + * \brief Before lib-link versioning for new workspace design.
 + *
 + * Adds a workspace for each screen of the old file and adds the needed workspace-layout to wrap the screen.
 + * Rest of the conversion is done in #do_version_workspaces_after_lib_link.
 + *
 + * Note that some of the created workspaces might be deleted again in case of reading the default startup.blend.
 + */
 +static void do_version_workspaces_before_lib_link(Main *main)
 +{
 +	BLI_assert(BLI_listbase_is_empty(&main->workspaces));
 +
 +	for (bScreen *screen = ma

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list