[Bf-blender-cvs] [f0d9dbae0da] blender2.8: Merge branch 'master' into blender2.8

Bastien Montagne noreply at git.blender.org
Tue Jun 5 17:03:10 CEST 2018


Commit: f0d9dbae0dae4deae84824833096c38e625073cb
Author: Bastien Montagne
Date:   Tue Jun 5 17:02:50 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBf0d9dbae0dae4deae84824833096c38e625073cb

Merge branch 'master' into blender2.8

Conflicts:
	source/blender/blenkernel/intern/blendfile.c
	source/blender/blenloader/intern/readfile.h
	source/blender/blenloader/intern/versioning_250.c
	source/blender/blenloader/intern/versioning_260.c
	source/blender/blenloader/intern/versioning_270.c
	source/blender/blenloader/intern/versioning_legacy.c
	source/blender/editors/render/render_shading.c
	source/blender/makesrna/intern/rna_movieclip.c
	source/blender/render/intern/source/pipeline.c
	source/blender/render/intern/source/voxeldata.c

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



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

diff --cc source/blender/blenkernel/intern/blendfile.c
index 34079d778f7,935000e3b8e..597c69408b5
--- a/source/blender/blenkernel/intern/blendfile.c
+++ b/source/blender/blenkernel/intern/blendfile.c
@@@ -172,16 -168,13 +173,16 @@@ static void setup_app_data
  		bool track_undo_scene;
  
  		/* comes from readfile.c */
- 		SWAP(ListBase, G.main->wm, bfd->main->wm);
- 		SWAP(ListBase, G.main->workspaces, bfd->main->workspaces);
- 		SWAP(ListBase, G.main->screen, bfd->main->screen);
+ 		SWAP(ListBase, bmain->wm, bfd->main->wm);
++		SWAP(ListBase, bmain->workspaces, bfd->main->workspaces);
+ 		SWAP(ListBase, bmain->screen, bfd->main->screen);
  
 -		/* we re-use current screen */
 +		/* we re-use current window and screen */
 +		win = CTX_wm_window(C);
  		curscreen = CTX_wm_screen(C);
 -		/* but use new Scene pointer */
 +		/* but use Scene pointer from new file */
  		curscene = bfd->curscene;
 +		cur_view_layer = bfd->cur_view_layer;
  
  		track_undo_scene = (mode == LOAD_UNDO && curscreen && curscene && bfd->main->wm.first);
  
@@@ -236,12 -222,11 +237,12 @@@
  	/* clear old property update cache, in case some old references are left dangling */
  	RNA_property_update_cache_free();
  
- 	G.main = bfd->main;
+ 	bmain = G.main = bfd->main;
  
