[Bf-blender-cvs] [be33d3eccdc] master: UI: Tweak labels, descriptions, and panel layout for line art

Hans Goudey noreply at git.blender.org
Wed Mar 17 18:46:55 CET 2021


Commit: be33d3eccdcdf252201883ea681e261e967c87fc
Author: Hans Goudey
Date:   Wed Mar 17 13:46:41 2021 -0400
Branches: master
https://developer.blender.org/rBbe33d3eccdcdf252201883ea681e261e967c87fc

UI: Tweak labels, descriptions, and panel layout for line art

Changes include:
 - Use `IFACE_` for UI labels set in the modifier panels
 - Use a sub-sub-panel for transparency
 - Fix grammar and spelling mistakes
 - Use more natural user-friendly wording
 - Make descriptions more specific and more useful
 - Don't capitalize "line art" in descriptions (tooltips)

These changes are aimed at making the UI strings more consistent with
the rest of the UI and being more helpful to someone trying to understand
how to use the modifier.

Differential Revision: https://developer.blender.org/D10750

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

M	release/scripts/startup/bl_ui/properties_collection.py
M	source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
M	source/blender/gpencil_modifiers/intern/lineart/lineart_ops.c
M	source/blender/makesrna/intern/rna_collection.c
M	source/blender/makesrna/intern/rna_gpencil_modifier.c
M	source/blender/makesrna/intern/rna_material.c
M	source/blender/makesrna/intern/rna_object.c

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

diff --git a/release/scripts/startup/bl_ui/properties_collection.py b/release/scripts/startup/bl_ui/properties_collection.py
index fa4c3cdb779..186314f9591 100644
--- a/release/scripts/startup/bl_ui/properties_collection.py
+++ b/release/scripts/startup/bl_ui/properties_collection.py
@@ -62,8 +62,8 @@ class COLLECTION_PT_collection_flags(CollectionButtonsPanel, Panel):
         col.prop(vlc, "indirect_only", toggle=False)
 
 
-class COLLECTION_PT_lineart_collection(CollectionButtonsPanel, Panel):
-    bl_label = "Line Art"
+class COLLECTION_PT_instancing(CollectionButtonsPanel, Panel):
+    bl_label = "Instancing"
 
     def draw(self, context):
         layout = self.layout
@@ -72,10 +72,11 @@ class COLLECTION_PT_lineart_collection(CollectionButtonsPanel, Panel):
         collection = context.collection
 
         row = layout.row()
-        row.prop(collection, "lineart_usage")
+        row.prop(collection, "instance_offset")
 
-class COLLECTION_PT_instancing(CollectionButtonsPanel, Panel):
-    bl_label = "Instancing"
+
+class COLLECTION_PT_lineart_collection(CollectionButtonsPanel, Panel):
+    bl_label = "Line Art"
 
     def draw(self, context):
         layout = self.layout
@@ -84,12 +85,13 @@ class COLLECTION_PT_instancing(CollectionButtonsPanel, Panel):
         collection = context.collection
 
         row = layout.row()
-        row.prop(collection, "instance_offset")
+        row.prop(collection, "lineart_usage")
+
 
 classes = (
     COLLECTION_PT_collection_flags,
-    COLLECTION_PT_lineart_collection,
     COLLECTION_PT_instancing,
+    COLLECTION_PT_lineart_collection,
 )
 
 if __name__ == "__main__":  # only for live edit.
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
index 7fed771dabe..67563c5679f 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
@@ -267,29 +267,28 @@ static void panel_draw(const bContext *UNUSED(C), Panel *panel)
 
   uiLayout *col = uiLayoutColumnWithHeading(layout, true, IFACE_("Edge Types"));
 
-  uiItemR(col, ptr, "use_contour", 0, "Contour", ICON_NONE);
-  uiItemR(col, ptr, "use_material", 0, "Material", ICON_NONE);
-  uiItemR(col, ptr, "use_edge_mark", 0, "Edge Marks", ICON_NONE);
-  uiItemR(col, ptr, "use_intersection", 0, "Intersection", ICON_NONE);
+  uiItemR(col, ptr, "use_contour", 0, IFACE_("Contour"), 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);
+  uiItemR(col, ptr, "use_crease", 0, IFACE_("Crease"), ICON_NONE);
+  uiLayout *sub = uiLayoutRow(col, true);
+  uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_crease"));
+  uiLayoutSetPropSep(sub, true);
 
