[Bf-blender-cvs] [1fbd437ccf1] greasepencil-refactor: GPencil: Remove properties use_stroke_pattern and use_stroke_texture_mix

Antonio Vazquez noreply at git.blender.org
Thu Dec 12 10:20:20 CET 2019


Commit: 1fbd437ccf1421f4efd6363bce78cfd5648c8fec
Author: Antonio Vazquez
Date:   Thu Dec 12 10:07:51 2019 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rB1fbd437ccf1421f4efd6363bce78cfd5648c8fec

GPencil: Remove properties use_stroke_pattern and use_stroke_texture_mix

WIP: Still the flags are used in drawing code to keep old files running and compare results. Need to be removed later.

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

M	release/scripts/presets/gpencil_material/fill_only.py
M	release/scripts/presets/gpencil_material/stroke_and_fill.py
M	release/scripts/presets/gpencil_material/stroke_only.py
M	release/scripts/startup/bl_operators/presets.py
M	release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M	release/scripts/startup/bl_ui/properties_material_gpencil.py
M	release/scripts/startup/bl_ui/space_view3d.py
M	release/scripts/startup/bl_ui/space_view3d_toolbar.py
M	source/blender/makesrna/intern/rna_material.c

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

diff --git a/release/scripts/presets/gpencil_material/fill_only.py b/release/scripts/presets/gpencil_material/fill_only.py
index f99e6928557..9114155684b 100644
--- a/release/scripts/presets/gpencil_material/fill_only.py
+++ b/release/scripts/presets/gpencil_material/fill_only.py
@@ -7,8 +7,6 @@ gpcolor.stroke_style = 'SOLID'
 gpcolor.color = (0.0, 0.0, 0.0, 0.0)
 gpcolor.stroke_image = None
 gpcolor.pixel_size = 100.0
-gpcolor.use_stroke_pattern = False
-gpcolor.use_stroke_texture_mix = False
 gpcolor.mix_stroke_factor = 0.0
 gpcolor.alignment_mode = 'PATH'
 gpcolor.fill_style = 'SOLID'
diff --git a/release/scripts/presets/gpencil_material/stroke_and_fill.py b/release/scripts/presets/gpencil_material/stroke_and_fill.py
index c03cfc2bd22..a59ccdd68de 100644
--- a/release/scripts/presets/gpencil_material/stroke_and_fill.py
+++ b/release/scripts/presets/gpencil_material/stroke_and_fill.py
@@ -7,8 +7,6 @@ gpcolor.stroke_style = 'SOLID'
 gpcolor.color = (0.0, 0.0, 0.0, 1.0)
 gpcolor.stroke_image = None
 gpcolor.pixel_size = 100.0
-gpcolor.use_stroke_pattern = False
-gpcolor.use_stroke_texture_mix = False
 gpcolor.mix_stroke_factor = 0.0
 gpcolor.alignment_mode = 'PATH'
 gpcolor.fill_style = 'SOLID'
diff --git a/release/scripts/presets/gpencil_material/stroke_only.py b/release/scripts/presets/gpencil_material/stroke_only.py
index 8c814f39905..ffcba83a8b1 100644
--- a/release/scripts/presets/gpencil_material/stroke_only.py
+++ b/release/scripts/presets/gpencil_material/stroke_only.py
@@ -7,8 +7,6 @@ gpcolor.stroke_style = 'SOLID'
 gpcolor.color = (0.0, 0.0, 0.0, 1.0)
 gpcolor.stroke_image = None
 gpcolor.pixel_size = 100.0
-gpcolor.use_stroke_pattern = False
-gpcolor.use_stroke_texture_mix = False
 gpcolor.mix_stroke_factor = 0.0
 gpcolor.alignment_mode = 'PATH'
 gpcolor.fill_style = 'SOLID'
diff --git a/release/scripts/startup/bl_operators/presets.py b/release/scripts/startup/bl_operators/presets.py
index a8ef354cc1b..b11a7cc5803 100644
--- a/release/scripts/startup/bl_operators/presets.py
+++ b/release/scripts/startup/bl_operators/presets.py
@@ -672,8 +672,6 @@ class AddPresetGpencilMaterial(AddPresetBase, Operator):
         "gpcolor.color",
         "gpcolor.stroke_image",
         "gpcolor.pixel_size",
-        "gpcolor.use_stroke_pattern",
-        "gpcolor.use_stroke_texture_mix",
         "gpcolor.mix_stroke_factor",
         "gpcolor.alignment_mode",
         "gpcolor.fill_style",
diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
index b7d6495963d..0014b9dad32 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -694,11 +694,7 @@ class GreasePencilMaterialsPanel:
 
             if ma is not None and ma.grease_pencil is not None:
                 gpcolor = ma.grease_pencil
-                if (
-                    gpcolor.stroke_style == 'SOLID' or
-                    gpcolor.use_stroke_pattern or
-                    gpcolor.use_stroke_texture_mix
-                ):
+                if gpcolor.stroke_style == 'SOLID':
                     row = layout.row()
                     row.prop(gpcolor, "color", text="Stroke Base Color")
 
