Commit: ffe56536f1050717b133883cba29d63fff8d9e00
Author: julianeisel
Date:   Mon Jan 19 01:01:23 2015 +0100
Branches: master
https://developer.blender.org/rBffe56536f1050717b133883cba29d63fff8d9e00

Outliner: Make alphabetical sorting optional

A new option to the Outliner's View menu is added to enable/disable sorting of 
items.

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

M       release/scripts/startup/bl_ui/space_outliner.py
M       source/blender/editors/space_outliner/outliner_tree.c
M       source/blender/makesdna/DNA_space_types.h
M       source/blender/makesrna/intern/rna_space.c

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

diff --git a/release/scripts/startup/bl_ui/space_outliner.py 
b/release/scripts/startup/bl_ui/space_outliner.py
index 7b508c0..ca2d11d 100644
--- a/release/scripts/startup/bl_ui/space_outliner.py
+++ b/release/scripts/startup/bl_ui/space_outliner.py
@@ -86,6 +86,7 @@ class OUTLINER_MT_view(Menu):
         space = context.space_data
 
         if space.display_mode not in {'DATABLOCKS', 'USER_PREFERENCES', 
'KEYMAPS'}:
+            layout.prop(space, "sort_alphabetically")
             layout.prop(space, "show_restrict_columns")
             layout.separator()
             layout.operator("outliner.show_active")
diff --git a/source/blender/editors/space_outliner/outliner_tree.c 
b/source/blender/editors/space_outliner/outliner_tree.c
index 4aa36da..f1a7a98 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -1311,7 +1311,10 @@ static void outliner_sort(SpaceOops *soops, ListBase *lb)
        TreeElement *te;
        TreeStoreElem *tselem;
        int totelem = 0;
-       
+
+       if (soops->flag & SO_SKIP_SORTING)
+               return;
+
        te = lb->last;
        if (te == NULL) return;
        tselem = TREESTORE(te);
diff --git a/source/blender/makesdna/DNA_space_types.h 
b/source/blender/makesdna/DNA_space_types.h
index f65cef1..44eb873 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -273,6 +273,7 @@ typedef enum eSpaceOutliner_Flag {
        SO_NEWSELECTED          = (1 << 1),
        SO_HIDE_RESTRICTCOLS    = (1 << 2),
        SO_HIDE_KEYINGSETINFO   = (1 << 3),
+       SO_SKIP_SORTING         = (1 << 4),
 } eSpaceOutliner_Flag;
 
 /* SpaceOops->outlinevis */
diff --git a/source/blender/makesrna/intern/rna_space.c 
b/source/blender/makesrna/intern/rna_space.c
index af0e69c..6fea135 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -1593,7 +1593,12 @@ static void rna_def_space_outliner(BlenderRNA *brna)
        RNA_def_property_boolean_sdna(prop, NULL, "search_flags", 
SO_FIND_COMPLETE);
        RNA_def_property_ui_text(prop, "Complete Matches Only", "Only use 
complete matches of search string");
        RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
-       
+
+       prop = RNA_def_property(srna, "sort_alphabetically", PROP_BOOLEAN, 
PROP_NONE);
+       RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", 
SO_SKIP_SORTING);
+       RNA_def_property_ui_text(prop, "Sort Alphabetically", "Sort items 
alphabetically");
+       RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
+
        prop = RNA_def_property(srna, "show_restrict_columns", PROP_BOOLEAN, 
PROP_NONE);
        RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", 
SO_HIDE_RESTRICTCOLS);
        RNA_def_property_ui_text(prop, "Show Restriction Columns", "Show 
column");

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to