diff options
author | Antonioya <blendergit@gmail.com> | 2018-10-13 21:34:11 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2018-10-13 21:34:36 +0300 |
commit | b8327ee129d8ab0ccaaa387dcaf92bc43e934bcb (patch) | |
tree | a6c8c752751c677add0d6ff76b18c30154b5a443 | |
parent | dd6bf3f84a9137affbcd8ba0fc957c32b8c0aff7 (diff) |
GP: Remove Layer order userprefs parameter
After a lot of discussion about this option (see 18f117594004) we have decided set always the order of GP layers in 2D mode (Top->Down) and remove the parameter from User Preferences screen.
Internally all works equal, but in the UI the list is inverted.
The filter buttons to reverse the list or sort alphabetically have been removed because these buttons are not logic in this context.
-rw-r--r-- | release/scripts/startup/bl_ui/properties_data_gpencil.py | 5 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_topbar.py | 5 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_userpref.py | 4 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_data.c | 17 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_userdef_types.h | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 6 |
6 files changed, 5 insertions, 33 deletions
diff --git a/release/scripts/startup/bl_ui/properties_data_gpencil.py b/release/scripts/startup/bl_ui/properties_data_gpencil.py index 184440a3400..b53e8c62599 100644 --- a/release/scripts/startup/bl_ui/properties_data_gpencil.py +++ b/release/scripts/startup/bl_ui/properties_data_gpencil.py @@ -125,16 +125,13 @@ class DATA_PT_gpencil_datapanel(Panel): self.draw_layers(context, layout, gpd) def draw_layers(self, context, layout, gpd): - userpref = context.user_preferences - edit = userpref.edit - reverse = edit.use_grease_pencil_reverse_layers row = layout.row() col = row.column() layer_rows = 7 col.template_list("GPENCIL_UL_layer", "", gpd, "layers", gpd.layers, "active_index", - rows=layer_rows, reverse=reverse) + rows=layer_rows, reverse=True) col = row.column() diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py index f40307b5b11..0f68b16f71a 100644 --- a/release/scripts/startup/bl_ui/space_topbar.py +++ b/release/scripts/startup/bl_ui/space_topbar.py @@ -352,15 +352,12 @@ class TOPBAR_PT_gpencil_layers(Panel): self.draw_layers(context, layout, gpd) def draw_layers(self, context, layout, gpd): - userpref = context.user_preferences - edit = userpref.edit - reverse = edit.use_grease_pencil_reverse_layers row = layout.row() col = row.column() layer_rows = 10 col.template_list("GPENCIL_UL_layer", "", gpd, "layers", gpd.layers, "active_index", - rows=layer_rows, reverse=reverse) + rows=layer_rows, reverse=True) col = row.column() diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 1516494abbc..420fa656b85 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -274,10 +274,6 @@ class USERPREF_PT_edit(Panel): col.prop(edit, "grease_pencil_euclidean_distance", text="Euclidean Distance") col.separator() - col.label(text="Grease Pencil:") - col.prop(edit, "use_grease_pencil_reverse_layers", text="Layers order Top-Down") - col.separator() - col.label(text="Annotations:") sub = col.row() sub.prop(edit, "grease_pencil_default_color", text="Default Color") diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c index 5cc5c55b3df..305aa03404b 100644 --- a/source/blender/editors/gpencil/gpencil_data.c +++ b/source/blender/editors/gpencil/gpencil_data.c @@ -338,8 +338,7 @@ static int gp_layer_move_exec(bContext *C, wmOperator *op) bGPdata *gpd = ED_gpencil_data_get_active(C); bGPDlayer *gpl = BKE_gpencil_layer_getactive(gpd); - const bool reverse = (bool)(U.gp_settings & GP_PAINT_REVERSE_LAYERS); - const int direction = RNA_enum_get(op->ptr, "type") * (reverse ? -1 : 1); + const int direction = RNA_enum_get(op->ptr, "type") * -1; /* sanity checks */ if (ELEM(NULL, gpd, gpl)) @@ -1084,18 +1083,8 @@ void GPENCIL_OT_layer_isolate(wmOperatorType *ot) static int gp_merge_layer_exec(bContext *C, wmOperator *op) { bGPdata *gpd = ED_gpencil_data_get_active(C); - const bool reverse = (bool)(U.gp_settings & GP_PAINT_REVERSE_LAYERS); - bGPDlayer *gpl_current = NULL; - bGPDlayer *gpl_next = NULL; - - if (!reverse) { - gpl_current = BKE_gpencil_layer_getactive(gpd); - gpl_next = gpl_current->next; - } - else { - gpl_next = BKE_gpencil_layer_getactive(gpd); - gpl_current = gpl_next->prev; - } + bGPDlayer *gpl_next = BKE_gpencil_layer_getactive(gpd); + bGPDlayer *gpl_current = gpl_next->prev; if (ELEM(NULL, gpd, gpl_current, gpl_next)) { BKE_report(op->reports, RPT_ERROR, "No layers to merge"); diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index a18ed19a306..75811ad5369 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -885,7 +885,6 @@ typedef enum eText_Draw_Options { typedef enum eGP_UserdefSettings { GP_PAINT_DOSMOOTH = (1 << 0), GP_PAINT_DOSIMPLIFY = (1 << 1), - GP_PAINT_REVERSE_LAYERS = (1 << 2), } eGP_UserdefSettings; enum { diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 1470681dec0..5783e9252ed 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -3994,17 +3994,11 @@ static void rna_def_userdef_edit(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "gp_settings", GP_PAINT_DOSIMPLIFY); RNA_def_property_ui_text(prop, "Grease Pencil Simplify Stroke", "Simplify the final stroke"); - prop = RNA_def_property(srna, "use_grease_pencil_reverse_layers", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "gp_settings", GP_PAINT_REVERSE_LAYERS); - RNA_def_property_ui_text(prop, "Layers list Top-Down", - "Order the grease pencil list of layers from Top to Down"); - prop = RNA_def_property(srna, "grease_pencil_eraser_radius", PROP_INT, PROP_PIXEL); RNA_def_property_int_sdna(prop, NULL, "gp_eraser"); RNA_def_property_range(prop, 1, 500); RNA_def_property_ui_text(prop, "Grease Pencil Eraser Radius", "Radius of eraser 'brush'"); - prop = RNA_def_property(srna, "grease_pencil_default_color", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "gpencil_new_layer_col"); RNA_def_property_array(prop, 4); |