diff options
author | Nathan Craddock <nzcraddock@gmail.com> | 2019-06-30 05:40:45 +0300 |
---|---|---|
committer | Nathan Craddock <nzcraddock@gmail.com> | 2019-06-30 05:48:14 +0300 |
commit | cc3f7abbb09a85f8c80084ad1baecbe71369415a (patch) | |
tree | 59cca038eee71152a14d377e0d3cbda297f03b70 /source/blender | |
parent | d5ad3d6fc8ae5eb1360ff29bf92810b35f2bce74 (diff) |
Outliner: Move sync_select_dirty_flag to new file
Adds `outliner_sync.c` for the global rather than storing in Main.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/BKE_main.h | 11 | ||||
-rw-r--r-- | source/blender/editors/include/ED_outliner.h | 10 | ||||
-rw-r--r-- | source/blender/editors/object/object_select.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/CMakeLists.txt | 1 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner_draw.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner_select.c | 3 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner_sync.c | 33 |
7 files changed, 50 insertions, 18 deletions
diff --git a/source/blender/blenkernel/BKE_main.h b/source/blender/blenkernel/BKE_main.h index 415a9aecd5d..1c987d5eb8e 100644 --- a/source/blender/blenkernel/BKE_main.h +++ b/source/blender/blenkernel/BKE_main.h @@ -82,10 +82,6 @@ typedef struct Main { /** All current ID's exist in the last memfile undo step. */ char is_memfile_undo_written; - /* Flag to indicate if a sync is to extend or replace the outliner selection */ - char sync_select_dirty_flag; - struct SpaceOutliner *clean_outliner; /* to store the clean outliner to be synced from */ - BlendThumbnail *blen_thumb; struct Library *curlib; @@ -136,13 +132,6 @@ typedef struct Main { struct MainLock *lock; } Main; -/* Main->sync_select_dirty_flag */ -enum { - SYNC_SELECT_NONE = 0, - SYNC_SELECT_REPLACE = 1, - SYNC_SELECT_EXTEND = 2, -}; - struct Main *BKE_main_new(void); void BKE_main_free(struct Main *mainvar); diff --git a/source/blender/editors/include/ED_outliner.h b/source/blender/editors/include/ED_outliner.h index 55bc5e2d92b..fc64785ca93 100644 --- a/source/blender/editors/include/ED_outliner.h +++ b/source/blender/editors/include/ED_outliner.h @@ -26,6 +26,16 @@ struct ListBase; struct bContext; +/* Flag to indicate if a sync is to extend or replace the outliner selection */ +extern short sync_select_dirty_flag; + +/* sync_select_dirty_flag types */ +enum { + SYNC_SELECT_NONE = 0, + SYNC_SELECT_REPLACE = 1, + SYNC_SELECT_EXTEND = 2, +}; + bool ED_outliner_collections_editor_poll(struct bContext *C); void ED_outliner_selected_objects_get(const struct bContext *C, struct ListBase *objects); diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c index d2d8a7680e2..b96ccde8046 100644 --- a/source/blender/editors/object/object_select.c +++ b/source/blender/editors/object/object_select.c @@ -50,7 +50,6 @@ #include "BKE_collection.h" #include "BKE_context.h" #include "BKE_deform.h" -#include "BKE_global.h" #include "BKE_layer.h" #include "BKE_library.h" #include "BKE_main.h" @@ -70,6 +69,7 @@ #include "ED_armature.h" #include "ED_object.h" +#include "ED_outliner.h" #include "ED_screen.h" #include "ED_select_utils.h" #include "ED_keyframing.h" @@ -119,7 +119,7 @@ void ED_object_base_select(Base *base, eObjectSelect_Mode mode) } /* Using globals to sync selection for now */ - G_MAIN->sync_select_dirty_flag = SYNC_SELECT_REPLACE; + sync_select_dirty_flag = SYNC_SELECT_REPLACE; } /** diff --git a/source/blender/editors/space_outliner/CMakeLists.txt b/source/blender/editors/space_outliner/CMakeLists.txt index d235dd47136..616915dbc2c 100644 --- a/source/blender/editors/space_outliner/CMakeLists.txt +++ b/source/blender/editors/space_outliner/CMakeLists.txt @@ -41,6 +41,7 @@ set(SRC outliner_edit.c outliner_ops.c outliner_select.c + outliner_sync.c outliner_tools.c outliner_tree.c outliner_utils.c diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index a9c8f421a18..b513fc1d060 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -45,7 +45,6 @@ #include "BKE_context.h" #include "BKE_deform.h" #include "BKE_fcurve.h" -#include "BKE_global.h" #include "BKE_gpencil.h" #include "BKE_idcode.h" #include "BKE_layer.h" @@ -62,6 +61,7 @@ #include "ED_armature.h" #include "ED_keyframing.h" #include "ED_object.h" +#include "ED_outliner.h" #include "ED_screen.h" #include "WM_api.h" @@ -3631,12 +3631,12 @@ static void outliner_sync_selection(const bContext *C, SpaceOutliner *soops) ViewLayer *view_layer = CTX_data_view_layer(C); /* If 3D view selection occurred, mark outliners as dirty */ - if (G_MAIN->sync_select_dirty_flag != SYNC_SELECT_NONE) { + if (sync_select_dirty_flag != SYNC_SELECT_NONE) { printf("Marking outliners as dirty\n"); outliners_mark_dirty(C); - G_MAIN->sync_select_dirty_flag = SYNC_SELECT_NONE; + sync_select_dirty_flag = SYNC_SELECT_NONE; } /* If dirty, sync from view layer */ diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index f2f5c7affdd..7c727f6bd64 100644 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@ -41,7 +41,6 @@ #include "BKE_armature.h" #include "BKE_collection.h" #include "BKE_context.h" -#include "BKE_global.h" #include "BKE_gpencil.h" #include "BKE_layer.h" #include "BKE_main.h" @@ -78,7 +77,7 @@ void outliner_select_sync(bContext *C, SpaceOutliner *soops) { puts("Outliner select... Mark other outliners as dirty for syncing"); outliner_sync_selection_to_view_layer(C, &soops->tree); - G_MAIN->sync_select_dirty_flag = SYNC_SELECT_NONE; + sync_select_dirty_flag = SYNC_SELECT_NONE; /* Don't need to mark self as dirty here... */ outliners_mark_dirty(C); diff --git a/source/blender/editors/space_outliner/outliner_sync.c b/source/blender/editors/space_outliner/outliner_sync.c new file mode 100644 index 00000000000..3aaf51b607f --- /dev/null +++ b/source/blender/editors/space_outliner/outliner_sync.c @@ -0,0 +1,33 @@ +/* + * 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) 2004 Blender Foundation. + * All rights reserved. + */ + +/** \file + * \ingroup spoutliner + */ + +#include "DNA_layer_types.h" +#include "DNA_outliner_types.h" +#include "DNA_space_types.h" + +#include "ED_outliner.h" + +#include "outliner_intern.h" + +/* Default value for sync selection state */ +short sync_select_dirty_flag = SYNC_SELECT_NONE;
\ No newline at end of file |