diff --git a/release/scripts/startup/bl_ui/properties_material_gpencil.py b/release/scripts/startup/bl_ui/properties_material_gpencil.py
index aa7e93622b6..9a0cf6178b4 100644
--- a/release/scripts/startup/bl_ui/properties_material_gpencil.py
+++ b/release/scripts/startup/bl_ui/properties_material_gpencil.py
@@ -154,14 +154,12 @@ class MATERIAL_PT_gpencil_strokecolor(GPMaterialButtonsPanel, Panel):
                 if gpcolor.mode == 'LINE':
                     col.prop(gpcolor, "pixel_size", text="UV Factor")
 
-                col.prop(gpcolor, "use_stroke_pattern", text="Use As Stencil Mask")
-                if gpcolor.use_stroke_pattern is False:
-                    col.prop(gpcolor, "use_stroke_texture_mix", text="Mix Color")
-                    if gpcolor.use_stroke_texture_mix is True:
-                        col.prop(gpcolor, "mix_stroke_factor", text="Factor", slider=True)
-
-            if (gpcolor.stroke_style == 'SOLID' or gpcolor.use_stroke_pattern or gpcolor.use_stroke_texture_mix):
-                col.prop(gpcolor, "color", text="Base Color")
+            row = col.row()
+            row.prop(gpcolor, "color", text="Base Color")
+
+            if gpcolor.stroke_style == 'TEXTURE':
+                row = col.row()
+                row.prop(gpcolor, "mix_stroke_factor", text="Factor", slider=True)
 
             if gpcolor.mode in {'DOTS', 'BOX'}:
                 col.prop(gpcolor, "alignment_mode")
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 7ebd5063156..cca99b0b597 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -351,7 +351,7 @@ class _draw_tool_settings_context_mode:
 
             if brush.gpencil_tool in {'DRAW', 'FILL'} and ma:
                 gp_style = ma.grease_pencil
-                if gp_style.stroke_style != 'TEXTURE' or gp_style.use_stroke_pattern:
+                if gp_style.stroke_style != 'TEXTURE':
                     row.separator(factor=0.4)
                     row.prop(settings, "use_vertex_color", text="",
                              icon='CHECKBOX_HLT' if settings.use_vertex_color else 'CHECKBOX_DEHLT')
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index b840d715b49..042cef03aae 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -2096,9 +2096,6 @@ class VIEW3D_PT_tools_grease_pencil_brush_mixcolor(View3DPanel, Panel):
             else:
                 ma = gp_settings.material
 
-        if ma and ma.grease_pencil.stroke_style == 'TEXTURE' and ma.grease_pencil.use_stroke_pattern is False:
-            return False
-
         return True
 
     def draw_header(self, context):
@@ -2169,9 +2166,6 @@ class VIEW3D_PT_tools_grease_pencil_brush_mix_palette(View3DPanel, Panel):
             else:
                 ma = gp_settings.material
 
-        if ma and ma.grease_pencil.stroke_style == 'TEXTURE' and ma.grease_pencil.use_stroke_pattern is False:
-            return False
-
         return True
 
     def draw(self, context):
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c
index 1523da27d22..c862ac79518 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -583,21 +583,11 @@ static void rna_def_material_greasepencil(BlenderRNA *brna)
   RNA_def_property_ui_text(prop, "Mix Texture", "Mix texture image with filling color");
   RNA_def_property_update(prop, NC_GPENCIL | ND_SHADING, "rna_MaterialGpencil_update");
 
-  prop = RNA_def_property(srna, "use_stroke_texture_mix", PROP_BOOLEAN, PROP_NONE);
-  RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_STYLE_STROKE_TEX_MIX);
-  RNA_def_property_ui_text(prop, "Mix Texture", "Mix texture image with stroke color");
-  RNA_def_property_update(prop, NC_GPENCIL | ND_SHADING, "rna_MaterialGpencil_update");
-
   prop = RNA_def_property(srna, "flip", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_STYLE_COLOR_FLIP_FILL);
   RNA_def_property_ui_text(prop, "Flip", "Flip filling colors");
   RNA_def_property_update(prop, NC_GPENCIL | ND_SHADING, "rna_MaterialGpencil_update");
 
-  prop = RNA_def_property(srna, "use_stroke_pattern", PROP_BOOLEAN, PROP_NONE);
-  RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_STYLE_STROKE_PATTERN);
-  RNA_def_property_ui_text(prop, "Pattern", "Use Stroke Texture as a pattern to apply color");
-  RNA_def_property_update(prop, NC_GPENCIL | ND_SHADING, "rna_MaterialGpencil_update");
-
   prop = RNA_def_property(srna, "use_fill_pattern", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_STYLE_FILL_PATTERN);
   RNA_def_property_ui_text(prop, "Pattern", "Use Fill Texture as a pattern to apply color");



More information about the Bf-blender-cvs mailing list