[Bf-blender-cvs] [c7aecfc617e] temp-lineart-contained: LineArt: Change mask name.

YimingWu noreply at git.blender.org
Tue Jun 29 04:52:54 CEST 2021


Commit: c7aecfc617e890e208750bfe3085eaca2499f21f
Author: YimingWu
Date:   Mon Jun 28 21:40:18 2021 +0800
Branches: temp-lineart-contained
https://developer.blender.org/rBc7aecfc617e890e208750bfe3085eaca2499f21f

LineArt: Change mask name.

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

M	release/scripts/startup/bl_ui/properties_material.py
M	source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
M	source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
M	source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c
M	source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
M	source/blender/gpencil_modifiers/intern/lineart/lineart_ops.c
M	source/blender/makesdna/DNA_gpencil_modifier_types.h
M	source/blender/makesdna/DNA_material_types.h
M	source/blender/makesdna/intern/dna_rename_defs.h
M	source/blender/makesrna/intern/rna_gpencil_modifier.c
M	source/blender/makesrna/intern/rna_material.c

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

diff --git a/release/scripts/startup/bl_ui/properties_material.py b/release/scripts/startup/bl_ui/properties_material.py
index 80d62a63410..73f767213f4 100644
--- a/release/scripts/startup/bl_ui/properties_material.py
+++ b/release/scripts/startup/bl_ui/properties_material.py
@@ -291,12 +291,12 @@ class MATERIAL_PT_lineart(MaterialButtonsPanel, Panel):
         mat = context.material
         lineart = mat.lineart
 
-        layout.prop(lineart, "use_transparency")
+        layout.prop(lineart, "use_material_mask")
 
         row = layout.row(align=True, heading="Masks")
-        row.active = lineart.use_transparency
+        row.active = lineart.use_material_mask
         for i in range(8):
-            row.prop(lineart, "use_transparency_mask", text=str(i), index=i, toggle=True)
+            row.prop(lineart, "use_material_mask_bits", text=str(i), index=i, toggle=True)
 
         row = layout.row(align=True, heading="Custom occlusion effectiveness")
         row.active = lineart.use_occlusion_effectiveness
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
index 6bbab4faed9..12c0d121362 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
@@ -103,7 +103,7 @@ static void generate_strokes_actual(
       lmd->target_material ? BKE_gpencil_object_material_index_get(ob, lmd->target_material) : 0,
       lmd->edge_types,
       lmd->mask_switches,
-      lmd->transparency_mask,
+      lmd->material_mask_bits,
       lmd->intersection_mask,
       lmd->thickness,
       lmd->opacity,
@@ -469,7 +469,7 @@ static void occlusion_panel_draw(const bContext *UNUSED(C), Panel *panel)
   }
 }
 
