diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-02-08 18:31:09 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-02-08 18:34:32 +0300 |
commit | be2bd5d722bf36e076663a27537860bb1842931e (patch) | |
tree | 8f94eee3e7b5c18ada5c90eccd523a8bf0f08388 /source/blender/draw/intern | |
parent | 92786141159430fa36e59e0229e4bbb84f2f04be (diff) |
Fix mixed weight-paint & pose mode
Diffstat (limited to 'source/blender/draw/intern')
-rw-r--r-- | source/blender/draw/intern/DRW_render.h | 2 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_armature.c | 2 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_manager.c | 13 |
3 files changed, 16 insertions, 1 deletions
diff --git a/source/blender/draw/intern/DRW_render.h b/source/blender/draw/intern/DRW_render.h index b6e4d82604c..8eb10ed5a14 100644 --- a/source/blender/draw/intern/DRW_render.h +++ b/source/blender/draw/intern/DRW_render.h @@ -476,6 +476,8 @@ typedef struct DRWContextState { * May be NULL when used for selection or depth buffer. */ const struct bContext *evil_C; + struct Object *object_pose; + } DRWContextState; const DRWContextState *DRW_context_state_get(void); diff --git a/source/blender/draw/intern/draw_armature.c b/source/blender/draw/intern/draw_armature.c index 5daafadada6..c14fe70e0c3 100644 --- a/source/blender/draw/intern/draw_armature.c +++ b/source/blender/draw/intern/draw_armature.c @@ -1310,7 +1310,7 @@ static void draw_armature_pose(Object *ob, const float const_color[4]) { const DRWContextState *draw_ctx = DRW_context_state_get(); - if (draw_ctx->object_mode & OB_MODE_POSE) { + if ((draw_ctx->object_mode & OB_MODE_POSE) || (ob == draw_ctx->object_pose)) { arm->flag |= ARM_POSEMODE; } diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index 96454fd087e..45ad9853d20 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -2678,6 +2678,19 @@ static void drw_viewport_var_init(void) memset(viewport_matrix_override.override, 0x0, sizeof(viewport_matrix_override.override)); memset(DST.common_instance_data, 0x0, sizeof(DST.common_instance_data)); + + /* Not a viewport variable, we could split this out. */ + { + if (DST.draw_ctx.object_mode & OB_MODE_POSE) { + DST.draw_ctx.object_pose = DST.draw_ctx.obact; + } + else if (DST.draw_ctx.object_mode & OB_MODE_WEIGHT_PAINT) { + DST.draw_ctx.object_pose = BKE_object_pose_armature_get(DST.draw_ctx.obact); + } + else { + DST.draw_ctx.object_pose = NULL; + } + } } void DRW_viewport_matrix_get(float mat[4][4], DRWViewportMatrixType type) |