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:
authorAntonio Vazquez <blendergit@gmail.com>2020-03-09 18:27:24 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-03-09 18:27:24 +0300
commit29f3af95272590d26f610ae828b2eeee89c82a00 (patch)
treea696a58a2561c48f7ec6166e369e22081e0a64d8 /source/blender/editors/interface/interface_templates.c
parentdcb93126876879d969a30a7865700abd072066f8 (diff)
GPencil: Refactor of Draw Engine, Vertex Paint and all internal functions
This commit is a full refactor of the grease pencil modules including Draw Engine, Modifiers, VFX, depsgraph update, improvements in operators and conversion of Sculpt and Weight paint tools to real brushes. Also, a huge code cleanup has been done at all levels. Thanks to @fclem for his work and yo @pepeland and @mendio for the testing and help in the development. Differential Revision: https://developer.blender.org/D6293
Diffstat (limited to 'source/blender/editors/interface/interface_templates.c')
-rw-r--r--source/blender/editors/interface/interface_templates.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index c80c5317735..b752a1a1429 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -5385,6 +5385,21 @@ void uiTemplateColorPicker(uiLayout *layout,
}
}
+static void ui_template_palette_menu(bContext *UNUSED(C), uiLayout *layout, void *UNUSED(but_p))
+{
+ uiLayout *row;
+
+ uiItemL(layout, IFACE_("Sort by:"), ICON_NONE);
+ row = uiLayoutRow(layout, false);
+ uiItemEnumO_value(row, IFACE_("Hue"), ICON_NONE, "PALETTE_OT_sort", "type", 1);
+ row = uiLayoutRow(layout, false);
+ uiItemEnumO_value(row, IFACE_("Saturation"), ICON_NONE, "PALETTE_OT_sort", "type", 2);
+ row = uiLayoutRow(layout, false);
+ uiItemEnumO_value(row, IFACE_("Value"), ICON_NONE, "PALETTE_OT_sort", "type", 3);
+ row = uiLayoutRow(layout, false);
+ uiItemEnumO_value(row, IFACE_("Luminance"), ICON_NONE, "PALETTE_OT_sort", "type", 4);
+}
+
void uiTemplatePalette(uiLayout *layout,
PointerRNA *ptr,
const char *propname,
@@ -5396,6 +5411,8 @@ void uiTemplatePalette(uiLayout *layout,
PaletteColor *color;
uiBlock *block;
uiLayout *col;
+ uiBut *but = NULL;
+
int row_cols = 0, col_id = 0;
int cols_per_row = MAX2(uiLayoutGetWidth(layout) / UI_UNIT_X, 1);
@@ -5437,6 +5454,37 @@ void uiTemplatePalette(uiLayout *layout,
UI_UNIT_X,
UI_UNIT_Y,
NULL);
+ if (color) {
+ but = uiDefIconButO(block,
+ UI_BTYPE_BUT,
+ "PALETTE_OT_color_move",
+ WM_OP_INVOKE_DEFAULT,
+ ICON_TRIA_UP,
+ 0,
+ 0,
+ UI_UNIT_X,
+ UI_UNIT_Y,
+ NULL);
+ UI_but_operator_ptr_get(but);
+ RNA_enum_set(but->opptr, "type", -1);
+
+ but = uiDefIconButO(block,
+ UI_BTYPE_BUT,
+ "PALETTE_OT_color_move",
+ WM_OP_INVOKE_DEFAULT,
+ ICON_TRIA_DOWN,
+ 0,
+ 0,
+ UI_UNIT_X,
+ UI_UNIT_Y,
+ NULL);
+ UI_but_operator_ptr_get(but);
+ RNA_enum_set(but->opptr, "type", 1);
+
+ /* Menu. */
+ uiDefIconMenuBut(
+ block, ui_template_palette_menu, NULL, ICON_SORTSIZE, 0, 0, UI_UNIT_X, UI_UNIT_Y, "");
+ }
col = uiLayoutColumn(layout, true);
uiLayoutRow(col, true);