-static void transparency_panel_draw_header(const bContext *UNUSED(C), Panel *panel)
+static void material_mask_panel_draw_header(const bContext *UNUSED(C), Panel *panel)
 {
   uiLayout *layout = panel->layout;
   PointerRNA ob_ptr;
@@ -481,10 +481,10 @@ static void transparency_panel_draw_header(const bContext *UNUSED(C), Panel *pan
   uiLayoutSetEnabled(layout, !is_baked);
   uiLayoutSetActive(layout, show_in_front);
 
-  uiItemR(layout, ptr, "use_transparency", 0, IFACE_("Transparency"), ICON_NONE);
+  uiItemR(layout, ptr, "use_material_mask", 0, IFACE_("Material Mask"), ICON_NONE);
 }
 
-static void transparency_panel_draw(const bContext *UNUSED(C), Panel *panel)
+static void material_mask_panel_draw(const bContext *UNUSED(C), Panel *panel)
 {
   uiLayout *layout = panel->layout;
   PointerRNA *ptr = gpencil_modifier_panel_get_property_pointers(panel, NULL);
@@ -494,21 +494,21 @@ static void transparency_panel_draw(const bContext *UNUSED(C), Panel *panel)
 
   uiLayoutSetPropSep(layout, true);
 
-  uiLayoutSetEnabled(layout, RNA_boolean_get(ptr, "use_transparency"));
+  uiLayoutSetEnabled(layout, RNA_boolean_get(ptr, "use_material_mask"));
 
   uiLayout *row = uiLayoutRow(layout, true);
   uiLayoutSetPropDecorate(row, false);
   uiLayout *sub = uiLayoutRowWithHeading(row, true, IFACE_("Masks"));
   char text[2] = "0";
 
-  PropertyRNA *prop = RNA_struct_find_property(ptr, "use_transparency_mask");
+  PropertyRNA *prop = RNA_struct_find_property(ptr, "use_material_mask_bits");
   for (int i = 0; i < 8; i++, text[0]++) {
     uiItemFullR(sub, ptr, prop, i, 0, UI_ITEM_R_TOGGLE, text, ICON_NONE);
   }
   uiItemL(row, "", ICON_BLANK1); /* Space for decorator. */
 
   uiLayout *col = uiLayoutColumn(layout, true);
-  uiItemR(col, ptr, "use_transparency_match", 0, IFACE_("Match All Masks"), ICON_NONE);
+  uiItemR(col, ptr, "use_material_mask_match", 0, IFACE_("Match All Masks"), ICON_NONE);
 }
 
 static void intersection_panel_draw_header(const bContext *UNUSED(C), Panel *panel)
@@ -737,10 +737,10 @@ static void panelRegister(ARegionType *region_type)
   PanelType *occlusion_panel = gpencil_modifier_subpanel_register(
       region_type, "occlusion", "Occlusion", NULL, occlusion_panel_draw, panel_type);
   gpencil_modifier_subpanel_register(region_type,
-                                     "transparency",
+                                     "material_mask",
                                      "",
-                                     transparency_panel_draw_header,
-                                     transparency_panel_draw,
+                                     material_mask_panel_draw_header,
+                                     material_mask_panel_draw,
                                      occlusion_panel);
   gpencil_modifier_subpanel_register(region_type,
                                      "intersection",
diff --git a/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h b/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
index a0ac7bba31c..03cbdd17558 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
+++ b/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
@@ -52,7 +52,7 @@ typedef struct LineartTriangle {
   /* first culled in line list to use adjacent triangle info, then go through triangle list. */
   double gn[3];
 
-  unsigned char transparency_mask;
+  unsigned char material_mask_bits;
   unsigned char intersection_mask;
   unsigned char occlusion_effectiveness;
   unsigned char flags; /* #eLineartTriangleFlags */
@@ -102,12 +102,8 @@ typedef struct LineartEdgeSegment {
   /** Occlusion level after "at" point */
   unsigned char occlusion;
 
-  /**
-   * For determining lines behind a glass window material.
-   * allows 6 materials for "transparent mask", from bits 1<<2 to 1<<7.
-   * bits 1<<0 and 1<<1 are for occlusion effectiveness value.
-   */
-  unsigned char transparency_mask;
+  /* Used to filter line art occlusion */
+  unsigned char material_mask_bits;
 } LineartEdgeSegment;
 
 typedef struct LineartVert {
@@ -178,7 +174,7 @@ typedef struct LineartEdgeChain {
 
   /** Chain now only contains one type of segments */
   int type;
-  unsigned char transparency_mask;
+  unsigned char material_mask_bits;
   unsigned char intersection_mask;
 
   struct Object *object_ref;
@@ -193,7 +189,7 @@ typedef struct LineartEdgeChainItem {
   float normal[3];
   unsigned char line_type;
   char occlusion;
-  unsigned char transparency_mask;
+  unsigned char material_mask_bits;
   size_t index;
 } LineartEdgeChainItem;
 
@@ -641,7 +637,7 @@ void MOD_lineart_gpencil_generate(LineartCache *cache,
                                   int mat_nr,
                                   short edge_types,
                                   unsigned char mask_switches,
-                                  unsigned char transparency_mask,
+                                  unsigned char material_mask_bits,
                                   unsigned char intersection_mask,
                                   short thickness,
                                   float opacity,
diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c
index a965adacacc..321e4a2b47b 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c
@@ -108,7 +108,7 @@ static LineartEdgeChainItem *lineart_chain_append_point(LineartRenderBuffer *rb,
                                                         float *normal,
                                                         char type,
                                                         int level,
-                                                        unsigned char transparency_mask,
+                                                        unsigned char material_mask_bits,
                                                         size_t index)
 {
   LineartEdgeChainItem *eci;
@@ -120,7 +120,7 @@ static LineartEdgeChainItem *lineart_chain_append_point(LineartRenderBuffer *rb,
     LineartEdgeChainItem *old_eci = ec->chain.last;
     old_eci->line_type = type;
     old_eci->occlusion = level;
-    old_eci->transparency_mask = transparency_mask;
+    old_eci->material_mask_bits = material_mask_bits;
     return old_eci;
   }
 
@@ -132,7 +132,7 @@ static LineartEdgeChainItem *lineart_chain_append_point(LineartRenderBuffer *rb,
   copy_v3_v3(eci->normal, normal);
   eci->line_type = type & LRT_EDGE_FLAG_ALL_TYPE;
   eci->occlusion = level;
-  eci->transparency_mask = transparency_mask;
+  eci->material_mask_bits = material_mask_bits;
   BLI_addtail(&ec->chain, eci);
 
   return eci;
@@ -145,7 +145,7 @@ static LineartEdgeChainItem *lineart_chain_prepend_point(LineartRenderBuffer *rb
                                                          float *normal,
                                                          char type,
                                                          int level,
-                                                         unsigned char transparency_mask,
+                                                         unsigned char material_mask_bits,
                                                          size_t index)
 {
   LineartEdgeChainItem *eci;
@@ -162,7 +162,7 @@ static LineartEdgeChainItem *lineart_chain_prepend_point(LineartRenderBuffer *rb
   copy_v3_v3(eci->normal, normal);
   eci->line_type = type & LRT_EDGE_FLAG_ALL_TYPE;
   eci->occlusion = level;
-  eci->transparency_mask = transparency_mask;
+  eci->material_mask_bits = material_mask_bits;
   BLI_addhead(&ec->chain, eci);
 
   return eci;
@@ -234,7 +234,7 @@ void MOD_lineart_chain_feature_lines(LineartRenderBuffer *rb)
                                 N,
                                 e->flags,
                                 es->occlusion,
-                                es->transparency_mask,
+                                es->material_mask_bits,
                                 e->v1_obindex);
     while (ba && (new_e = lineart_line_get_connected(
                       ba, new_vt, &new_vt, e->flags, ec->intersection_mask))) {
@@ -270,16 +270,16 @@ void MOD_lineart_chain_feature_lines(LineartRenderBuffer *rb)
                                       N,
                                       new_e->flags,
                                       es->occlusion,
-      

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list