[Bf-blender-cvs] [f3547447136] temp-udim-images: Merge remote-tracking branch 'origin/blender2.8' into udim

Lukas Stockner noreply at git.blender.org
Wed Jun 20 19:13:32 CEST 2018


Commit: f35474471364dc2d4995de9b8c61aa17d99186d6
Author: Lukas Stockner
Date:   Wed Jun 20 02:25:48 2018 +0200
Branches: temp-udim-images
https://developer.blender.org/rBf35474471364dc2d4995de9b8c61aa17d99186d6

Merge remote-tracking branch 'origin/blender2.8' into udim

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



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

diff --cc intern/cycles/blender/blender_session.cpp
index af0e4814d23,eec13d04d7d..e5362568fc4
--- a/intern/cycles/blender/blender_session.cpp
+++ b/intern/cycles/blender/blender_session.cpp
@@@ -138,13 -138,9 +138,9 @@@ void BlenderSession::create_session(
  
  	/* setup callbacks for builtin image support */
  	scene->image_manager->builtin_image_info_cb = function_bind(&BlenderSession::builtin_image_info, this, _1, _2, _3);
 -	scene->image_manager->builtin_image_pixels_cb = function_bind(&BlenderSession::builtin_image_pixels, this, _1, _2, _3, _4, _5);
 -	scene->image_manager->builtin_image_float_pixels_cb = function_bind(&BlenderSession::builtin_image_float_pixels, this, _1, _2, _3, _4, _5);
 +	scene->image_manager->builtin_image_pixels_cb = function_bind(&BlenderSession::builtin_image_pixels, this, _1, _2, _3, _4, _5, _6);
 +	scene->image_manager->builtin_image_float_pixels_cb = function_bind(&BlenderSession::builtin_image_float_pixels, this, _1, _2, _3, _4, _5, _6);
  
- #ifdef WITH_OCIO
- 	scene->film->set_color_config(OCIO_getCurrentConfig());
- #endif
- 
  	session->scene = scene;
  
  	/* There is no single depsgraph to use for the entire render.
diff --cc source/blender/blenkernel/intern/image.c
index e7ff7433f91,b5abdcae2d4..d7aed7c8121
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@@ -3233,8 -3027,8 +3233,8 @@@ void BKE_image_release_renderresult(Sce
  bool BKE_image_is_openexr(struct Image *ima)
  {
  #ifdef WITH_OPENEXR
 -	if (ELEM(ima->source, IMA_SRC_FILE, IMA_SRC_SEQUENCE)) {
 +	if (ELEM(ima->source, IMA_SRC_FILE, IMA_SRC_SEQUENCE, IMA_SRC_TILED)) {
- 		return BLI_testextensie(ima->name, ".exr");
+ 		return BLI_path_extension_check(ima->name, ".exr");
  	}
  #else
  	UNUSED_VARS(ima);
diff --cc source/blender/blenloader/intern/readfile.c
index ed69c52bcf6,7eb6dbcb292..b2ec7400766
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@@ -1634,9 -1634,10 +1634,9 @@@ void blo_make_image_pointer_map(FileDat
  {
  	Image *ima = oldmain->image.first;
  	Scene *sce = oldmain->scene.first;
- 	
 -	int a;
+ 
  	fd->imamap = oldnewmap_new();
- 	
+ 
  	for (; ima; ima = ima->id.next) {
  		if (ima->cache)
  			oldnewmap_insert(fd->imamap, ima->cache, ima->cache, 0);
@@@ -1671,9 -1668,10 +1671,9 @@@ void blo_end_image_pointer_map(FileDat
  	OldNew *entry = fd->imamap->entries;
  	Image *ima = oldmain->image.first;
  	Scene *sce = oldmain->scene.first;
- 	
 -	int i;
+ 
  	/* used entries were restored, so we put them to zero */
 -	for (i = 0; i < fd->imamap->nentries; i++, entry++) {
 +	for (int i = 0; i < fd->imamap->nentries; i++, entry++) {
  		if (entry->nr > 0)
  			entry->newp = NULL;
  	}
diff --cc source/blender/blenloader/intern/versioning_280.c
index 1207d6bdd16,74ff53a45d9..6a84fbfc227
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@@ -1608,5 -1602,5 +1602,14 @@@ void blo_do_versions_280(FileData *fd, 
  				}
  			}
  		}
++
++		if (!DNA_struct_elem_find(fd->filesdna, "Image", "short", "num_tiles")) {
++			for (Image *ima = bmain->image.first; ima; ima = ima->id.next) {
++				ImageTile *tile = MEM_callocN(sizeof(ImageTile), "Image Tiles");
++				tile->ok = 1;
++				BLI_addtail(&ima->tiles, tile);
++			}
++		}
  	}
++	
  }
