[Bf-blender-cvs] [670d96f737d] greasepencil-object: GPencil: Cleanup unused code

Antonio Vazquez noreply at git.blender.org
Wed Jan 15 08:42:20 CET 2020


Commit: 670d96f737db9659b9551fa116b594d469c0c58c
Author: Antonio Vazquez
Date:   Wed Jan 15 08:40:23 2020 +0100
Branches: greasepencil-object
https://developer.blender.org/rB670d96f737db9659b9551fa116b594d469c0c58c

GPencil: Cleanup unused code

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

M	source/blender/editors/gpencil/drawgpencil.c
M	source/blender/editors/gpencil/gpencil_interpolate.c
M	source/blender/editors/gpencil/gpencil_paint.c
M	source/blender/makesrna/intern/rna_gpencil_modifier.c

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

diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 06e5f36637b..e0310a00886 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -379,44 +379,6 @@ static void gp_add_filldata_tobuffer(const bGPDspoint *pt,
   immVertex3fv(pos, fpt);            /* position */
 }
 
-#if 0 /* GPXX disabled, not used in annotations */
-/* assign image texture for filling stroke */
-static int gp_set_filling_texture(Image *image, short flag)
-{
-  ImBuf *ibuf;
-  uint *bind = &image->bindcode[TEXTARGET_TEXTURE_2D];
-  int error = GL_NO_ERROR;
-  ImageUser iuser = {NULL};
-  void *lock;
-
-  iuser.ok = true;
-
-  ibuf = BKE_image_acquire_ibuf(image, &iuser, &lock);
-
-  if (ibuf == NULL || ibuf->rect == NULL) {
-    BKE_image_release_ibuf(image, ibuf, NULL);
-    return (int)GL_INVALID_OPERATION;
-  }
-
-  GPU_create_gl_tex(
-      bind, ibuf->rect, ibuf->rect_float, ibuf->x, ibuf->y, GL_TEXTURE_2D, false, false, image);
-
-  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
-  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-  if (flag & GP_STYLE_COLOR_TEX_CLAMP) {
-    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
-    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
-  }
-  else {
-    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
-    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
-  }
-  BKE_image_release_ibuf(image, ibuf, NULL);
-
-  return error;
-}
-#endif
-
 /* draw fills for shapes */
 static void gp_draw_stroke_fill(bGPdata *gpd,
                                 bGPDstroke *gps,
@@ -462,13 +424,7 @@ static void gp_draw_stroke_fill(bGPdata *gpd,
   immUniform1f("texture_opacity", gp_style->texture_opacity);
   immUniform1i("t_mix", (gp_style->flag & GP_STYLE_FILL_TEX_MIX) != 0);
   immUniform1i("t_flip", (gp_style->flag & GP_STYLE_COLOR_FLIP_FILL) != 0);
-#if 0 /* GPXX disabled, not used in annotations */
-  /* image texture */
-  if ((gp_style->fill_style == GP_STYLE_FILL_STYLE_TEXTURE) ||
-      (gp_style->flag & GP_STYLE_COLOR_TEX_MIX)) {
-    gp_set_filling_texture(gp_style->ima, gp_style->flag);
-  }
-#endif
+
   /* Draw all triangles for filling the polygon (cache must be calculated before) */
   immBegin(GPU_PRIM_TRIS, gps->tot_triangles * 3);
   /* TODO: use batch instead of immediate mode, to share vertices */
diff --git a/source/blender/editors/gpencil/gpencil_interpolate.c b/source/blender/editors/gpencil/gpencil_interpolate.c
index ec26006eb06..40c95e66cb2 100644
--- a/source/blender/editors/gpencil/gpencil_interpolate.c
+++ b/source/blender/editors/gpencil/gpencil_interpolate.c
@@ -115,13 +115,6 @@ static void gp_interpolate_update_points(const bGPDstroke *gps_from,
     pt->pressure = interpf(prev->pressure, next->pressure, 1.0f - factor);
     pt->strength = interpf(prev->strength, next->strength, 1.0f - factor);
     CLAMP(pt->strength, GPENCIL_STRENGTH_MIN, 1.0f);
-
-    /* GPXX interpolate dverts */
-#if 0
-    MDeformVert *dvert = &new_stroke->dvert[i];
-    dvert->totweight = 0;
-    dvert->dw = NULL;
-#endif
   }
 }
 
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 5362390daa6..4f7465b47ce 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -1827,10 +1827,7 @@ static void gp_init_drawing_brush(bContext *C, tGPsdata *p)
   /* use radius of eraser */
   p->radius = (short)p->eraser->size;
 
-  /* GPXX: Need this update to synchronize brush with draw manager.
-   * Maybe this update can be removed when the new tool system
-   * will be in place, but while, we need this to keep drawing working.
-   */
+  /* Need this update to synchronize brush with draw manager. */
   if (changed) {
     DEG_id_tag_update(&scene->id, ID_RECALC_COPY_ON_WRITE);
   }
diff --git a/source/blender/makesrna/intern/rna_gpencil_modifier.c b/source/blender/makesrna/intern/rna_gpencil_modifier.c
index ac57287064e..cb51b8c8b42 100644
--- a/source/blender/makesrna/intern/rna_gpencil_modifier.c
+++ b/source/blender/makesrna/intern/rna_gpencil_modifier.c
@@ -1867,16 +1867,6 @@ static void rna_def_modifier_gpencilarmature(BlenderRNA *brna)
       prop, "Preserve Volume", "Deform rotation interpolation with quaternions");
   RNA_def_property_update(prop, 0, "rna_GpencilModifier_dependency_update");
 
-#  if 0 /* GPXX keep disabled now */
-  prop = RNA_def_property(srna, "use_multi_modifier", PROP_BOOLEAN, PROP_NONE);
-  RNA_def_property_boolean_sdna(prop, NULL, "multi", 0);
-  RNA_def_property_ui_text(
-      prop,
-      "Multi Modifier",
-      "Use same input as previous modifier, and mix results using overall vgroup");
-  RNA_def_property_update(prop, 0, "rna_GpencilModifier_dependency_update");
-#  endif
-
   prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
   RNA_def_property_string_sdna(prop, NULL, "vgname");
   RNA_def_property_ui_text(



More information about the Bf-blender-cvs mailing list