[Bf-blender-cvs] [ca20817c7c5] greasepencil-object: Rename field gpcolor to gp_style

Antonio Vazquez noreply at git.blender.org
Fri May 11 16:43:44 CEST 2018


Commit: ca20817c7c591e8946b971779f866a0957e7d41f
Author: Antonio Vazquez
Date:   Fri May 11 16:43:38 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rBca20817c7c591e8946b971779f866a0957e7d41f

Rename field gpcolor to gp_style

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

M	source/blender/blenkernel/intern/gpencil.c
M	source/blender/blenkernel/intern/library_query.c
M	source/blender/blenkernel/intern/material.c
M	source/blender/blenloader/intern/readfile.c
M	source/blender/blenloader/intern/versioning_280.c
M	source/blender/blenloader/intern/writefile.c
M	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
M	source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
M	source/blender/draw/engines/gpencil/gpencil_engine.c
M	source/blender/draw/engines/gpencil/gpencil_engine.h
M	source/blender/draw/engines/gpencil/gpencil_geom.c
M	source/blender/editors/gpencil/drawgpencil.c
M	source/blender/editors/gpencil/gpencil_add_monkey.c
M	source/blender/editors/gpencil/gpencil_colorpick.c
M	source/blender/editors/gpencil/gpencil_data.c
M	source/blender/editors/gpencil/gpencil_edit.c
M	source/blender/editors/gpencil/gpencil_fill.c
M	source/blender/editors/gpencil/gpencil_paint.c
M	source/blender/editors/gpencil/gpencil_utils.c
M	source/blender/editors/object/object_add.c
M	source/blender/makesdna/DNA_material_types.h
M	source/blender/makesrna/intern/rna_material.c
M	source/blender/modifiers/intern/MOD_gpencil_util.c
M	source/blender/modifiers/intern/MOD_gpencilcolor.c
M	source/blender/modifiers/intern/MOD_gpencilopacity.c
M	source/blender/modifiers/intern/MOD_gpenciltint.c

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

diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c
index d272c9f5b99..290ed877a29 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -1043,7 +1043,7 @@ Material *BKE_gpencil_color_ensure(Main *bmain, Object *ob)
 		ma = BKE_material_add_gpencil(bmain, DATA_("Material"));
 		assign_material(ob, ma, ob->totcol, BKE_MAT_ASSIGN_EXISTING);
 	}
