Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYimingWu <xp8110@outlook.com>2021-06-28 17:26:23 +0300
committerYimingWu <xp8110@outlook.com>2021-06-28 17:26:23 +0300
commitcf21ba37efafbedc9e5d7f8624ce82370fe17a62 (patch)
tree4691123ee5fc43e8935b51c793d7e9b7b1aea9ec /source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
parent9c6a382f9540c8e334a16b7740b5ba6bb294fca9 (diff)
LineArt: Occlusion effectiveness support
This patch adds a function where you can specify occlusion effectiveness from 0 to 255 layers per face for a given mesh material. Reviewed By: Sebastian Parborg (zeddb) Ref D11308
Diffstat (limited to 'source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c')
-rw-r--r--source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
index b87ed9e431a..99f2592030e 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
@@ -101,8 +101,8 @@ static void generate_strokes_actual(
lmd->use_multiple_levels ? lmd->level_end : lmd->level_start,
lmd->target_material ? BKE_gpencil_object_material_index_get(ob, lmd->target_material) : 0,
lmd->edge_types,
- lmd->transparency_flags,
- lmd->transparency_mask,
+ lmd->material_mask_flags,
+ lmd->material_mask_bits,
lmd->thickness,
lmd->opacity,
lmd->source_vertex_group,
@@ -411,7 +411,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 *ptr = gpencil_modifier_panel_get_property_pointers(panel, NULL);
@@ -419,10 +419,10 @@ static void transparency_panel_draw_header(const bContext *UNUSED(C), Panel *pan
const bool is_baked = RNA_boolean_get(ptr, "is_baked");
uiLayoutSetEnabled(layout, !is_baked);
- 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);
@@ -432,21 +432,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 face_mark_panel_draw_header(const bContext *UNUSED(C), Panel *panel)
@@ -606,10 +606,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, "face_mark", "", face_mark_panel_draw_header, face_mark_panel_draw, panel_type);