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

Lukas Stockner noreply at git.blender.org
Wed Jul 4 15:18:29 CEST 2018


Commit: 54f50bd3ccef1fd7b7e3e587f59376c067a066d8
Author: Lukas Stockner
Date:   Wed Jul 4 15:00:12 2018 +0200
Branches: temp-udim-images
https://developer.blender.org/rB54f50bd3ccef1fd7b7e3e587f59376c067a066d8

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

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



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

diff --cc source/blender/blenloader/intern/versioning_280.c
index d47ef0c872d,757e17ce82b..3d2a43c68dd
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@@ -1532,26 -1533,50 +1534,72 @@@ void blo_do_versions_280(FileData *fd, 
  			}
  		}
  
+ 		if (!DNA_struct_elem_find(fd->filesdna, "RigidBodyWorld", "RigidBodyWorld_Shared", "*shared")) {
+ 			for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
+ 				RigidBodyWorld *rbw = scene->rigidbody_world;
+ 
+ 				if (rbw == NULL) {
+ 					continue;
+ 				}
+ 
+ 				if (rbw->shared == NULL) {
+ 					rbw->shared = MEM_callocN(sizeof(*rbw->shared), "RigidBodyWorld_Shared");
+ 				}
+ 
+ 				/* Move shared pointers from deprecated location to current location */
+ 				rbw->shared->pointcache = rbw->pointcache;
+ 				rbw->shared->ptcaches = rbw->ptcaches;
+ 
+ 				rbw->pointcache = NULL;
+ 				BLI_listbase_clear(&rbw->ptcaches);
+ 
+ 				if (rbw->shared->pointcache == NULL) {
+ 					rbw->shared->pointcache = BKE_ptcache_add(&(rbw->shared->ptcaches));
+ 				}
+ 
+ 			}
+ 		}
+ 
+ 		if (!DNA_struct_elem_find(fd->filesdna, "SoftBody", "SoftBody_Shared", "*shared")) {
+ 			for (Object *ob = bmain->object.first; ob; ob = ob->id.next) {
+ 				SoftBody *sb = ob->soft;
+ 				if (sb == NULL) {
+ 					continue;
+ 				}
+ 				if (sb->shared == NULL) {
+ 					sb->shared = MEM_callocN(sizeof(*sb->shared), "SoftBody_Shared");
+ 				}
+ 
+ 				/* Move shared pointers from deprecated location to current location */
+ 				sb->shared->pointcache = sb->pointcache;
+ 				sb->shared->ptcaches = sb->ptcaches;
+ 
+ 				sb->pointcache = NULL;
+ 				BLI_listbase_clear(&sb->ptcaches);
+ 			}
+ 		}
+ 
 +		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);
 +			}
 +		}
 +
 +		if (!DNA_struct_elem_find(fd->filesdna, "SpaceImage", "int", "tile_grid_shape[2]")) {
 +			for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
 +				for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
 +					for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
 +						if (sl->spacetype == SPACE_IMAGE) {
 +							SpaceImage *sima = (SpaceImage *)sl;
 +							sima->tile_grid_shape[0] = 1;
 +							sima->tile_grid_shape[1] = 1;
 +						}
 +					}
 +				}
 +			}
 +		}
++
  	}
  }
diff --cc source/blender/editors/sculpt_paint/paint_image.c
index 2766cdf8eb5,7f71270c52d..c367589e01b
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@@ -583,11 -587,12 +587,12 @@@ static void paint_stroke_done(const bCo
  				float color[3];
  
  				srgb_to_linearrgb_v3_v3(color, BKE_brush_color_get(scene, brush));
 -				paint_2d_bucket_fill(C, color, brush, pop->prevmouse, pop->custom_paint);
 +				paint_2d_bucket_fill(C, color, brush, pop->startmouse, pop->prevmouse, pop->custom_paint);
  			}
  			else {
- 				paint_proj_stroke(C, pop->custom_paint, pop->startmouse, pop->prevmouse, paint_stroke_flipped(stroke),
- 				                  1.0, 0.0, BKE_brush_size_get(scene, brush));
+ 				paint_proj_stroke(
+ 				        C, pop->custom_paint, pop->startmouse, pop->prevmouse, paint_stroke_flipped(stroke),
+ 				        1.0, 0.0, BKE_brush_size_get(scene, brush));
  				/* two redraws, one for GPU update, one for notification */
  				paint_proj_redraw(C, pop->custom_paint, false);
  				paint_proj_redraw(C, pop->custom_paint, true);
diff --cc source/blender/editors/sculpt_paint/paint_image_2d.c
index 99134687cbc,da08766b322..62daf39e278
--- a/source/blender/editors/sculpt_paint/paint_image_2d.c
+++ b/source/blender/editors/sculpt_paint/paint_image_2d.c
@@@ -464,8 -442,9 +464,9 @@@ static ImBuf *brush_painter_imbuf_new(B
  }
  
  /* update rectangular section of the brush image */
- static void brush_painter_imbuf_update(BrushPainter *painter, ImagePaintTile *tile, ImBuf *oldtexibuf,
-                                        int origx, int origy, int w, int h, int xt, int yt)
+ static void brush_painter_imbuf_update(
 -        BrushPainter *painter, ImBuf *oldtexibuf,
++        BrushPainter *painter, ImagePaintTile *tile, ImBuf *oldtexibuf,
+         int origx, int origy, int w, int h, int xt, int yt)
  {
  	Scene *scene = painter->scene;
  	Brush *brush = painter->brush;
@@@ -703,11 -682,12 +705,12 @@@ static void brush_painter_2d_refresh_ca
  		else if (!((brush->flag & BRUSH_ANCHORED) || update_color))
  			do_partial_update = true;
  
- 		brush_painter_2d_tex_mapping(s, tile->canvas, diameter, tile->start_paintpos, pos, mouse,
- 		                             brush->mtex.brush_map_mode, &painter->tex_mapping);
+ 		brush_painter_2d_tex_mapping(
 -		        s, diameter, painter->startpaintpos, pos, mouse,
++		        s, tile->canvas, diameter, tile->start_paintpos, pos, mouse,
+ 		        brush->mtex.brush_map_mode, &painter->tex_mapping);
  	}
  
 -	if (painter->cache.is_maskbrush) {
 +	if (cache->is_maskbrush) {
  		bool renew_maxmask = false;
  		bool do_partial_update_mask = false;
  		/* invalidate case for all mapping modes */
@@@ -736,11 -716,12 +739,12 @@@
  				cache->tex_mask = NULL;
  			}
  
- 			brush_painter_2d_tex_mapping(s, tile->canvas, diameter, tile->start_paintpos, pos, mouse,
- 			                             brush->mask_mtex.brush_map_mode, &painter->mask_mapping);
+ 			brush_painter_2d_tex_mapping(
 -			        s, diameter, painter->startpaintpos, pos, mouse,
++			        s, tile->canvas, diameter, tile->start_paintpos, pos, mouse,
+ 			        brush->mask_mtex.brush_map_mode, &painter->mask_mapping);
  
  			if (do_partial_update_mask)
 -				brush_painter_mask_imbuf_partial_update(painter, pos, diameter);
 +				brush_painter_mask_imbuf_partial_update(painter, tile, pos, diameter);
  			else
  				cache->tex_mask = brush_painter_mask_ibuf_new(painter, diameter);
  			cache->last_mask_rotation = mask_rotation;
@@@ -930,9 -865,10 +934,10 @@@ static void paint_2d_lift_soften(ImageP
  	in_off[1] = pos[1];
  	out_off[0] = out_off[1] = 0;
  
 -	if (!tile) {
 +	if (!paint_tile) {
- 		IMB_rectclip(ibuf, ibufb, &in_off[0], &in_off[1], &out_off[0],
- 		             &out_off[1], &dim[0], &dim[1]);
+ 		IMB_rectclip(
+ 		        ibuf, ibufb, &in_off[0], &in_off[1], &out_off[0],
+ 		        &out_off[1], &dim[0], &dim[1]);
  
  		if ((dim[0] == 0) || (dim[1] == 0))
  			return;
@@@ -963,9 -899,10 +968,10 @@@
  
  			for (yk = 0; yk < kernel->side; yk++) {
  				for (xk = 0; xk < kernel->side; xk++) {
- 					count += paint_2d_ibuf_add_if(ibuf, xi + xk - kernel->pixel_len,
- 					                               yi + yk - kernel->pixel_len, outrgb, paint_tile,
- 					                               kernel->wdata[xk + yk * kernel->side]);
+ 					count += paint_2d_ibuf_add_if(
+ 					        ibuf, xi + xk - kernel->pixel_len,
 -					        yi + yk - kernel->pixel_len, outrgb, tile,
++					        yi + yk - kernel->pixel_len, outrgb, paint_tile,
+ 					        kernel->wdata[xk + yk * kernel->side]);
  				}
  			}
  
@@@ -1061,13 -998,14 +1067,14 @@@ static void paint_2d_lift_smear(ImBuf *
  	int a, tot;
  
  	paint_2d_set_region(region, 0, 0, pos[0], pos[1], ibufb->x, ibufb->y);
 -	tot = paint_2d_torus_split_region(region, ibufb, ibuf, tile);
 +	tot = paint_2d_torus_split_region(region, ibufb, ibuf, paint_tile);
  
  	for (a = 0; a < tot; a++)
- 		IMB_rectblend(ibufb, ibufb, ibuf, NULL, NULL, NULL, 0, region[a].destx, region[a].desty,
- 		              region[a].destx, region[a].desty,
- 		              region[a].srcx, region[a].srcy,
- 		              region[a].width, region[a].height, IMB_BLEND_COPY, false);
+ 		IMB_rectblend(
+ 		        ibufb, ibufb, ibuf, NULL, NULL, NULL, 0, region[a].destx, region[a].desty,
+ 		        region[a].destx, region[a].desty,
+ 		        region[a].srcx, region[a].srcy,
+ 		        region[a].width, region[a].height, IMB_BLEND_COPY, false);
  }
  
  static ImBuf *paint_2d_lift_clone(ImBuf *ibuf, ImBuf *ibufb, int *pos)
@@@ -1092,14 -1032,16 +1101,15 @@@ static void paint_2d_convert_brushco(Im
  	ipos[1] = (int)floorf((pos[1] - ibufb->y / 2));
  }
  
- static void paint_2d_do_making_brush(ImagePaintState *s,
-                                      ImagePaintTile *tile,
-                                      ImagePaintRegion *region,
-                                      ImBuf *frombuf,
-                                      float mask_max,
-                                      short blend,
-                                      int tilex, int tiley,
-                                      int tilew, int tileh)
+ static void paint_2d_do_making_brush(
+         ImagePaintState *s,
++        ImagePaintTile *tile,
+         ImagePaintRegion *region,
 -        unsigned short *curveb,
 -        unsigned short *texmaskb,
+         ImBuf *frombuf,
+         float mask_max,
+         short blend,
+         int tilex, int tiley,
+         int tilew, int tileh)
  {
  	ImBuf tmpbuf;
  	IMB_initImBuf(&tmpbuf, IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE, 32, 0);
@@@ -1113,18 -1055,19 +1123,19 @@@
  			int origx = region->destx - tx * IMAPAINT_TILE_SIZE;
  			int origy = region->desty - ty * IMAPAINT_TILE_SIZE;
  
 -			if (s->canvas->rect_float)
 -				tmpbuf.rect_float = image_undo_find_tile(undo_tiles, s->image, s->canvas, tx, ty, &mask, false);
 +			if (tile->canvas->rect_float)
 +				tmpbuf.rect_float = image_undo_find_tile(undo_tiles, s->image, tile->canvas, tx, ty, &mask, false);
  			else
 -				tmpbuf.rect = image_undo_find_tile(undo_tiles, s->image, s->canvas, tx, ty, &mask, false);
 +				tmpbuf.rect = image_undo_find_tile(undo_tiles, s->image, tile->canvas, tx, ty, &mask, false);
  
- 			IMB_rectblend(tile->canvas, &tmpbuf, frombuf, mask,
- 			              tile->cache.curve_mask, tile->cache.tex_mask, mask_max,
- 			              region->destx, region->desty,
- 			              origx, origy,
- 			              region->srcx, region->srcy,
- 			              region->width, region->height,
- 			              blend, ((s->brush->flag & BRUSH_ACCUMULATE) != 0)

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list