-	else if (ma->gpcolor == NULL) {
+	else if (ma->gp_style == NULL) {
 			BKE_material_init_gpencil_settings(ma);
 	}
 
diff --git a/source/blender/blenkernel/intern/library_query.c b/source/blender/blenkernel/intern/library_query.c
index 0221d9ad0b0..e733a074256 100644
--- a/source/blender/blenkernel/intern/library_query.c
+++ b/source/blender/blenkernel/intern/library_query.c
@@ -633,9 +633,9 @@ void BKE_library_foreach_ID_link(Main *bmain, ID *id, LibraryIDLinkCallback call
 				if (material->texpaintslot != NULL) {
 					CALLBACK_INVOKE(material->texpaintslot->ima, IDWALK_CB_NOP);
 				}
-				if (material->gpcolor != NULL) {
-					CALLBACK_INVOKE(material->gpcolor->sima, IDWALK_CB_NOP);
-					CALLBACK_INVOKE(material->gpcolor->ima, IDWALK_CB_NOP);
+				if (material->gp_style != NULL) {
+					CALLBACK_INVOKE(material->gp_style->sima, IDWALK_CB_NOP);
+					CALLBACK_INVOKE(material->gp_style->ima, IDWALK_CB_NOP);
 				}
 				break;
 			}
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index 13cd9260618..90e6842dbc7 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -105,7 +105,7 @@ void BKE_material_free(Material *ma)
 
 	MEM_SAFE_FREE(ma->texpaintslot);
 
-	MEM_SAFE_FREE(ma->gpcolor);
+	MEM_SAFE_FREE(ma->gp_style);
 
 	BKE_icon_id_delete((ID *)ma);
 	BKE_previewimg_free(&ma->preview);
@@ -113,19 +113,19 @@ void BKE_material_free(Material *ma)
 
 void BKE_material_init_gpencil_settings(Material *ma)
 {
-	if ((ma) && (ma->gpcolor == NULL)) {
-		ma->gpcolor = MEM_callocN(sizeof(GpencilColorData), "Grease Pencil Material Settings");
+	if ((ma) && (ma->gp_style == NULL)) {
+		ma->gp_style = MEM_callocN(sizeof(GpencilColorData), "Grease Pencil Material Settings");
 
-		GpencilColorData *gpcolor = ma->gpcolor;
+		GpencilColorData *gp_style = ma->gp_style;
 		/* set basic settings */
-		gpcolor->rgb[3] = 1.0f;
-		gpcolor->g_boxsize = 0.1f;
-		gpcolor->g_radius = 0.5f;
-		ARRAY_SET_ITEMS(gpcolor->scolor, 1.0f, 1.0f, 1.0f, 0.2f);
-		ARRAY_SET_ITEMS(gpcolor->g_scale, 1.0f, 1.0f);
-		ARRAY_SET_ITEMS(gpcolor->t_scale, 1.0f, 1.0f);
-		gpcolor->t_opacity = 1.0f;
-		gpcolor->t_pixsize = 100.0f;
+		gp_style->rgb[3] = 1.0f;
+		gp_style->g_boxsize = 0.1f;
+		gp_style->g_radius = 0.5f;
+		ARRAY_SET_ITEMS(gp_style->scolor, 1.0f, 1.0f, 1.0f, 0.2f);
+		ARRAY_SET_ITEMS(gp_style->g_scale, 1.0f, 1.0f);
+		ARRAY_SET_ITEMS(gp_style->t_scale, 1.0f, 1.0f);
+		gp_style->t_opacity = 1.0f;
+		gp_style->t_pixsize = 100.0f;
 	}
 }
 
@@ -200,8 +200,8 @@ void BKE_material_copy_data(Main *bmain, Material *ma_dst, const Material *ma_sr
 		ma_dst->texpaintslot = MEM_dupallocN(ma_src->texpaintslot);
 	}
 
-	if (ma_src->gpcolor != NULL) {
-		ma_dst->gpcolor = MEM_dupallocN(ma_src->gpcolor);
+	if (ma_src->gp_style != NULL) {
+		ma_dst->gp_style = MEM_dupallocN(ma_src->gp_style);
 	}
 
 	BLI_listbase_clear(&ma_dst->gpumaterial);
@@ -239,7 +239,7 @@ Material *BKE_material_localize(Material *ma)
 	man->texpaintslot = NULL;
 	man->preview = NULL;
 
-	/* man->gpcolor = NULL; */ /* XXX: We probably don't want to clear here, or else we may get problems with COW later? */
+	/* man->gp_style = NULL; */ /* XXX: We probably don't want to clear here, or else we may get problems with COW later? */
 	BLI_listbase_clear(&man->gpumaterial);
 
 	/* TODO Duplicate Engine Settings and set runtime to NULL */
@@ -542,11 +542,11 @@ GpencilColorData *BKE_material_gpencil_settings_get(Object *ob, short act)
 {
 	Material *ma = give_current_material(ob, act);
 	if (ma != NULL) {
-		if (ma->gpcolor == NULL) {
+		if (ma->gp_style == NULL) {
 			BKE_material_init_gpencil_settings(ma);
 		}
 
-		return ma->gpcolor;
+		return ma->gp_style;
 	}
 	else {
 		return NULL;
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 07b8bab4c07..34700fa3321 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -4119,13 +4119,13 @@ static void lib_link_material(FileData *fd, Main *main)
 			}
 
 			/* relink grease pencil settings */
-			if (ma->gpcolor != NULL) {
-				GpencilColorData *gpcolor = ma->gpcolor;
-				if (gpcolor->sima != NULL) {
-					gpcolor->sima = newlibadr_us(fd, ma->id.lib, gpcolor->sima);
+			if (ma->gp_style != NULL) {
+				GpencilColorData *gp_style = ma->gp_style;
+				if (gp_style->sima != NULL) {
+					gp_style->sima = newlibadr_us(fd, ma->id.lib, gp_style->sima);
 				}
-				if (gpcolor->ima != NULL) {
-					gpcolor->ima = newlibadr_us(fd, ma->id.lib, gpcolor->ima);
+				if (gp_style->ima != NULL) {
+					gp_style->ima = newlibadr_us(fd, ma->id.lib, gp_style->ima);
 				}
 			}
 
@@ -4150,7 +4150,7 @@ static void direct_link_material(FileData *fd, Material *ma)
 	ma->preview = direct_link_preview_image(fd, ma->preview);
 	BLI_listbase_clear(&ma->gpumaterial);
 
-	ma->gpcolor = newdataadr(fd, ma->gpcolor);
+	ma->gp_style = newdataadr(fd, ma->gp_style);
 }
 
 /* ************ READ PARTICLE SETTINGS ***************** */
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 598bddaac0a..20c11e0630a 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -720,10 +720,10 @@ void do_versions_after_linking_280(Main *main)
 					assign_material(ob, ma, ob->totcol, BKE_MAT_ASSIGN_EXISTING);
 
 					/* copy color settings */
-					GpencilColorData *gpcolor = ma->gpcolor;
-					copy_v4_v4(gpcolor->rgb, palcolor->color);
-					copy_v4_v4(gpcolor->fill, palcolor->fill);
-					gpcolor->flag = palcolor->flag;
+					GpencilColorData *gp_style = ma->gp_style;
+					copy_v4_v4(gp_style->rgb, palcolor->color);
+					copy_v4_v4(gp_style->fill, palcolor->fill);
+					gp_style->flag = palcolor->flag;
 
 					/* fix strokes */
 					for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) {
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index b49104e0784..00d9429c9bb 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -2323,8 +2323,8 @@ static void write_material(WriteData *wd, Material *ma)
 		write_previews(wd, ma->preview);
 
 		/* grease pencil settings */
-		if (ma->gpcolor) {
-			writestruct(wd, DATA, GpencilColorData, 1, ma->gpcolor);
+		if (ma->gp_style) {
+			writestruct(wd, DATA, GpencilColorData, 1, ma->gp_style);
 		}
 	}
 }
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index d5a89b70724..ac2d3b5af40 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -1829,7 +1829,7 @@ void DepsgraphRelationBuilder::build_obdata_geom(Object *object)
 			 */
 			for (int i = 0; i < gpd->totcol; i++) {
 				Material *ma = gpd->mat[i];
-				if ((ma) && (ma->gpcolor)) {
+				if ((ma) && (ma->gp_style)) {
 					OperationKey material_key(&ma->id,
 					                          DEG_NODE_TYPE_SHADING,
 					                          DEG_OPCODE_MATERIAL_UPDATE);
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
index 20ef38c02a0..b00ea755f84 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
@@ -56,7 +56,7 @@
 
 /* create shading group for filling */
 static DRWShadingGroup *DRW_gpencil_shgroup_fill_create(GPENCIL_e_data *e_data, GPENCIL_Data *vedata, DRWPass *pass, 
-	GPUShader *shader, bGPdata *gpd, GpencilColorData *gpcolor, int id)
+	GPUShader *shader, bGPdata *gpd, GpencilColorData *gp_style, int id)
 {
 	GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl;
 
@@ -65,33 +65,33 @@ static DRWShadingGroup *DRW_gpencil_shgroup_fill_create(GPENCIL_e_data *e_data,
 	stl->g_data->tot_sh++;
 	stl->g_data->tot_sh_fill++;
 
-	DRW_shgroup_uniform_vec4(grp, "color2", gpcolor->scolor, 1);
-	stl->shgroups[id].fill_style = gpcolor->fill_style;
+	DRW_shgroup_uniform_vec4(grp, "color2", gp_style->scolor, 1);
+	stl->shgroups[id].fill_style = gp_style->fill_style;
 	DRW_shgroup_uniform_int(grp, "fill_type", &stl->shgroups[id].fill_style, 1);
-	DRW_shgroup_uniform_float(grp, "mix_factor", &gpcolor->mix_factor, 1);
+	DRW_shgroup_uniform_float(grp, "mix_factor", &gp_style->mix_factor, 1);
 
-	DRW_shgroup_uniform_float(grp, "g_angle", &gpcolor->g_angle, 1);
-	DRW_shgroup_uniform_float(grp, "g_radius", &gpcolor->g_radius, 1);
-	DRW_shgroup_uniform_float(grp, "g_boxsize", &gpcolor->g_boxsize, 1);
-	DRW_shgroup_uniform_vec2(grp, "g_scale", gpcolor->g_scale, 1);
-	DRW_shgroup_uniform_vec2(grp, "g_shift", gpcolor->g_shift, 1);
+	DRW_shgroup_uniform_float(grp, "g_angle", &gp_style->g_angle, 1);
+	DRW_shgroup_uniform_float(grp, "g_radius", &gp_style->g_radius, 1);
+	DRW_shgroup_uniform_float(grp, "g_boxsize", &gp_style->g_boxsize, 1);
+	DRW_shgroup_uniform_vec2(grp, "g_scale", gp_style->g_scale, 1);
+	DRW_shgroup_uniform_vec2(grp, "g_shift", gp_style->g_shift, 1);
 
-	DRW_shgroup_uniform_float(grp, "t_angle", &gpcolor->t_angle, 1);
-	DRW_shgroup_uniform_vec2(grp, "t_scale", gpcolor->t_scale, 1);
-	DRW_shgroup_uniform_vec2(grp, "t_offset", gpcolor->t_offset, 1);
-	DRW_shgroup_uniform_float(grp, "t_opacity", &gpcolor->t_opacity, 1);
+	DRW_shgroup_uniform_float(grp, "t_angle", &gp_style->t_angle, 1);
+	DRW_shgroup_uniform_vec2(grp, "t_scale", gp_style->t_scale, 1);
+	DRW_shgroup_uniform_vec2(grp, "t_offset", gp_style->t_offset, 1);
+	DRW_shgroup_uniform_float(grp, "t_opacity", 

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list