-  uiLayout *row = uiLayoutRow(col, true);
-  /* Don't automatically add the "animate property" button. */
-  uiLayoutSetPropDecorate(row, false);
-
-  const bool use_crease = RNA_boolean_get(ptr, "use_crease");
-  uiLayout *sub = uiLayoutRow(row, true);
-  uiItemR(sub, ptr, "use_crease", 0, "Crease", ICON_NONE);
-  sub = uiLayoutRow(sub, true);
-  uiLayoutSetEnabled(sub, use_crease);
-  uiItemR(sub, ptr, "crease_threshold", UI_ITEM_R_SLIDER, "", ICON_NONE);
-  uiItemDecoratorR(row, ptr, "crease_threshold", 0);
+  uiItemR(sub, ptr, "crease_threshold", UI_ITEM_R_SLIDER, " ", ICON_NONE);
 
   uiItemPointerR(layout, ptr, "target_layer", &obj_data_ptr, "layers", NULL, ICON_GREASEPENCIL);
   uiItemPointerR(
       layout, ptr, "target_material", &obj_data_ptr, "materials", NULL, ICON_SHADING_TEXTURE);
 
   uiItemR(layout, ptr, "remove_doubles", 0, NULL, ICON_NONE);
-  uiItemR(layout, ptr, "allow_overlapping_edges", 0, "Overlapping Edges As Contour", ICON_NONE);
+  uiItemR(layout,
+          ptr,
+          "allow_overlapping_edges",
+          0,
+          IFACE_("Overlapping Edges As Contour"),
+          ICON_NONE);
 
   gpencil_modifier_panel_end(layout, ptr);
 }
@@ -322,9 +321,8 @@ static void occlusion_panel_draw(const bContext *UNUSED(C), Panel *panel)
   uiLayoutSetEnabled(layout, !is_baked);
 
   const bool use_multiple_levels = RNA_boolean_get(ptr, "use_multiple_levels");
-  const bool use_transparency = RNA_boolean_get(ptr, "use_transparency");
 
-  uiItemR(layout, ptr, "use_multiple_levels", 0, "Multiple Levels", ICON_NONE);
+  uiItemR(layout, ptr, "use_multiple_levels", 0, IFACE_("Range"), ICON_NONE);
 
   if (use_multiple_levels) {
     uiLayout *col = uiLayoutColumn(layout, true);
@@ -332,28 +330,43 @@ static void occlusion_panel_draw(const bContext *UNUSED(C), Panel *panel)
     uiItemR(col, ptr, "level_end", 0, NULL, ICON_NONE);
   }
   else {
-    uiItemR(layout, ptr, "level_start", 0, "Level", ICON_NONE);
+    uiItemR(layout, ptr, "level_start", 0, IFACE_("Level"), ICON_NONE);
   }
+}
 
-  uiItemR(layout, ptr, "use_transparency", 0, "Transparency", ICON_NONE);
+static void transparency_panel_draw_header(const bContext *UNUSED(C), Panel *panel)
+{
+  uiLayout *layout = panel->layout;
+  PointerRNA *ptr = gpencil_modifier_panel_get_property_pointers(panel, NULL);
 
-  uiLayout *col = uiLayoutColumn(layout, true);
+  uiItemR(layout, ptr, "use_transparency", 0, IFACE_("Transparency"), ICON_NONE);
+}
 
-  if (use_transparency) {
-    uiItemR(col, ptr, "transparency_match", 0, "Match", ICON_NONE);
-  }
+static void transparency_panel_draw(const bContext *UNUSED(C), Panel *panel)
+{
+  uiLayout *layout = panel->layout;
+  PointerRNA *ptr = gpencil_modifier_panel_get_property_pointers(panel, NULL);
 
-  if (use_transparency) {
-    uiLayout *row = uiLayoutRow(col, true);
-    uiItemR(row, ptr, "transparency_mask_0", UI_ITEM_R_TOGGLE, "0", ICON_NONE);
-    uiItemR(row, ptr, "transparency_mask_1", UI_ITEM_R_TOGGLE, "1", ICON_NONE);
-    uiItemR(row, ptr, "transparency_mask_2", UI_ITEM_R_TOGGLE, "2", ICON_NONE);
-    uiItemR(row, ptr, "transparency_mask_3", UI_ITEM_R_TOGGLE, "3", ICON_NONE);
-    uiItemR(row, ptr, "transparency_mask_4", UI_ITEM_R_TOGGLE, "4", ICON_NONE);
-    uiItemR(row, ptr, "transparency_mask_5", UI_ITEM_R_TOGGLE, "5", ICON_NONE);
-    uiItemR(row, ptr, "transparency_mask_6", UI_ITEM_R_TOGGLE, "6", ICON_NONE);
-    uiItemR(row, ptr, "transparency_mask_7", UI_ITEM_R_TOGGLE, "7", ICON_NONE);
-  }
+  uiLayoutSetPropSep(layout, true);
+
+  uiLayoutSetActive(layout, RNA_boolean_get(ptr, "use_transparency"));
+
+  uiLayout *row = uiLayoutRow(layout, true);
+  uiLayoutSetPropDecorate(row, false);
+  uiLayout *sub = uiLayoutRow(row, true);
+  uiItemR(sub, ptr, "transparency_mask_0", UI_ITEM_R_TOGGLE, IFACE_("0"), ICON_NONE);
+  uiItemR(sub, ptr, "transparency_mask_1", UI_ITEM_R_TOGGLE, IFACE_("1"), ICON_NONE);
+  uiItemR(sub, ptr, "transparency_mask_2", UI_ITEM_R_TOGGLE, IFACE_("2"), ICON_NONE);
+  uiItemR(sub, ptr, "transparency_mask_3", UI_ITEM_R_TOGGLE, IFACE_("3"), ICON_NONE);
+  uiItemR(sub, ptr, "transparency_mask_4", UI_ITEM_R_TOGGLE, IFACE_("4"), ICON_NONE);
+  uiItemR(sub, ptr, "transparency_mask_5", UI_ITEM_R_TOGGLE, IFACE_("5"), ICON_NONE);
+  uiItemR(sub, ptr, "transparency_mask_6", UI_ITEM_R_TOGGLE, IFACE_("6"), ICON_NONE);
+  uiItemR(sub, ptr, "transparency_mask_7", UI_ITEM_R_TOGGLE, IFACE_("7"), ICON_NONE);
+  uiItemL(row, "", ICON_BLANK1); /* Space for decorator. */
+
+  uiLayout *col = uiLayoutColumn(layout, true);
+  // uiLayoutSetPropDecorate(col, true);
+  uiItemR(col, ptr, "transparency_match", 0, IFACE_("Match All Masks"), ICON_NONE);
 }
 
 static void chaining_panel_draw(const bContext *UNUSED(C), Panel *panel)
