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

Campbell Barton noreply at git.blender.org
Sun Jun 17 17:12:38 CEST 2018


Commit: f1daff28a041f7f944067746ee570760f04ff50b
Author: Campbell Barton
Date:   Sun Jun 17 17:12:26 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rBf1daff28a041f7f944067746ee570760f04ff50b

Merge branch 'blender2.8' into greasepencil-object

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



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

diff --cc source/blender/blenkernel/BKE_gpencil.h
index 3be6f3eaca4,3a951b7860d..bec53fa4567
--- a/source/blender/blenkernel/BKE_gpencil.h
+++ b/source/blender/blenkernel/BKE_gpencil.h
@@@ -90,34 -67,19 +90,34 @@@ void BKE_gpencil_make_local(struct Mai
  
  void BKE_gpencil_frame_delete_laststroke(struct bGPDlayer *gpl, struct bGPDframe *gpf);
  
 -struct bGPDpalette *BKE_gpencil_palette_addnew(struct bGPdata *gpd, const char *name, bool setactive);
 -struct bGPDpalette *BKE_gpencil_palette_duplicate(const struct bGPDpalette *palette_src);
 -struct bGPDpalettecolor *BKE_gpencil_palettecolor_addnew(struct bGPDpalette *palette, const char *name, bool setactive);
 +/* materials */
 +void BKE_gpencil_material_index_remove(struct bGPdata *gpd, int index);
 +void BKE_gpencil_material_remap(struct bGPdata *gpd, const unsigned int *remap, unsigned int remap_len);
 +
 +/* statistics functions */
 +void BKE_gpencil_stats_update(struct bGPdata *gpd);
 +
 +/* Utilities for creating and populating GP strokes */
- /* - Number of values defining each point in the built-in data 
-  *   buffers for primitives (e.g. 2D Monkey) 
++/* - Number of values defining each point in the built-in data
++ *   buffers for primitives (e.g. 2D Monkey)
 + */
 +#define GP_PRIM_DATABUF_SIZE  5
  
 -struct bGPDbrush *BKE_gpencil_brush_addnew(struct ToolSettings *ts, const char *name, bool setactive);
 -struct bGPDbrush *BKE_gpencil_brush_duplicate(const struct bGPDbrush *brush_src);
 -void BKE_gpencil_brush_init_presets(struct ToolSettings *ts);
 +void BKE_gpencil_stroke_add_points(
 +        struct bGPDstroke *gps,
 +        const float *array, const int totpoints,
 +        const float mat[4][4]);
  
 +struct bGPDstroke *BKE_gpencil_add_stroke(struct bGPDframe *gpf, int mat_idx, int totpoints, short thickness);
  
  /* Stroke and Fill - Alpha Visibility Threshold */
  #define GPENCIL_ALPHA_OPACITY_THRESH 0.001f
  #define GPENCIL_STRENGTH_MIN 0.003f
  
 +#define GPENCIL_MODIFIER_ACTIVE(_md, _is_render) (((_md->mode & eModifierMode_Realtime) && (_is_render == false)) || \
- 												  ((_md->mode & eModifierMode_Render) && (_is_render == true))) 
++												  ((_md->mode & eModifierMode_Render) && (_is_render == true)))
 +#define GPENCIL_MODIFIER_EDIT(_md, _is_edit) (((_md->mode & eModifierMode_Editmode) == 0) && (_is_edit))
 +
  bool gpencil_layer_is_editable(const struct bGPDlayer *gpl);
  
  /* How gpencil_layer_getframe() should behave when there
@@@ -141,55 -103,20 +141,55 @@@ struct bGPDlayer *BKE_gpencil_layer_get
  void BKE_gpencil_layer_setactive(struct bGPdata *gpd, struct bGPDlayer *active);
  void BKE_gpencil_layer_delete(struct bGPdata *gpd, struct bGPDlayer *gpl);
  
 -struct bGPDbrush *BKE_gpencil_brush_getactive(struct ToolSettings *ts);
 -void BKE_gpencil_brush_setactive(struct ToolSettings *ts, struct bGPDbrush *active);
 -void BKE_gpencil_brush_delete(struct ToolSettings *ts, struct bGPDbrush *brush);
 -
 -struct bGPDpalette *BKE_gpencil_palette_getactive(struct bGPdata *gpd);
 -void BKE_gpencil_palette_setactive(struct bGPdata *gpd, struct bGPDpalette *active);
 -void BKE_gpencil_palette_delete(struct bGPdata *gpd, struct bGPDpalette *palette);
 -void BKE_gpencil_palette_change_strokes(struct bGPdata *gpd);
 -
 -struct bGPDpalettecolor *BKE_gpencil_palettecolor_getactive(struct bGPDpalette *palette);
 -void BKE_gpencil_palettecolor_setactive(struct bGPDpalette *palette, struct bGPDpalettecolor *active);
 -void BKE_gpencil_palettecolor_delete(struct bGPDpalette *palette, struct bGPDpalettecolor *palcolor);
 -struct bGPDpalettecolor *BKE_gpencil_palettecolor_getbyname(struct bGPDpalette *palette, char *name);
 -void BKE_gpencil_palettecolor_changename(struct bGPdata *gpd, char *oldname, const char *newname);
 -void BKE_gpencil_palettecolor_delete_strokes(struct bGPdata *gpd, char *name);
 +struct Material *BKE_gpencil_get_material_from_brush(struct Brush *brush);
 +struct Material *BKE_gpencil_material_ensure(struct Main *bmain, struct Object *ob);
 +
 +/* object boundbox */
 +bool BKE_gpencil_stroke_minmax(
 +        const struct bGPDstroke *gps, const bool use_select,
 +        float r_min[3], float r_max[3]);
 +
 +struct BoundBox *BKE_gpencil_boundbox_get(struct Object *ob);
 +void BKE_gpencil_centroid_3D(struct bGPdata *gpd, float r_centroid[3]);
 +
 +/* vertex groups */
 +float BKE_gpencil_vgroup_use_index(struct MDeformVert *dvert, int index);
 +void BKE_gpencil_vgroup_remove(struct Object *ob, struct bDeformGroup *defgroup);
 +struct MDeformWeight *BKE_gpencil_vgroup_add_point_weight(struct MDeformVert *dvert, int index, float weight);
 +bool BKE_gpencil_vgroup_remove_point_weight(struct MDeformVert *dvert, int index);
 +void BKE_gpencil_stroke_weights_duplicate(struct bGPDstroke *gps_src, struct bGPDstroke *gps_dst);
 +
 +/* GPencil geometry evaluation */
 +void BKE_gpencil_eval_geometry(struct Depsgraph *depsgraph, struct bGPdata *gpd);
 +
 +/* modifiers */
 +bool BKE_gpencil_has_geometry_modifiers(struct Object *ob);
 +
 +void BKE_gpencil_stroke_modifiers(
- 		struct Depsgraph *depsgraph, struct Object *ob, 
++		struct Depsgraph *depsgraph, struct Object *ob,
 +		struct bGPDlayer *gpl, struct bGPDframe *gpf, struct bGPDstroke *gps, bool is_render);
 +void BKE_gpencil_geometry_modifiers(
- 		struct Depsgraph *depsgraph, struct Object *ob, 
++		struct Depsgraph *depsgraph, struct Object *ob,
 +		struct bGPDlayer *gpl, struct bGPDframe *gpf, bool is_render);
 +
 +void BKE_gpencil_instance_modifier_instance_tfm(struct InstanceGpencilModifierData *mmd, const int elem_idx[3], float r_mat[4][4]);
 +
 +void BKE_gpencil_lattice_init(struct Object *ob);
 +void BKE_gpencil_lattice_clear(struct Object *ob);
 +
 +/* stroke geometry utilities */
 +void BKE_gpencil_stroke_normal(const struct bGPDstroke *gps, float r_normal[3]);
 +void BKE_gpencil_simplify_stroke(struct bGPDstroke *gps, float factor);
 +void BKE_gpencil_simplify_fixed(struct bGPDstroke *gps);
 +
 +void BKE_gpencil_transform(struct bGPdata *gpd, float mat[4][4]);
 +
 +bool BKE_gpencil_smooth_stroke(struct bGPDstroke *gps, int i, float inf);
 +bool BKE_gpencil_smooth_stroke_strength(struct bGPDstroke *gps, int point_index, float influence);
 +bool BKE_gpencil_smooth_stroke_thickness(struct bGPDstroke *gps, int point_index, float influence);
 +bool BKE_gpencil_smooth_stroke_uv(struct bGPDstroke *gps, int point_index, float influence);
 +
 +void BKE_gpencil_get_range_selected(struct bGPDlayer *gpl, int *r_initframe, int *r_endframe);
 +float BKE_gpencil_multiframe_falloff_calc(struct bGPDframe *gpf, int actnum, int f_init, int f_end, struct CurveMapping *cur_falloff);
  
  #endif /*  __BKE_GPENCIL_H__ */
