[Bf-blender-cvs] [7dc60eac130] greasepencil-object: Cleanup: Comments

Antonio Vazquez noreply at git.blender.org
Sun Apr 29 11:34:03 CEST 2018


Commit: 7dc60eac1309b26a0ac030924e7a96b01680dcd2
Author: Antonio Vazquez
Date:   Sun Apr 29 11:24:26 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rB7dc60eac1309b26a0ac030924e7a96b01680dcd2

Cleanup: Comments

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

M	source/blender/editors/gpencil/drawgpencil.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_paint.c

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

diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 35abfc06015..fbb30e83958 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -1070,7 +1070,7 @@ static void gp_draw_strokes(tGPDdraw *tgpw)
 			/* 3D Fill */
 			//if ((dflag & GP_DRAWDATA_FILL) && (gps->totpoints >= 3)) {
 			if ((gps->totpoints >= 3) && (tgpw->disable_fill != 1)) {
-				/* set color using palette, tint color and opacity */
+				/* set color using material, tint color and opacity */
 				interp_v3_v3v3(tfill, gpcolor->fill, tgpw->tintcolor, tgpw->tintcolor[3]);
 				tfill[3] = gpcolor->fill[3] * tgpw->opacity;
 				if ((tfill[3] > GPENCIL_ALPHA_OPACITY_THRESH) || (gpcolor->fill_style > 0)) {
@@ -1092,7 +1092,7 @@ static void gp_draw_strokes(tGPDdraw *tgpw)
 			}
 
 			/* 3D Stroke */
-			/* set color using palette, tint color and opacity */
+			/* set color using material tint color and opacity */
 			if (!tgpw->onion) {
 				interp_v3_v3v3(tcolor, gpcolor->rgb, tgpw->tintcolor, tgpw->tintcolor[3]);
 				tcolor[3] = gpcolor->rgb[3] * tgpw->opacity;
@@ -1137,7 +1137,7 @@ static void gp_draw_strokes(tGPDdraw *tgpw)
 		else {
 			/* 2D - Fill */
 			if (gps->totpoints >= 3) {
-				/* set color using palette, tint color and opacity */
+				/* set color using material, tint color and opacity */
 				interp_v3_v3v3(tfill, gpcolor->fill, tgpw->tintcolor, tgpw->tintcolor[3]);
 				tfill[3] = gpcolor->fill[3] * tgpw->opacity;
 				if ((tfill[3] > GPENCIL_ALPHA_OPACITY_THRESH) || (gpcolor->fill_style > 0)) {
@@ -1160,7 +1160,7 @@ static void gp_draw_strokes(tGPDdraw *tgpw)
 			}
 
 			/* 2D Strokes... */
-			/* set color using palette, tint color and opacity */
+			/* set color using material, tint color and opacity */
 			if (!tgpw->onion) {
 				interp_v3_v3v3(tcolor, gpcolor->rgb, tgpw->tintcolor, tgpw->tintcolor[3]);
 				tcolor[3] = gpcolor->rgb[3] * tgpw->opacity;
@@ -1237,7 +1237,7 @@ static void gp_draw_strokes_edit(
 		if ((gps->flag & GP_STROKE_SELECT) == 0)
 			continue;
 
-		/* verify palette color lock */
+		/* verify color lock */
 		{
 			Material *material = gpd->mat[gps->mat_nr];
 			GpencilColorData *gpcolor = material->gpcolor;
@@ -1268,7 +1268,7 @@ static void gp_draw_strokes_edit(
 		}
 
 		/* for now, we assume that the base color of the points is not too close to the real color */
-		/* set color using palette */
+		/* set color using material */
 		Material *material = gpd->mat[gps->mat_nr];
 		GpencilColorData *gpcolor = material->gpcolor;
 
diff --git a/source/blender/editors/gpencil/gpencil_colorpick.c b/source/blender/editors/gpencil/gpencil_colorpick.c
index f127d6d65f5..fd6864a758f 100644
--- a/source/blender/editors/gpencil/gpencil_colorpick.c
+++ b/source/blender/editors/gpencil/gpencil_colorpick.c
@@ -88,7 +88,7 @@ typedef struct tGPDpickColor {
 	char name[64];   /* color name. Must be unique. */
 	rcti full_rect;  /* full size of region occupied by color box (for event/highlight handling) */
 	rcti rect;       /* box position */
-	int index;       /* index of color in palette */
+	int index;       /* index of color in material slots */
 	float rgba[4];   /* color */
 	float fill[4];   /* fill color */
 	bool fillmode;   /* flag fill is not enabled */
@@ -114,7 +114,7 @@ typedef struct tGPDpick {
 
 	int totcolor;                       /* number of colors */
 	int curindex;                       /* index of color under cursor */
-	tGPDpickColor *colors;              /* colors of palette */
+	tGPDpickColor *colors;              /* colors of object */
 
 	void *draw_handle_3d;               /* handle for drawing strokes while operator is running */
 } tGPDpick;
@@ -163,7 +163,7 @@ static void gp_draw_pattern_box(int xmin, int ymin, int xmax, int ymax)
 	immUnbindProgram();
 }
 
-/* draw a toolbar with all colors of the palette */
+/* draw a toolbar with all colors of the object */
 static void gpencil_draw_color_table(const bContext *C, tGPDpick *tgpk)
 {
 	if (!tgpk->mat) {
diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c
index bf9cac34991..854690cc31d 100644
--- a/source/blender/editors/gpencil/gpencil_data.c
+++ b/source/blender/editors/gpencil/gpencil_data.c
@@ -2151,7 +2151,7 @@ void GPENCIL_OT_color_isolate(wmOperatorType *ot)
 		"the editability, also affect the visibility");
 }
 
-/* *********************** Hide Palette colors ******************************** */
+/* *********************** Hide colors ******************************** */
 
 static int gpencil_color_hide_exec(bContext *C, wmOperator *op)
 {
@@ -2393,7 +2393,7 @@ void GPENCIL_OT_color_select(wmOperatorType *ot)
 	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 }
 
-/* ***************** Choose Palette color by index ************************ */
+/* ***************** Choose color by index ************************ */
 static int gpencil_color_choose_exec(bContext *C, wmOperator *op)
 {
 	const int index = RNA_int_get(op->ptr, "index");
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index d5be21afc70..9478b37e6ee 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -689,7 +689,7 @@ void GPENCIL_OT_duplicate(wmOperatorType *ot)
 /* NOTE: is exposed within the editors/gpencil module so that other tools can use it too */
 ListBase gp_strokes_copypastebuf = {NULL, NULL};
 
-/* Hash for hanging on to all the palette colors used by strokes in the buffer
+/* Hash for hanging on to all the colors used by strokes in the buffer
  *
  * This is needed to prevent dangling and unsafe pointers when pasting across datablocks,
  * or after a color used by a stroke in the buffer gets deleted (via user action or undo).
@@ -3026,7 +3026,7 @@ static int gp_stroke_separate_exec(bContext *C, wmOperator *op)
 	base_new = ED_object_add_duplicate(bmain, scene, view_layer, base_old, 0);
 	ob_dst = base_new->object;
 
-	/* create new grease pencil datablock and copy paletteslots */
+	/* create new grease pencil datablock */
 	// XXX: check usercounts
 	gpd_dst = BKE_gpencil_data_addnew(bmain, "GPencil");
 	ob_dst->data = (bGPdata *)gpd_dst;
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 96ea192d30d..ced48f8c8ac 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -1554,7 +1554,7 @@ static void gp_init_drawing_brush(bContext *C, tGPsdata *p)
 }
 
 
-/* initialize a paint palette brush and a default color if not exist */
+/* initialize a paint brush and a default color if not exist */
 static void gp_init_colors(tGPsdata *p)
 {
 	bGPdata *gpd = p->gpd;
@@ -1566,8 +1566,8 @@ static void gp_init_colors(tGPsdata *p)
 	/* if the brush has a material defined, use this one and not current defaults */
 	mat = BKE_gpencil_get_color_from_brush(brush);
 
-	/* if no brush defaults, get color info
-	 * NOTE: _validate() ensures that everything we need will exist...
+	/* if no brush defaults, get material and color info
+	 * NOTE: Ensures that everything we need will exist...
 	 */
 	if ((mat == NULL) || (mat->gpcolor == NULL)){
 		p->material = BKE_gpencil_color_ensure(p->bmain, p->ob);
@@ -1575,7 +1575,7 @@ static void gp_init_colors(tGPsdata *p)
 	else {
 		p->material = mat;
 	}
-	/* assign color to temp tGPsdata */
+	/* assign color information to temp tGPsdata */
 	gpcolor = p->material->gpcolor;
 	if (gpcolor) {
 		
@@ -1672,7 +1672,7 @@ static bool gp_session_initdata(bContext *C, wmOperator *op, tGPsdata *p)
 					}
 				}
 				else {
-					/* create new default */
+					/* create new default object */
 					obact = ED_add_gpencil_object(C, p->scene, cur);
 					p->scene->gp_object = obact;
 				}
@@ -1801,15 +1801,15 @@ static bool gp_session_initdata(bContext *C, wmOperator *op, tGPsdata *p)
 	/* set brush and create a new one if null */
 	gp_init_drawing_brush(C, p);
 
-	/* setup active palette */
+	/* setup active color */
 	if (curarea->spacetype == SPACE_VIEW3D) {
-		/* NOTE: This is only done for 3D view, as Palettes aren't used for
+		/* NOTE: This is only done for 3D view, as Materials aren't used for
 		 *       annotations in 2D editors
 		 */
 		gp_init_colors(p);
 	}
 	else {
-		#if 1 /* XXX: Temporary hack only - Palettes won't be used here in future... */
+		#if 1 /* XXX: Temporary hack only - Materials won't be used here in future... */
 			gp_init_colors(p);
 		#endif
 	}



More information about the Bf-blender-cvs mailing list