[Bf-blender-cvs] [da49c11d5df] greasepencil-object: Cleanup: Rename material index field

Antonio Vazquez noreply at git.blender.org
Thu Apr 26 12:35:47 CEST 2018


Commit: da49c11d5df60a5a637190b9c5aec5f7e2578da3
Author: Antonio Vazquez
Date:   Tue Apr 24 18:08:39 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rBda49c11d5df60a5a637190b9c5aec5f7e2578da3

Cleanup: Rename material index field

Now the name is equal to other Blender areas.

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

M	source/blender/blenkernel/intern/gpencil.c
M	source/blender/blenloader/intern/versioning_280.c
M	source/blender/makesdna/DNA_gpencil_types.h
M	source/blender/makesrna/intern/rna_gpencil.c

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

diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c
index fef6344a557..1312bfae37a 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -2311,7 +2311,7 @@ void BKE_gpencil_material_index_remove(bGPdata *gpd, int index)
 			for (bGPDframe *gpf = gpl->frames.first; gpf; gpf = gpf->next) {
 				for (gps = gpf->strokes.first; gps; gps = gpsn) {
 					gpsn = gps->next;
-					if (gps->matindex == index) {
+					if (gps->mat_nr == index) {
 						if (gps->points) {
 							BKE_gpencil_free_stroke_weights(gps);
 							MEM_freeN(gps->points);
@@ -2321,8 +2321,8 @@ void BKE_gpencil_material_index_remove(bGPdata *gpd, int index)
 					}
 					else {
 						/* reassign strokes */
-						if (gps->matindex > index) {
-							gps->matindex--;
+						if (gps->mat_nr > index) {
+							gps->mat_nr--;
 						}
 					}
 				}
@@ -2345,7 +2345,7 @@ void BKE_gpencil_material_remap(struct bGPdata *gpd, const unsigned int *remap,
 		for (bGPDframe *gpf = gpl->frames.first; gpf; gpf = gpf->next) {
 			for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) {
 				/* reassign strokes */
-				MAT_NR_REMAP(gps->matindex);
+				MAT_NR_REMAP(gps->mat_nr);
 			}
 		}
 	}
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 20dafc4dbe8..dc70f624a69 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -791,7 +791,7 @@ void do_versions_after_linking_280(Main *main)
 						for (bGPDframe *gpf = gpl->frames.first; gpf; gpf = gpf->next) {
 							for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) {
 								if ((palette == gps->palette) && (STREQ(gps->colorname, palcolor->info))) {
-									gps->matindex = ob->totcol - 1;
+									gps->mat_nr = ob->totcol - 1;
 								}
 							}
 						}
diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h
index ecc1791e3b5..47ff1fedd00 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -201,7 +201,7 @@ typedef struct bGPDstroke {
 	char tmp_layerinfo[128];
 
 	float falloff;          /* runtime falloff factor (only for transform) */
-	int matindex;           /* index of the current used material */
+	int mat_nr;             /* material index */
 } bGPDstroke;
 
 /* bGPDstroke->flag */
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index f50786fa996..9e5309c2275 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -959,8 +959,8 @@ static void rna_def_gpencil_stroke(BlenderRNA *brna)
 
 	/* Material Index */
 	prop = RNA_def_property(srna, "material_index", PROP_INT, PROP_NONE);
-	RNA_def_property_int_sdna(prop, NULL, "matindex");
-	RNA_def_property_ui_text(prop, "Material Index", "Number of material used in this stroke");
+	RNA_def_property_int_sdna(prop, NULL, "mat_nr");
+	RNA_def_property_ui_text(prop, "Material Index", "Index of material used in this stroke");
 	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
 
 	/* Settings */



More information about the Bf-blender-cvs mailing list