[Bf-blender-cvs] [a99f8129021] greasepencil-object: Merge branch 'blender2.8' into greasepencil-object

Antonio Vazquez noreply at git.blender.org
Fri Oct 6 23:57:04 CEST 2017


Commit: a99f81290217f68094e66b0c4b4c585209fe7883
Author: Antonio Vazquez
Date:   Fri Oct 6 23:56:56 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rBa99f81290217f68094e66b0c4b4c585209fe7883

Merge branch 'blender2.8' into greasepencil-object

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



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

diff --cc source/blender/blenloader/intern/versioning_280.c
index 9a093e069f0,bc011824c40..d5ec13547d8
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@@ -499,78 -430,25 +499,89 @@@ void blo_do_versions_280(FileData *fd, 
  				}
  			}
  		}
 +
 +		/* grease pencil sculpt and paint cursors */
 +		if (!DNA_struct_elem_find(fd->filesdna, "GP_BrushEdit_Settings", "int", "weighttype")) {
 +			for (Scene *scene = main->scene.first; scene; scene = scene->id.next) {
 +				/* sculpt brushes */
 +				GP_BrushEdit_Settings *gset = &scene->toolsettings->gp_sculpt;
 +				if (gset) {
 +					gset->weighttype = GP_EDITBRUSH_TYPE_WEIGHT;
 +				}
 +			}
 +		}
 +
 +		if (!DNA_struct_elem_find(fd->filesdna, "bGPDbrush", "float", "curcolor[3]")) {
 +			float curcolor[3], curcolor_add[3], curcolor_sub[3];
 +			ARRAY_SET_ITEMS(curcolor, 1.0f, 1.0f, 1.0f);
 +			ARRAY_SET_ITEMS(curcolor_add, 1.0f, 0.6f, 0.6f);
 +			ARRAY_SET_ITEMS(curcolor_sub, 0.6f, 0.6f, 1.0f);
 +			GP_EditBrush_Data *gp_brush;
 +
 +			for (Scene *scene = main->scene.first; scene; scene = scene->id.next) {
 +				/* drawing brushes */
 +				ToolSettings *ts = scene->toolsettings;
 +				for (bGPDbrush *brush = ts->gp_brushes.first; brush; brush = brush->next) {
 +					brush->flag |= GP_BRUSH_ENABLE_CURSOR;
 +					copy_v3_v3(brush->curcolor, curcolor);
 +				}
 +				/* sculpt brushes */
 +				GP_BrushEdit_Settings *gset = &ts->gp_sculpt;
 +				for (int i = 0; i < TOT_GP_EDITBRUSH_TYPES; ++i) {
 +					gp_brush = &gset->brush[i];
 +					gp_brush->flag |= GP_EDITBRUSH_FLAG_ENABLE_CURSOR;
 +					copy_v3_v3(gp_brush->curcolor_add, curcolor_add);
 +					copy_v3_v3(gp_brush->curcolor_sub, curcolor_sub);
 +				}
 +			}
 +		}
 +		/* init grease pencil vertex groups */
 +		if (!DNA_struct_elem_find(fd->filesdna, "bGPDweight", "int", "index")) {
 +			for (bGPdata *gpd = main->gpencil.first; gpd; gpd = gpd->id.next) {
 +				for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) {
 +					for (bGPDframe *gpf = gpl->frames.first; gpf; gpf = gpf->next) {
 +						for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) {
 +							for (int i = 0; i < gps->totpoints; ++i) {
 +								bGPDspoint *pt = &gps->points[i];
 +								pt->totweight = 0;
 +								pt->weights = NULL;
 +							}
 +						}
 +					}
 +				}
 +			}
 +		}
 +		/* init grease pencil edit line color */
 +		if (!DNA_struct_elem_find(fd->filesdna, "bGPdata", "float", "line_color[4]")) {
 +			for (bGPdata *gpd = main->gpencil.first; gpd; gpd = gpd->id.next) {
 +				ARRAY_SET_ITEMS(gpd->line_color, 0.6f, 0.6f, 0.6f, 0.3f);
 +			}
 +		}
 +		/* init pixel size factor */
 +		if (!DNA_struct_elem_find(fd->filesdna, "bGPDdata", "int", "pixfactor")) {
 +			for (bGPdata *gpd = main->gpencil.first; gpd; gpd = gpd->id.next) {
 +				gpd->pixfactor = GP_DEFAULT_PIX_FACTOR;
 +			}
 +		}
  	}
  
- 	if (!DNA_struct_elem_find(fd->filesdna, "Lamp", "float", "cascade_max_dist"))	{
- 		for (Lamp *la = main->lamp.first; la; la = la->id.next) {
- 			la->cascade_max_dist = 1000.0f;
- 			la->cascade_count = 4;
- 			la->cascade_exponent = 0.8f;
- 			la->cascade_fade = 0.1f;
+ 	{
+ 		if (!DNA_struct_elem_find(fd->filesdna, "Lamp", "float", "cascade_max_dist"))	{
+ 			for (Lamp *la = main->lamp.first; la; la = la->id.next) {
+ 				la->cascade_max_dist = 1000.0f;
+ 				la->cascade_count = 4;
+ 				la->cascade_exponent = 0.8f;
+ 				la->cascade_fade = 0.1f;
+ 			}
+ 		}
+ 
+ 		if (!DNA_struct_elem_find(fd->filesdna, "Lamp", "float", "contact_dist"))	{
+ 			for (Lamp *la = main->lamp.first; la; la = la->id.next) {
+ 				la->contact_dist = 1.0f;
+ 				la->contact_bias = 0.03f;
+ 				la->contact_spread = 0.2f;
+ 				la->contact_thickness = 0.5f;
+ 			}
  		}
  	}
  
diff --cc source/blender/makesdna/DNA_brush_types.h
index 06e710e9250,c285b44c939..c8d9cd2f9ff
--- a/source/blender/makesdna/DNA_brush_types.h
+++ b/source/blender/makesdna/DNA_brush_types.h
@@@ -391,18 -348,12 +396,24 @@@ typedef enum BlurKernelType 
  	KERNEL_BOX
  } BlurKernelType;
  
+ /* Brush.falloff_shape */
+ enum {
+ 	PAINT_FALLOFF_SHAPE_SPHERE = 0,
+ 	PAINT_FALLOFF_SHAPE_TUBE = 1,
+ };
+ 
  #define MAX_BRUSH_PIXEL_RADIUS 500
  
 +/* Grease Pencil Stroke styles */
 +#define STROKE_STYLE_SOLID	0
 +#define STROKE_STYLE_TEXTURE 1
 +
 +/* Grease Pencil Fill styles */
 +#define FILL_STYLE_SOLID	0
 +#define FILL_STYLE_GRADIENT	1
 +#define FILL_STYLE_RADIAL	2
 +#define FILL_STYLE_CHESSBOARD 3
 +#define FILL_STYLE_TEXTURE 4
 +#define FILL_STYLE_PATTERN 5
 +
  #endif  /* __DNA_BRUSH_TYPES_H__ */



More information about the Bf-blender-cvs mailing list