diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-02-08 13:14:26 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-02-08 13:14:26 +0300 |
commit | 345c6298e995ea618c34282ba6d7ab5af032f191 (patch) | |
tree | f4fbc4798e17d0f19efc28b51a41425d0c552be8 /source/blender/editors/space_time | |
parent | 14a19fed788af0cf3695eb5def92510841056e08 (diff) |
Object Mode: move to workspace struct
- Read-only access can often use EvaluationContext.object_mode
- Write access to go to WorkSpace.object_mode.
- Some TODO's remain (marked as "TODO/OBMODE")
- Add-ons will need updating
(context.active_object.mode -> context.workspace.object_mode)
- There will be small/medium issues that still need resolving
this does work on a basic level though.
See D3037
Diffstat (limited to 'source/blender/editors/space_time')
-rw-r--r-- | source/blender/editors/space_time/space_time.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c index 283dbf3b4e2..853c24390d9 100644 --- a/source/blender/editors/space_time/space_time.c +++ b/source/blender/editors/space_time/space_time.c @@ -402,6 +402,7 @@ static void time_draw_caches_keyframes(Main *bmain, ViewLayer *view_layer, View2 /* draw keyframe lines for timeline */ static void time_draw_keyframes(const bContext *C, ARegion *ar) { + WorkSpace *workspace = CTX_wm_workspace(C); Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); Object *ob = CTX_data_active_object(C); @@ -443,7 +444,7 @@ static void time_draw_keyframes(const bContext *C, ARegion *ar) */ UI_GetThemeColor3ubv(TH_TIME_KEYFRAME, color); - if (ob && ((ob->mode == OB_MODE_POSE) || onlysel)) { + if (ob && ((workspace->object_mode == OB_MODE_POSE) || onlysel)) { /* draw keyframes for active object only */ time_draw_idblock_keyframes(v2d, (ID *)ob, onlysel, color); } |