Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/source/blender/CMakeLists.txt b/source/blender/CMakeLists.txt
- index 7b21e879729..89d68adf757 100644
- --- a/source/blender/CMakeLists.txt
- +++ b/source/blender/CMakeLists.txt
- @@ -65,6 +65,7 @@ set(SRC_DNA_INC
- ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_object_fluidsim_types.h
- ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_object_force_types.h
- ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_object_types.h
- + ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_outliner_filter_types.h
- ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_outliner_types.h
- ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_packedFile_types.h
- ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_particle_types.h
- diff --git a/source/blender/makesdna/DNA_outliner_filter_types.h b/source/blender/makesdna/DNA_outliner_filter_types.h
- new file mode 100644
- index 00000000000..089e7f1f96a
- --- /dev/null
- +++ b/source/blender/makesdna/DNA_outliner_filter_types.h
- @@ -0,0 +1,161 @@
- +/*
- + * This program is free software; you can redistribute it and/or
- + * modify it under the terms of the GNU General Public License
- + * as published by the Free Software Foundation; either version 2
- + * of the License, or (at your option) any later version.
- + *
- + * This program is distributed in the hope that it will be useful,
- + * but WITHOUT ANY WARRANTY; without even the implied warranty of
- + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- + * GNU General Public License for more details.
- + *
- + * You should have received a copy of the GNU General Public License
- + * along with this program; if not, write to the Free Software Foundation,
- + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- + *
- + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- + * All rights reserved.
- + */
- +
- +/** \file
- + * \ingroup DNA
- + */
- +
- +#ifndef __DNA_OUTLINER_FILTER_TYPES_H__
- +#define __DNA_OUTLINER_FILTER_TYPES_H__
- +
- +#include "DNA_defs.h"
- +
- +
- +typedef enum DeleteSwitchType {
- + TFE_NONE_EXCEPT = 0, /* Delete none except...*/
- + TFE_ALL_EXCEPT = 1, /* Delete all except...*/
- +} DeleteSwitchType;
- +
- +/* TreeFilterElement::fot These are different filter methods for property values TreeFilterElement::prop_val_comparator_min and TreeFilterElement::prop_val_comparator_max */
- +typedef enum FilterOperationType {
- + TFE_RELATION = 0, /* <, <=, >, >=, ==, != --- only for numeric values*/
- + TFE_ARITHMETIC = 1, /* */
- + TFE_REG_EXPRESSION = 2,
- + TFE_ALPHABETIC = 3, /* Search string property value*/
- + TFE_RANGE = 4, /* TreeFilterListElement::prop_val_comparator_min and TreeFilterElement::prop_val_comparator_max */
- +} FilterOperationType;
- +
- +/* TreeFilterElement::op_min and TreeFilterListElement::op_max. Used when TreeFilterElement::fot is set to TFE_RELATION */
- +typedef enum RelationalOperaterType {
- + TFE_EQUALS = 0,
- + TFE_NOT_EQUALS = 1,
- + TFE_LESS_THAN = 2,
- + TFE_LESS_THAN_EQUALS = 3,
- + TFE_GREATER_THAN = 4,
- + TFE_GREATER_THAN_EQUALS = 5,
- +} RelationalOperaterType;
- +
- +/* TreeFilterElement::proptype_comparator */
- +typedef enum TFE_PropertyType {
- + TFE_BOOLEAN = (1 << 0),
- + TFE_INT = (1 << 1),
- + TFE_FLOAT = (1 << 2),
- + TFE_STRING = (1 << 3),
- + TFE_ENUM = (1 << 4),
- + TFE_POINTER = (1 << 5),
- + TFE_COLLECTION = (1 << 6),
- +} TFE_PropertyType;
- +
- +
- +
- +/* TreeFilterElement is supposed to work in a linear layered tree - which is unlike TreeElement */
- +/* Link this within SpaceOutliner::tree_filter_list */
- +typedef struct TreeFilterElement {
- + struct TreeFilterElement *next, *prev;
- + ListBase *superlist, *sublist, *list;
- +
- + int apply_num_subtrees; /* -1 = all subtrees, 0 = this subtree only. This, as a convenience, applies this TreeFilterElement as a filter for num sublist s */
- +
- + short struct_delete_switch;
- + char struct_name_comparator[64]; /* filter by struct name. NULL signifies no struct_name search*/
- + short prop_name_delete_switch;
- + char prop_name_comparator[64]; /* filter by struct property name/indentifier. NULL signifies no prop_name search */
- +
- + /* property value filter operation stuff */
- + short prop_val_delete_switch;
- + short fot;
- + short op_min; /* Only used if fot is set to TFE_RELATION or TFE_RANGE */
- + void* prop_val_comparator_min; /* Used for all FilterOperationType values. Set to NULL to signify no property value search */
- + short op_max; /* Only used if fot is set to RANGE */
- + void* prop_val_comparator_max; /* Only used if fot is set to RANGE */
- +
- + short elem_name_comparator_delete_switch;
- + char elem_name_comparator[64];
- +
- + short proptype_delete_switch;
- + short proptype_comparator; /* Filter tree via PropertyType . -1 signifies no proptype value search*/
- +
- +} TreeFilterElement;
- +
- +
- +
- +
- +#endif /* __DNA_OUTLINER_FILTER_TYPES_H__ */
- +
- +
- diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
- index 21e945a084a..7c464e192ad 100644
- --- a/source/blender/makesdna/DNA_space_types.h
- +++ b/source/blender/makesdna/DNA_space_types.h
- @@ -30,6 +30,7 @@
- #include "DNA_color_types.h" /* for Histogram */
- #include "DNA_vec_types.h"
- #include "DNA_outliner_types.h" /* for TreeStoreElem */
- +#include "DNA_outliner_filter_types.h"
- #include "DNA_image_types.h" /* ImageUser */
- #include "DNA_movieclip_types.h" /* MovieClipUser */
- #include "DNA_sequence_types.h" /* SequencerScopes */
- @@ -231,7 +232,8 @@ typedef struct SpaceOutliner {
- /** Deprecated, copied to region. */
- View2D v2d DNA_DEPRECATED;
- - ListBase tree;
- + ListBase original_tree;
- + ListBase derived_tree;
- /* treestore is an ordered list of TreeStoreElem's from outliner tree;
- * Note that treestore may contain duplicate elements if element
- @@ -250,6 +252,20 @@ typedef struct SpaceOutliner {
- char filter_state;
- char _pad;
- short filter_id_type;
- + ListBase *tree_filter_tree;
- +
- +
- + /* Current TreeFilterElement list and current tfe*/
- + short active_tfe_list_index;
- + short active_tfe_index;
- + char name[32];
- + char _pad2[4];
- /**
- * Pointers to treestore elements, grouped by (id, type, nr)
- diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c
- index edf15c5fe39..bf26eb9ebf4 100644
- --- a/source/blender/makesdna/intern/makesdna.c
- +++ b/source/blender/makesdna/intern/makesdna.c
- @@ -98,6 +98,7 @@ static const char *includefiles[] = {
- "DNA_fileglobal_types.h",
- "DNA_sequence_types.h",
- "DNA_effect_types.h",
- + "DNA_outliner_filter_types.h",
- "DNA_outliner_types.h",
- "DNA_sound_types.h",
- "DNA_collection_types.h",
- @@ -1487,6 +1488,7 @@ int main(int argc, char **argv)
- #include "DNA_fileglobal_types.h"
- #include "DNA_sequence_types.h"
- #include "DNA_effect_types.h"
- +#include "DNA_outliner_filter_types.h"
- #include "DNA_outliner_types.h"
- #include "DNA_sound_types.h"
- #include "DNA_collection_types.h"
- diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
- index 5866302a852..0bb20383147 100644
- --- a/source/blender/makesrna/RNA_access.h
- +++ b/source/blender/makesrna/RNA_access.h
- @@ -703,6 +703,7 @@ extern StructRNA RNA_TrackToConstraint;
- extern StructRNA RNA_TransformConstraint;
- extern StructRNA RNA_TransformOrientationSlot;
- extern StructRNA RNA_TransformSequence;
- +extern StructRNA RNA_TreeFilterElement;
- extern StructRNA RNA_UILayout;
- extern StructRNA RNA_UIList;
- extern StructRNA RNA_UIPieMenu;
- diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
- index f827615ab03..a26f2f7f82e 100644
- --- a/source/blender/makesrna/intern/rna_space.c
- +++ b/source/blender/makesrna/intern/rna_space.c
- @@ -1190,6 +1190,27 @@ static const EnumPropertyItem *rna_SpaceImageEditor_pivot_itemf(
- return pivot_items;
- }
- +
- +/* Outliner */
- +
- +static int rna_SpaceOutliner_active_tfe_list_index_get(PointerRNA *ptr)
- +{
- + SpaceOutliner *soops = (SpaceOutliner *)ptr->id.data;
- +
- + return MAX2(soops->active_tfe_list_index - 1, 0);
- +}
- +
- +static void rna_SpaceOutliner_active_tfe_list_index_set(PointerRNA *ptr, int value)
- +{
- + SpaceOutliner *soops = (SpaceOutliner *)ptr->id.data;
- +
- + soops->active_tfe_list_index = value + 1;
- +}
- +
- +
- +
- +
- +
- /* Space Text Editor */
- static void rna_SpaceTextEditor_word_wrap_set(PointerRNA *ptr, bool value)
- @@ -2405,6 +2429,56 @@ static void rna_def_space_outliner(BlenderRNA *brna)
- RNA_def_property_enum_items(prop, rna_enum_id_type_items);
- RNA_def_property_ui_text(prop, "Filter ID Type", "Data-block type to show");
- RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_ID);
- +
- +
- + prop = RNA_def_property(srna, "active_tfe_list_index", PROP_INT, PROP_NONE);
- + RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); /* XXX this is really unpredictable... */
- + RNA_def_property_int_funcs(prop, "rna_SpaceOutliner_active_tfe_list_index_get", "rna_SpaceOutliner_active_tfe_list_index_set",
- + NULL);//NOTE: THIS parameter is modeled after active_shape_key_index in rna_object.c - probably not supposed to be NULL
- + RNA_def_property_ui_text(prop, "Active Filter List Index", "Current tree filter index");
- + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL /*"rna_Object_active_shape_update"*/);
- +
- +
- +
- + prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
- + RNA_def_property_ui_text(prop, "Name", "Tree filter name");
- + RNA_def_struct_name_property(srna, prop);
- +
- +
- + prop = RNA_def_property(srna, "tree_filter_tree", PROP_COLLECTION, PROP_NONE);
- + RNA_def_property_struct_type(prop, "TreeFilterElement");
- + RNA_def_property_ui_text(prop, "Boid Rules", "");
- +
- +
- }
- static void rna_def_space_view3d_shading(BlenderRNA *brna)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement