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

Lukas Stockner noreply at git.blender.org
Wed Jun 27 23:53:17 CEST 2018


Commit: b33d272e9144d257dd07dffba78f1af93a0ded1b
Author: Lukas Stockner
Date:   Thu Jun 28 00:49:33 2018 +0200
Branches: temp-udim-images
https://developer.blender.org/rBb33d272e9144d257dd07dffba78f1af93a0ded1b

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

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



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

diff --cc source/blender/blenloader/intern/versioning_280.c
index 6a84fbfc227,06017668c02..6f132b14ab1
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@@ -1602,14 -1475,60 +1475,70 @@@ void blo_do_versions_280(FileData *fd, 
  				}
  			}
  		}
 +
+ 		if (!DNA_struct_elem_find(fd->filesdna, "SpaceAction", "char", "mode_prev")) {
+ 			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_ACTION) {
+ 							SpaceAction *saction = (SpaceAction *)sl;
+ 							/* "Dopesheet" should be default here, unless it looks like the Action Editor was active instead */
+ 							if ((saction->mode_prev == 0) && (saction->action == NULL)) {
+ 								saction->mode_prev = SACTCONT_DOPESHEET;
+ 							}
+ 						}
+ 					}
+ 				}
+ 			}
+ 		}
+ 
+ 		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_VIEW3D) {
+ 						View3D *v3d = (View3D *)sl;
+ 						if (v3d->drawtype == OB_TEXTURE) {
+ 							v3d->drawtype = OB_SOLID;
+ 							v3d->shading.light = V3D_LIGHTING_STUDIO;
+ 							v3d->shading.color_type = V3D_SHADING_TEXTURE_COLOR;
+ 						}
+ 					}
+ 				}
+ 			}
+ 		}
+ 
+ 	}
+ 
+ 	{
+ 		if (!DNA_struct_elem_find(fd->filesdna, "View3DOverlay", "float", "texture_paint_mode_opacity")) {
+ 			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_VIEW3D) {
+ 							View3D *v3d = (View3D *)sl;
+ 							float alpha = v3d->flag2 & V3D_SHOW_MODE_SHADE_OVERRIDE ? 0.0f : 0.8f;
+ 							v3d->overlay.texture_paint_mode_opacity = alpha;
+ 							v3d->overlay.vertex_paint_mode_opacity = alpha;
+ 							v3d->overlay.weight_paint_mode_opacity = alpha;
+ 						}
+ 					}
+ 				}
+ 			}
+ 		}
+ 
+ 		for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
+ 			if (scene->toolsettings->manipulator_flag == 0) {
+ 				scene->toolsettings->manipulator_flag = SCE_MANIP_TRANSLATE | SCE_MANIP_ROTATE | SCE_MANIP_SCALE;
+ 			}
+ 		}
++
 +		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/gpu/intern/gpu_draw.c
index 39b96785775,7383868843d..5463ac987a8
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@@ -686,33 -690,36 +686,33 @@@ void GPU_paint_set_mipmap(Main *bmain, 
  	GTS.texpaint = !mipmap;
  
  	if (mipmap) {
- 		for (Image *ima = G.main->image.first; ima; ima = ima->id.next) {
+ 		for (Image *ima = bmain->image.first; ima; ima = ima->id.next) {
 -			if (BKE_image_has_opengl_texture(ima)) {
 +			bool has_gputexture = false;
 +			LISTBASE_FOREACH(ImageTile *, tile, &ima->tiles) {
  				if (ima->tpageflag & IMA_MIPMAP_COMPLETE) {
 -					if (ima->gputexture[TEXTARGET_TEXTURE_2D]) {
 -						GPU_texture_bind(ima->gputexture[TEXTARGET_TEXTURE_2D], 0);
 +					GPUTexture *tex = tile->gputexture[TEXTARGET_TEXTURE_2D];
 +					if (tex) {
 +						GPU_texture_bind(tex, 0);
  						glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gpu_get_mipmap_filter(0));
  						glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gpu_get_mipmap_filter(1));
 -						GPU_texture_unbind(ima->gputexture[TEXTARGET_TEXTURE_2D]);
 +						GPU_texture_unbind(tex);
  					}
  				}
 -				else
 -					GPU_free_image(ima);
  			}
 -			else
 -				ima->tpageflag &= ~IMA_MIPMAP_COMPLETE;
 +			if (!has_gputexture) GPU_free_image(ima);
  		}
 -
  	}
  	else {
- 		for (Image *ima = G.main->image.first; ima; ima = ima->id.next) {
+ 		for (Image *ima = bmain->image.first; ima; ima = ima->id.next) {
 -			if (BKE_image_has_opengl_texture(ima)) {
 -				if (ima->gputexture[TEXTARGET_TEXTURE_2D]) {
 -					GPU_texture_bind(ima->gputexture[TEXTARGET_TEXTURE_2D], 0);
 +			LISTBASE_FOREACH(ImageTile *, tile, &ima->tiles) {
 +				GPUTexture *tex = tile->gputexture[TEXTARGET_TEXTURE_2D];
 +				if (tex) {
 +					GPU_texture_bind(tex, 0);
  					glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
  					glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gpu_get_mipmap_filter(1));
 -					GPU_texture_unbind(ima->gputexture[TEXTARGET_TEXTURE_2D]);
 +					GPU_texture_unbind(tex);
  				}
  			}
 -			else
 -				ima->tpageflag &= ~IMA_MIPMAP_COMPLETE;
  		}
  	}
  }



More information about the Bf-blender-cvs mailing list