GP: Remove Layer order userprefs parameter
authorAntonioya <blendergit@gmail.com>
Sat, 13 Oct 2018 18:34:11 +0000 (20:34 +0200)
committerAntonioya <blendergit@gmail.com>
Sat, 13 Oct 2018 18:34:36 +0000 (20:34 +0200)
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.

release/scripts/startup/bl_ui/properties_data_gpencil.py
release/scripts/startup/bl_ui/space_topbar.py
release/scripts/startup/bl_ui/space_userpref.py
source/blender/editors/gpencil/gpencil_data.c
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesrna/intern/rna_userdef.c

index 184440a34001e13a2fd106bdfbc61d6766bf459c..b53e8c6259972cc06897b59c661383c6d2b66b7c 100644 (file)
@@ -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()
 
index f40307b5b114e85b65c6401beb6a474e39a09eec..0f68b16f71a8c0ceeed8428d86ae8492dcc779dc 100644 (file)
@@ -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()
 
index 1516494abbc96d0c16fa10d82bced198dcdce7c5..420fa656b854d0f269d6a69af313e472c2bb1f8b 100644 (file)
@@ -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")
index 5cc5c55b3dfc4707068bcf30f3e16203463baee3..305aa03404bfe7a51ef897304f7130735dd5d10d 100644 (file)
@@ -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");
index a18ed19a306c5b86d903f323fedf37d81c520cff..75811ad536960b4d6bc52562fcd1ea47269fe1d8 100644 (file)
@@ -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 {
index 1470681dec05be98b134d22bcb9013a96e2efac9..5783e9252edb9b0f3e869172da2484c1d1a35491 100644 (file)
@@ -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);