diff --cc source/blender/blenloader/intern/writefile.c
index c0356612fca,9c55c949fcf..a2525d62c76
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@@ -2259,9 -2259,9 +2259,11 @@@ static void write_image(WriteData *wd, 
  		}
  		writestruct(wd, DATA, Stereo3dFormat, 1, ima->stereo3d_format);
  
 +		writelist(wd, DATA, ImageTile, &ima->tiles);
 +
  		ima->packedfile = NULL;
+ 
+ 		writelist(wd, DATA, RenderSlot, &ima->renderslots);
  	}
  }
  
diff --cc source/blender/editors/sculpt_paint/paint_image_proj.c
index d6770196f6e,62bc379241f..64f7b00579e
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@@ -1069,11 -1049,9 +1071,11 @@@ static bool check_seam
  
  			/* Only need to check if 'i2_fidx' is valid because we know i1_fidx is the same vert on both faces */
  			if (i2_fidx != -1) {
- 				const float *lt_tri_uv[3] = { PS_LOOPTRI_AS_UV_3(ps->dm_mloopuv, lt) };
+ 				const float *lt_tri_uv[3] = { PS_LOOPTRI_AS_UV_3(ps->poly_to_loop_uv, lt) };
  				Image *tpage = project_paint_face_paint_image(ps, tri_index);
  				Image *orig_tpage = project_paint_face_paint_image(ps, orig_face);
 +				int tile = project_paint_face_paint_tile(tpage, lt_tri_uv[0]);
 +				int orig_tile = project_paint_face_paint_tile(orig_tpage, orig_lt_tri_uv[0]);
  
  				BLI_assert(i1_fidx != -1);
  
@@@ -2961,20 -2937,14 +2963,20 @@@ static void project_bucket_init
  		for (node = ps->bucketFaces[bucket_index]; node; node = node->next) {
  			tri_index = GET_INT_FROM_POINTER(node->link);
  
- 			const MLoopTri *lt = &ps->dm_mlooptri[tri_index];
- 			const float *lt_tri_uv[3] = { PS_LOOPTRI_AS_UV_3(ps->dm_mloopuv, lt) };
++			const MLoopTri *lt = &ps->mlooptri_eval[tri_index];
++			const float *lt_tri_uv[3] = { PS_LOOPTRI_AS_UV_3(ps->poly_to_loop_uv, lt) };
 +
  			/* Image context switching */
  			tpage = project_paint_face_paint_image(ps, tri_index);
 -			if (tpage_last != tpage) {
 +			int tile = project_paint_face_paint_tile(tpage, lt_tri_uv[0]);
 +			if (tpage_last != tpage || tile_last != tile) {
  				tpage_last = tpage;
 +				tile_last = tile;
  
  				for (image_index = 0; image_index < ps->image_tot; image_index++) {
 -					if (ps->projImages[image_index].ima == tpage_last) {
 -						ibuf = ps->projImages[image_index].ibuf;
 +					ProjPaintImage *projIma = &ps->projImages[image_index];
 +					if ((projIma->ima == tpage) && (projIma->tile == tile)) {
 +						ibuf = projIma->ibuf;
  						break;
  					}
  				}
@@@ -3736,9 -3668,7 +3725,9 @@@ static void project_paint_prepare_all_f
  	int image_index = -1, tri_index;
  	int prev_poly = -1;
  
 +	BLI_assert(ps->image_tot == 0);
 +
- 	for (tri_index = 0, lt = ps->dm_mlooptri; tri_index < ps->dm_totlooptri; tri_index++, lt++) {
+ 	for (tri_index = 0, lt = ps->mlooptri_eval; tri_index < ps->totlooptri_eval; tri_index++, lt++) {
  		bool is_face_sel;
  
  #ifndef PROJ_DEBUG_NOSEAMBLEED
@@@ -3776,10 -3706,8 +3765,10 @@@
  			tpage = ps->stencil_ima;
  		}
  
- 		ps->dm_mloopuv[lt->poly] = mloopuv_base;
+ 		ps->poly_to_loop_uv[lt->poly] = mloopuv_base;
  
 +		tile = project_paint_face_paint_tile(tpage, mloopuv_base[lt->tri[0]].uv);
 +
  		if (project_paint_clone_face_skip(ps, layer_clone, slot, tri_index)) {
  			continue;
  		}
diff --cc source/blender/makesdna/DNA_image_types.h
index b8327b11650,26d7f089f8b..b2f7f501129
--- a/source/blender/makesdna/DNA_image_types.h
+++ b/source/blender/makesdna/DNA_image_types.h
@@@ -113,11 -95,17 +113,11 @@@ typedef struct ImageTile 
  
  typedef struct Image {
  	ID id;
- 	
+ 
  	char name[1024];			/* file path, 1024 = FILE_MAX */
- 	
+ 
  	struct MovieCache *cache;	/* not written in file */
- 	
 -	struct GPUTexture *gputexture[2]; /* not written in file 2 = TEXTARGET_COUNT */
+ 
  	/* sources from: */
  	ListBase anims;
  	struct RenderResult *rr;



More information about the Bf-blender-cvs mailing list