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-29 13:47:28 +0300
committerYimingWu <xp8110@outlook.com>2021-06-29 13:48:59 +0300
commitdf7db41e1b6a349230870db3131bc954533af8f9 (patch)
treed046a53fedf38ded432d714a41a1f05b036c8d32
parentf2c52aa0e1a5a6905849daa299ab907e60cab983 (diff)
LineArt: Use separate sub panel for line types.
Reviewed By: Sebastian Parborg (zeddb) Differential Revision: https://developer.blender.org/D11735
-rw-r--r--source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c59
1 files changed, 38 insertions, 21 deletions
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
index 2a1eec80dd1..8739747082b 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
@@ -301,26 +301,6 @@ static void panel_draw(const bContext *UNUSED(C), Panel *panel)
else {
/* Source is Scene. */
}
-
- uiLayout *col = uiLayoutColumnWithHeading(layout, true, IFACE_("Edge Types"));
-
- uiItemR(col, ptr, "use_contour", 0, IFACE_("Contour"), ICON_NONE);
- uiItemR(col, ptr, "use_loose", 0, IFACE_("Loose"), ICON_NONE);
- uiItemR(col, ptr, "use_material", 0, IFACE_("Material Borders"), ICON_NONE);
- uiItemR(col, ptr, "use_edge_mark", 0, IFACE_("Edge Marks"), ICON_NONE);
- uiItemR(col, ptr, "use_intersection", 0, IFACE_("Intersections"), ICON_NONE);
-
- uiLayout *sub = uiLayoutRowWithHeading(col, false, IFACE_("Crease"));
- uiItemR(sub, ptr, "use_crease", 0, "", ICON_NONE);
- uiLayout *entry = uiLayoutRow(sub, false);
- uiLayoutSetEnabled(entry, RNA_boolean_get(ptr, "use_crease") || is_first);
- if (use_cache && !is_first) {
- uiItemL(entry, IFACE_("Angle Cached"), ICON_INFO);
- }
- else {
- uiItemR(entry, ptr, "crease_threshold", UI_ITEM_R_SLIDER, " ", ICON_NONE);
- }
-
uiItemPointerR(layout, ptr, "target_layer", &obj_data_ptr, "layers", NULL, ICON_GREASEPENCIL);
/* Material has to be used by grease pencil object already, it was possible to assign materials
@@ -345,6 +325,42 @@ static void panel_draw(const bContext *UNUSED(C), Panel *panel)
gpencil_modifier_panel_end(layout, ptr);
}
+static void edge_types_panel_draw(const bContext *UNUSED(C), Panel *panel)
+{
+ uiLayout *layout = panel->layout;
+ PointerRNA ob_ptr;
+ PointerRNA *ptr = gpencil_modifier_panel_get_property_pointers(panel, &ob_ptr);
+
+ const bool is_baked = RNA_boolean_get(ptr, "is_baked");
+ const bool use_cache = RNA_boolean_get(ptr, "use_cached_result");
+ const bool is_first = BKE_gpencil_is_first_lineart_in_stack(ob_ptr.data, ptr->data);
+
+ uiLayoutSetEnabled(layout, !is_baked);
+
+ uiLayoutSetPropSep(layout, true);
+
+ uiLayout *col = uiLayoutColumn(layout, true);
+
+ uiItemR(col, ptr, "use_contour", 0, IFACE_("Contour"), ICON_NONE);
+ uiItemR(col, ptr, "use_loose", 0, IFACE_("Loose"), ICON_NONE);
+ uiItemR(col, ptr, "use_material", 0, IFACE_("Material Borders"), ICON_NONE);
+ uiItemR(col, ptr, "use_edge_mark", 0, IFACE_("Edge Marks"), ICON_NONE);
+ uiItemR(col, ptr, "use_intersection", 0, IFACE_("Intersections"), ICON_NONE);
+
+ uiLayout *sub = uiLayoutRowWithHeading(col, false, IFACE_("Crease"));
+ uiItemR(sub, ptr, "use_crease", 0, "", ICON_NONE);
+ uiLayout *entry = uiLayoutRow(sub, false);
+ uiLayoutSetEnabled(entry, RNA_boolean_get(ptr, "use_crease") || is_first);
+ if (use_cache && !is_first) {
+ uiItemL(entry, IFACE_("Angle Cached"), ICON_INFO);
+ }
+ else {
+ uiItemR(entry, ptr, "crease_threshold", UI_ITEM_R_SLIDER, " ", ICON_NONE);
+ }
+
+ uiItemR(layout, ptr, "use_overlap_edge_type_support", 0, IFACE_("Allow Overlap"), ICON_NONE);
+}
+
static void options_panel_draw(const bContext *UNUSED(C), Panel *panel)
{
uiLayout *layout = panel->layout;
@@ -369,7 +385,6 @@ static void options_panel_draw(const bContext *UNUSED(C), Panel *panel)
uiItemR(col, ptr, "use_edge_overlap", 0, IFACE_("Overlapping Edges As Contour"), ICON_NONE);
uiItemR(col, ptr, "use_object_instances", 0, NULL, ICON_NONE);
uiItemR(col, ptr, "use_clip_plane_boundaries", 0, NULL, ICON_NONE);
- uiItemR(col, ptr, "use_overlap_edge_type_support", 0, NULL, ICON_NONE);
}
static void style_panel_draw(const bContext *UNUSED(C), Panel *panel)
@@ -600,6 +615,8 @@ static void panelRegister(ARegionType *region_type)
region_type, eGpencilModifierType_Lineart, panel_draw);
gpencil_modifier_subpanel_register(
+ region_type, "edge_types", "Edge Types", NULL, edge_types_panel_draw, panel_type);
+ gpencil_modifier_subpanel_register(
region_type, "geometry", "Geometry Processing", NULL, options_panel_draw, panel_type);
gpencil_modifier_subpanel_register(
region_type, "style", "Style", NULL, style_panel_draw, panel_type);