Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_sync.cc')
-rw-r--r--source/blender/editors/space_outliner/outliner_sync.cc20
1 files changed, 15 insertions, 5 deletions
diff --git a/source/blender/editors/space_outliner/outliner_sync.cc b/source/blender/editors/space_outliner/outliner_sync.cc
index 36bc7c31b91..8f1c15873b4 100644
--- a/source/blender/editors/space_outliner/outliner_sync.cc
+++ b/source/blender/editors/space_outliner/outliner_sync.cc
@@ -77,8 +77,8 @@ void ED_outliner_select_sync_flag_outliners(const bContext *C)
Main *bmain = CTX_data_main(C);
wmWindowManager *wm = CTX_wm_manager(C);
- for (bScreen *screen = reinterpret_cast<bScreen *>(bmain->screens.first); screen;
- screen = reinterpret_cast<bScreen *>(screen->id.next)) {
+ for (bScreen *screen = static_cast<bScreen *>(bmain->screens.first); screen;
+ screen = static_cast<bScreen *>(screen->id.next)) {
LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
if (sl->spacetype == SPACE_OUTLINER) {
@@ -94,6 +94,8 @@ void ED_outliner_select_sync_flag_outliners(const bContext *C)
wm->outliner_sync_select_dirty = 0;
}
+namespace blender::ed::outliner {
+
/**
* Outliner sync select dirty flags are not enough to determine which types to sync,
* outliner display mode also needs to be considered. This stores the types of data
@@ -248,7 +250,7 @@ static void outliner_select_sync_to_edit_bone(ViewLayer *view_layer,
/* Tag if selection changed */
if (bone_flag != ebone->flag) {
- Object *obedit = OBEDIT_FROM_VIEW_LAYER(view_layer);
+ Object *obedit = BKE_view_layer_edit_object_get(view_layer);
DEG_id_tag_update(&arm->id, ID_RECALC_SELECT);
WM_main_add_notifier(NC_OBJECT | ND_BONE_SELECT, obedit);
}
@@ -259,7 +261,7 @@ static void outliner_select_sync_to_pose_bone(TreeElement *te,
GSet *selected_pbones)
{
Object *ob = (Object *)tselem->id;
- bArmature *arm = reinterpret_cast<bArmature *>(ob->data);
+ bArmature *arm = static_cast<bArmature *>(ob->data);
bPoseChannel *pchan = (bPoseChannel *)te->directdata;
short bone_flag = pchan->bone->flag;
@@ -335,8 +337,12 @@ static void outliner_sync_selection_from_outliner(Scene *scene,
}
}
+} // namespace blender::ed::outliner
+
void ED_outliner_select_sync_from_outliner(bContext *C, SpaceOutliner *space_outliner)
{
+ using namespace blender::ed::outliner;
+
/* Don't sync if not checked or in certain outliner display modes */
if (!(space_outliner->flag & SO_SYNC_SELECT) || ELEM(space_outliner->outlinevis,
SO_LIBRARIES,
@@ -380,6 +386,8 @@ void ED_outliner_select_sync_from_outliner(bContext *C, SpaceOutliner *space_out
}
}
+namespace blender::ed::outliner {
+
static void outliner_select_sync_from_object(ViewLayer *view_layer,
Object *obact,
TreeElement *te,
@@ -523,7 +531,7 @@ static void get_sync_select_active_data(const bContext *C, SyncSelectActiveData
{
Scene *scene = CTX_data_scene(C);
ViewLayer *view_layer = CTX_data_view_layer(C);
- active_data->object = OBACT(view_layer);
+ active_data->object = BKE_view_layer_active_object_get(view_layer);
active_data->edit_bone = CTX_data_active_bone(C);
active_data->pose_channel = CTX_data_active_pose_bone(C);
active_data->sequence = SEQ_select_active_get(scene);
@@ -561,3 +569,5 @@ void outliner_sync_selection(const bContext *C, SpaceOutliner *space_outliner)
}
}
}
+
+} // namespace blender::ed::outliner