diff --cc source/blender/blenkernel/intern/anim_sys.c
index 4fc00d34536,fd7497f9ba1..b23469c23bf
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@@ -104,9 -104,8 +104,9 @@@ bool id_type_can_have_animdata(const sh
  		case ID_MSK:
  		case ID_GD:
  		case ID_CF:
 +		case ID_PAL:
  			return true;
- 		
+ 
  		/* no AnimData */
  		default:
  			return false;
@@@ -1247,12 -1243,9 +1247,12 @@@ void BKE_animdata_fix_paths_rename_all(
  	/* grease pencil */
  	RENAMEFIX_ANIM_IDS(bmain->gpencil.first);
  
 +	/* palettes */
 +	RENAMEFIX_ANIM_IDS(bmain->palettes.first);
 +
  	/* cache files */
  	RENAMEFIX_ANIM_IDS(bmain->cachefiles.first);
- 	
+ 
  	/* scenes */
  	RENAMEFIX_ANIM_NODETREE_IDS(bmain->scene.first, Scene);
  }
@@@ -2932,12 -2925,9 +2932,12 @@@ void BKE_animsys_evaluate_all_animation
  	/* grease pencil */
  	EVAL_ANIM_IDS(main->gpencil.first, ADT_RECALC_ANIM);
  
 +	/* palettes */
 +	EVAL_ANIM_IDS(main->palettes.first, ADT_RECALC_ANIM);
 +
  	/* cache files */
  	EVAL_ANIM_IDS(main->cachefiles.first, ADT_RECALC_ANIM);
- 	
+ 
  	/* objects */
  	/* ADT_RECALC_ANIM doesn't need to be supplied here, since object AnimData gets
  	 * this tagged by Depsgraph on framechange. This optimization means that objects
diff --cc source/blender/blenkernel/intern/colortools.c
index e05e4285d79,ff4795afe87..d18572a57f6
--- a/source/blender/blenkernel/intern/colortools.c
+++ b/source/blender/blenkernel/intern/colortools.c
@@@ -353,24 -352,6 +353,24 @@@ void curvemap_reset(CurveMap *cuma, con
  			cuma->curve[3].x = 1;
  			cuma->curve[3].y = 0;
  			break;
 +		case CURVE_PRESET_GAUSS:
 +			cuma->curve[0].x = 0;
 +			cuma->curve[0].y = 0.025f;
 +			cuma->curve[1].x = 0.16f;
 +			cuma->curve[1].y = 0.135f;
 +			cuma->curve[2].x = 0.298f;
 +			cuma->curve[2].y = 0.36f;
- 			
++
 +			cuma->curve[3].x = 0.50f;
 +			cuma->curve[3].y = 1.0f;
 +
 +			cuma->curve[4].x = 0.70f;
 +			cuma->curve[4].y = 0.36f;
 +			cuma->curve[5].x = 0.84f;
 +			cuma->curve[5].y = 0.135f;
 +			cuma->curve[6].x = 1.0f;
 +			cuma->curve[6].y = 0.025f;
 +			break;
  	}
  
  	/* mirror curve in x direction to have positive slope
diff --cc source/blender/blenkernel/intern/gpencil.c
index 27b1f181811,e89508fd6c0..6a12615c8c1
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@@ -191,45 -111,70 +191,45 @@@ void BKE_gpencil_free_frames(bGPDlayer 
  	gpl->actframe = NULL;
  }
  
 -/* Free all of a gp-colors */
 -static void free_gpencil_colors(bGPDpalette *palette)
 -{
 -	/* error checking */
 -	if (palette == NULL) {
 -		return;
 -	}
  
 -	/* free colors */
 -	BLI_freelistN(&palette->colors);
 -}
  
 -/* Free all of the gp-palettes and colors */
 -void BKE_gpencil_free_palettes(ListBase *list)
 +/* Free all of the gp-layers for a viewport (list should be &gpd->layers or so) */
 +void BKE_gpencil_free_layers(ListBase *list)
  {
 -	bGPDpalette *palette_next;
 +	bGPDlayer *gpl_next;
  
  	/* error checking */
 -	if (list == NULL) {
 -		return;
 -	}
 +	if (list == NULL) return;
  
 -	/* delete palettes */
 -	for (bGPDpalette *palette = list->first; palette; palette = palette_next) {
 -		palette_next = palette->next;
 -		/* free palette colors */
 -		free_gpencil_colors(palette);
 +	/* delete layers */
 +	for (bGPDlayer *gpl = list->first; gpl; gpl = gpl_next) {
 +		gpl_next = gpl->next;
- 		
+ 
 -		MEM_freeN(palette);
 +		/* free layers and their data */
 +		BKE_gpencil_free_frames(gpl);
 +		BLI_freelinkN(list, gpl);
  	}
 -	BLI_listbase_clear(list);
 

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list