- 	CTX_data_main_set(C, G.main);
+ 	CTX_data_main_set(C, bmain);
  
  	if (bfd->user) {
 +
  		/* only here free userdef themes... */
  		BKE_blender_userdef_data_set_and_free(bfd->user);
  		bfd->user = NULL;
@@@ -277,14 -262,12 +278,14 @@@
  
  	/* this can happen when active scene was lib-linked, and doesn't exist anymore */
  	if (CTX_data_scene(C) == NULL) {
 +		wmWindow *win = CTX_wm_window(C);
 +
  		/* in case we don't even have a local scene, add one */
- 		if (!G.main->scene.first)
- 			BKE_scene_add(G.main, "Empty");
+ 		if (!bmain->scene.first)
+ 			BKE_scene_add(bmain, "Empty");
  
- 		CTX_data_scene_set(C, G.main->scene.first);
+ 		CTX_data_scene_set(C, bmain->scene.first);
 -		CTX_wm_screen(C)->scene = CTX_data_scene(C);
 +		win->scene = CTX_data_scene(C);
  		curscene = CTX_data_scene(C);
  	}
  
@@@ -330,30 -313,23 +331,30 @@@
  	/* baseflags, groups, make depsgraph, etc */
  	/* first handle case if other windows have different scenes visible */
  	if (mode == LOAD_UI) {
- 		wmWindowManager *wm = G.main->wm.first;
+ 		wmWindowManager *wm = bmain->wm.first;
  
  		if (wm) {
 -			wmWindow *win;
 -
 -			for (win = wm->windows.first; win; win = win->next) {
 -				if (win->screen && win->screen->scene) /* zealous check... */
 -					if (win->screen->scene != curscene)
 -						BKE_scene_set_background(bmain, win->screen->scene);
 +			for (wmWindow *win = wm->windows.first; win; win = win->next) {
 +				if (win->scene && win->scene != curscene) {
- 					BKE_scene_set_background(G.main, win->scene);
++					BKE_scene_set_background(bmain, win->scene);
 +				}
  			}
  		}
  	}
 +
 +	/* Setting scene might require having a dependency graph, with copy on write
 +	 * we need to make sure we ensure scene has correct color management before
 +	 * constructing dependency graph.
 +	 */
 +	if (mode != LOAD_UNDO) {
- 		IMB_colormanagement_check_file_config(G.main);
++		IMB_colormanagement_check_file_config(bmain);
 +	}
 +
- 	BKE_scene_set_background(G.main, curscene);
+ 	BKE_scene_set_background(bmain, curscene);
  
  	if (mode != LOAD_UNDO) {
 +		/* TODO(sergey): Can this be also move above? */
  		RE_FreeAllPersistentData();
 -		IMB_colormanagement_check_file_config(bmain);
  	}
  
  	MEM_freeN(bfd);
diff --cc source/blender/blenloader/intern/readfile.c
index cb80246a803,4df79250125..4afde29d538
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@@ -10424,14 -10412,17 +10424,14 @@@ static void library_link_end(Main *main
  	BKE_main_id_tag_all(mainvar, LIB_TAG_NEW, false);
  
  	lib_verify_nodetree(mainvar, false);
- 	fix_relpaths_library(G.main->name, mainvar); /* make all relative paths, relative to the open blend file */
+ 	fix_relpaths_library(BKE_main_blendfile_path(mainvar), mainvar); /* make all relative paths, relative to the open blend file */
  
 -	/* Give a base to loose objects. If group append, do it for objects too.
 -	 * Only directly linked objects & groups are instantiated by `BLO_library_link_named_part_ex()` & co,
 +	/* Give a base to loose objects and collections.
 +	 * Only directly linked objects & collections are instantiated by `BLO_library_link_named_part_ex()` & co,
  	 * here we handle indirect ones and other possible edge-cases. */
  	if (scene) {
 -		give_base_to_objects(mainvar, scene, v3d, curlib, flag);
 -
 -		if (flag & FILE_GROUP_INSTANCE) {
 -			give_base_to_groups(mainvar, scene, v3d, curlib, flag);
 -		}
 +		add_collections_to_scene(mainvar, bmain, scene, view_layer, curlib, flag);
 +		add_loose_objects_to_scene(mainvar, bmain, scene, view_layer, curlib, flag);
  	}
  	else {
  		/* printf("library_append_end, scene is NULL (objects wont get bases)\n"); */
diff --cc source/blender/blenloader/intern/readfile.h
index 299c66f2bbb,ebb29b640e7..7618c023882
--- a/source/blender/blenloader/intern/readfile.h
+++ b/source/blender/blenloader/intern/readfile.h
@@@ -169,14 -167,12 +169,14 @@@ void blo_do_version_old_trackto_to_cons
  void blo_do_versions_view3d_split_250(struct View3D *v3d, struct ListBase *regions);
  void blo_do_versions_key_uidgen(struct Key *key);
  
- void blo_do_versions_pre250(struct FileData *fd, struct Library *lib, struct Main *main);
- 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 do_versions_after_linking_270(struct Main *main);
- void do_versions_after_linking_280(struct Main *main);
+ void blo_do_versions_pre250(struct FileData *fd, struct Library *lib, struct Main *bmain);
+ void blo_do_versions_250(struct FileData *fd, struct Library *lib, struct Main *bmain);
+ void blo_do_versions_260(struct FileData *fd, struct Library *lib, struct Main *bmain);
+ void blo_do_versions_270(struct FileData *fd, struct Library *lib, struct Main *bmain);
++void blo_do_versions_280(struct FileData *fd, struct Library *lib, struct Main *bmain);
+ 
+ void do_versions_after_linking_270(struct Main *bmain);
++void do_versions_after_linking_280(struct Main *bmain);
  
  #endif
  
diff --cc source/blender/blenloader/intern/versioning_250.c
index 3f85011db0b,39c47c90b89..d51289bee43
--- a/source/blender/blenloader/intern/versioning_250.c
+++ b/source/blender/blenloader/intern/versioning_250.c
@@@ -662,15 -750,44 +662,15 @@@ void blo_do_versions_250(FileData *fd, 
  
  		bSound *sound;
  		Sequence *seq;
 -		bActuator *act;
 -		int a;
  
- 		for (sound = main->sound.first; sound; sound = sound->id.next) {
+ 		for (sound = bmain->sound.first; sound; sound = sound->id.next) {
  			if (sound->newpackedfile) {
  				sound->packedfile = sound->newpackedfile;
  				sound->newpackedfile = NULL;
  			}
  		}
  
- 		for (scene = main->scene.first; scene; scene = scene->id.next) {
 -		for (ob = bmain->object.first; ob; ob = ob->id.next) {
 -			for (act = ob->actuators.first; act; act = act->next) {
 -				if (act->type == ACT_SOUND) {
 -					bSoundActuator *sAct = (bSoundActuator*) act->data;
 -					if (sAct->sound) {
 -						sound = blo_do_versions_newlibadr(fd, lib, sAct->sound);
 -						sAct->flag = (sound->flags & SOUND_FLAGS_3D) ? ACT_SND_3D_SOUND : 0;
 -						sAct->pitch = sound->pitch;
 -						sAct->volume = sound->volume;
 -						sAct->sound3D.reference_distance = sound->distance;
 -						sAct->sound3D.max_gain = sound->max_gain;
 -						sAct->sound3D.min_gain = sound->min_gain;
 -						sAct->sound3D.rolloff_factor = sound->attenuation;
 -					}
 -					else {
 -						sAct->sound3D.reference_distance = 1.0f;
 -						sAct->volume = 1.0f;
 -						sAct->sound3D.max_gain = 1.0f;
 -						sAct->sound3D.rolloff_factor = 1.0f;
 -					}
 -					sAct->sound3D.cone_inner_angle = 360.0f;
 -					sAct->sound3D.cone_outer_angle = 360.0f;
 -					sAct->sound3D.max_distance = FLT_MAX;
 -				}
 -			}
 -		}
 -
+ 		for (scene = bmain->scene.first; scene; scene = scene->id.next) {
  			if (scene->ed && scene->ed->seqbasep) {
  				SEQ_BEGIN (scene->ed, seq)
  				{
@@@ -703,9 -820,18 +703,9 @@@
  		/* shader, composite and texture node trees have id.name empty, put something in
  		 * to have them show in RNA viewer and accessible otherwise.
  		 */
- 		for (ma = main->mat.first; ma; ma = ma->id.next) {
+ 		for (ma = bmain->mat.first; ma; ma = ma->id.next) {
  			if (ma->nodetree && ma->nodetree->id.name[0] == '\0')
  				strcpy(ma->nodetree->id.name, "NTShader Nodetree");
 -
 -			/* which_output 0 is now "not specified" */
 -			for (a = 0; a < MAX_MTEX; a++) {
 -				if (ma->mtex[a]) {
 -					tx = blo_do_versions_newlibadr(fd, lib, ma->mtex[a]->tex);
 -					if (tx && tx->use_nodes)
 -						ma->mtex[a]->which_output++;
 -				}
 -			}
  		}
  
  		/* and composite trees */
@@@ -789,8 -915,9 +789,8 @@@
  		}
  	}
  
- 	if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 1)) {
+ 	if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 1)) {
  		Object *ob;
 -		Material *ma;
  		Tex *tex;
  		Scene *sce;
  		ToolSettings *ts;
@@@ -836,9 -963,65 +836,9 @@@
  				tex->afmax = 8;
  		}
  
- 		for (sce = main->scene.first; sce; sce = sce->id.next) {
 -		for (ma = bmain->mat.first; ma; ma = ma->id.next) {
 -			int a;
 -
 -			if (ma->mode & MA_WIRE) {
 -				ma->material_type = MA_TYPE_WIRE;
 -				ma->mode &= ~MA_WIRE;
 -			}
 -
 -			if (ma->mode & MA_HALO) {
 -				ma->material_type = MA_TYPE_HALO;
 -				ma->mode &= ~MA_HALO;
 -			}
 -
 -			if (ma->mode & (MA_ZTRANSP|MA_RAYTRANSP)) {
 -				ma->mode |= MA_TRANSP;
 -			}
 -			else {
 -				/* ma->mode |= MA_ZTRANSP; */ /* leave ztransp as is even if its not used [#28113] */
 -				ma->mode &= ~MA_TRANSP;
 -			}
 -
 -			/* set new bump for unused slots */
 -			for (a = 0; a < MAX_MTEX; a++) {
 -				if (ma->mtex[a]) {
 -					tex = ma->mtex[a]->tex;

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list