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/makesrna/intern/rna_brush.c | |
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/makesrna/intern/rna_brush.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_brush.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 5336a63fb76..aa37c9ffa88 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -31,6 +31,7 @@ #include "DNA_texture_types.h" #include "DNA_scene_types.h" #include "DNA_object_types.h" +#include "DNA_workspace_types.h" #include "BLI_math.h" @@ -43,6 +44,8 @@ #include "WM_types.h" +#include "DEG_depsgraph.h" + static const EnumPropertyItem prop_direction_items[] = { {0, "ADD", 0, "Add", "Add effect of brush"}, {BRUSH_DIR_IN, "SUBTRACT", 0, "Subtract", "Subtract effect of brush"}, @@ -373,21 +376,23 @@ static void rna_Brush_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerR static void rna_Brush_main_tex_update(bContext *C, PointerRNA *ptr) { + const WorkSpace *workspace = CTX_wm_workspace(C); Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); Brush *br = (Brush *)ptr->data; - BKE_paint_invalidate_overlay_tex(scene, view_layer, br->mtex.tex); + BKE_paint_invalidate_overlay_tex(scene, view_layer, br->mtex.tex, workspace->object_mode); rna_Brush_update(bmain, scene, ptr); } static void rna_Brush_secondary_tex_update(bContext *C, PointerRNA *ptr) { Main *bmain = CTX_data_main(C); + const WorkSpace *workspace = CTX_wm_workspace(C); Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); Brush *br = (Brush *)ptr->data; - BKE_paint_invalidate_overlay_tex(scene, view_layer, br->mask_mtex.tex); + BKE_paint_invalidate_overlay_tex(scene, view_layer, br->mask_mtex.tex, workspace->object_mode); rna_Brush_update(bmain, scene, ptr); } @@ -449,8 +454,9 @@ static void rna_TextureSlot_brush_angle_update(bContext *C, PointerRNA *ptr) MTex *mtex = ptr->data; /* skip invalidation of overlay for stencil mode */ if (mtex->mapping != MTEX_MAP_MODE_STENCIL) { + const WorkSpace *workspace = CTX_wm_workspace(C); ViewLayer *view_layer = CTX_data_view_layer(C); - BKE_paint_invalidate_overlay_tex(scene, view_layer, mtex->tex); + BKE_paint_invalidate_overlay_tex(scene, view_layer, mtex->tex, workspace->object_mode); } rna_TextureSlot_update(C, ptr); |