@@ -395,17 +408,18 @@ static void vgroup_panel_draw(const bContext *UNUSED(C), Panel *panel)
   uiLayout *col = uiLayoutColumn(layout, true);
 
   uiLayout *row = uiLayoutRow(col, true);
-  uiItemR(row, ptr, "source_vertex_group", 0, "Filter Source", ICON_GROUP_VERTEX);
+  uiItemR(row, ptr, "source_vertex_group", 0, IFACE_("Filter Source"), ICON_GROUP_VERTEX);
   uiItemR(row, ptr, "invert_source_vertex_group", UI_ITEM_R_TOGGLE, "", ICON_ARROW_LEFTRIGHT);
 
   uiItemR(col, ptr, "match_output_vertex_group", 0, NULL, ICON_NONE);
 
   bool match_output = RNA_boolean_get(ptr, "match_output_vertex_group");
   if (!match_output) {
-    uiItemPointerR(col, ptr, "vertex_group", &ob_ptr, "vertex_groups", "Target", ICON_NONE);
+    uiItemPointerR(
+        col, ptr, "vertex_group", &ob_ptr, "vertex_groups", IFACE_("Target"), ICON_NONE);
   }
 
-  uiItemR(layout, ptr, "soft_selection", 0, NULL, ICON_NONE);
+  uiItemR(col, ptr, "soft_selection", 0, NULL, ICON_NONE);
 }
 
 static void baking_panel_draw(const bContext *UNUSED(C), Panel *panel)
@@ -421,8 +435,9 @@ static void baking_panel_draw(const bContext *UNUSED(C), Panel *panel)
   if (is_baked) {
     uiLayout *col = uiLayoutColumn(layout, false);
     uiLayoutSetPropSep(col, false);
-    uiItemL(col, "Modifier has baked data.", ICON_NONE);
-    uiItemR(col, ptr, "is_baked", UI_ITEM_R_TOGGLE, "Continue Without Clearing", ICON_NONE);
+    uiItemL(col, IFACE_("Modifier has baked data."), ICON_NONE);
+    uiItemR(
+        col, ptr, "is_baked", UI_ITEM_R_TOGGLE, IFACE_("Continue Without Clearing"), ICON_NONE);
   }
 
   uiLayout *col = uiLayoutColumn(layout, false);
@@ -442,8 +457,14 @@ static void panelRegister(ARegionType *region_type)
 
   gpencil_modifier_subpanel_register(
       region_type, "style", "Style", NULL, style_panel_draw, panel_type);
-  gpencil_modifier_subpanel_register(
+  PanelType *occlusion_panel = gpencil_modifier_subpanel_register(
       region_type, "occlusion", "Occlusion", NULL, occlusion_panel_draw, panel_type);
+  gpencil_modifier_subpanel_register(region_type,
+                                     "transparency",
+                                     "",
+                                     transparency_panel_draw_header,
+                                     transparency_panel_draw,
+                                     occlusion_panel);
   gpencil_modifier_subpanel_register(
       region_type, "chaining", "Chaining", NULL, chaining_panel_draw, panel_type);
   gpencil_modifier_subpanel_register(
diff --git a/source/blender/gpencil_modifiers/intern/lineart

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list