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:
Diffstat (limited to 'source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c')
-rw-r--r--source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c51
1 files changed, 32 insertions, 19 deletions
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
index fcc44aab583..bc6a9e53f11 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
@@ -432,6 +432,19 @@ static void occlusion_panel_draw(const bContext *UNUSED(C), Panel *panel)
}
}
+static bool anything_showing_through(PointerRNA *ptr)
+{
+ const bool use_multiple_levels = RNA_boolean_get(ptr, "use_multiple_levels");
+ const int level_start = RNA_int_get(ptr, "level_start");
+ const int level_end = RNA_int_get(ptr, "level_end");
+ if (use_multiple_levels) {
+ return (MAX2(level_start, level_end) > 0);
+ }
+ else {
+ return (level_start > 0);
+ }
+}
+
static void material_mask_panel_draw_header(const bContext *UNUSED(C), Panel *panel)
{
uiLayout *layout = panel->layout;
@@ -439,6 +452,7 @@ static void material_mask_panel_draw_header(const bContext *UNUSED(C), Panel *pa
const bool is_baked = RNA_boolean_get(ptr, "is_baked");
uiLayoutSetEnabled(layout, !is_baked);
+ uiLayoutSetActive(layout, anything_showing_through(ptr));
uiItemR(layout, ptr, "use_material_mask", 0, IFACE_("Material Mask"), ICON_NONE);
}
@@ -450,24 +464,24 @@ static void material_mask_panel_draw(const bContext *UNUSED(C), Panel *panel)
const bool is_baked = RNA_boolean_get(ptr, "is_baked");
uiLayoutSetEnabled(layout, !is_baked);
+ uiLayoutSetActive(layout, anything_showing_through(ptr));
uiLayoutSetPropSep(layout, true);
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";
+ uiLayout *col = uiLayoutColumn(layout, true);
+ uiLayout *sub = uiLayoutRowWithHeading(col, true, IFACE_("Masks"));
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);
+ for (int i = 0; i < 8; i++) {
+ uiItemFullR(sub, ptr, prop, i, 0, UI_ITEM_R_TOGGLE, " ", ICON_NONE);
+ if (i == 3) {
+ sub = uiLayoutRow(col, true);
+ }
}
- uiItemL(row, "", ICON_BLANK1); /* Space for decorator. */
- uiLayout *col = uiLayoutColumn(layout, true);
- uiItemR(col, ptr, "use_material_mask_match", 0, IFACE_("Match All Masks"), ICON_NONE);
+ uiItemR(layout, ptr, "use_material_mask_match", 0, IFACE_("Exact Match"), ICON_NONE);
}
static void intersection_panel_draw(const bContext *UNUSED(C), Panel *panel)
@@ -482,19 +496,18 @@ static void intersection_panel_draw(const bContext *UNUSED(C), Panel *panel)
uiLayoutSetActive(layout, RNA_boolean_get(ptr, "use_intersection"));
- uiLayout *row = uiLayoutRow(layout, true);
- uiLayoutSetPropDecorate(row, false);
- uiLayout *sub = uiLayoutRowWithHeading(row, true, IFACE_("Masks"));
- char text[2] = "0";
+ uiLayout *col = uiLayoutColumn(layout, true);
+ uiLayout *sub = uiLayoutRowWithHeading(col, true, IFACE_("Collection Masks"));
PropertyRNA *prop = RNA_struct_find_property(ptr, "use_intersection_mask");
- for (int i = 0; i < 8; i++, text[0]++) {
- uiItemFullR(sub, ptr, prop, i, 0, UI_ITEM_R_TOGGLE, text, ICON_NONE);
+ for (int i = 0; i < 8; i++) {
+ uiItemFullR(sub, ptr, prop, i, 0, UI_ITEM_R_TOGGLE, " ", ICON_NONE);
+ if (i == 3) {
+ sub = uiLayoutRow(col, true);
+ }
}
- uiItemL(row, "", ICON_BLANK1); /* Space for decorator. */
- uiLayout *col = uiLayoutColumn(layout, true);
- uiItemR(col, ptr, "use_intersection_match", 0, IFACE_("Match All Masks"), ICON_NONE);
+ uiItemR(layout, ptr, "use_intersection_match", 0, IFACE_("Exact Match"), ICON_NONE);
}
static void face_mark_panel_draw_header(const bContext *UNUSED(C), Panel *panel)
{
@@ -566,7 +579,7 @@ static void chaining_panel_draw(const bContext *UNUSED(C), Panel *panel)
uiItemR(col, ptr, "use_fuzzy_all", 0, NULL, ICON_NONE);
uiItemR(col, ptr, "use_loose_edge_chain", 0, IFACE_("Loose Edges"), ICON_NONE);
uiItemR(col, ptr, "use_loose_as_contour", 0, NULL, ICON_NONE);
- uiItemR(col, ptr, "use_geometry_space_chain", 0, NULL, ICON_NONE);
+ uiItemR(col, ptr, "use_geometry_space_chain", 0, IFACE_("Geometry Space"), ICON_NONE);
uiItemR(layout,
ptr,