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:
authorPhilipp Oeser <info@graphics-engineer.com>2018-06-11 10:12:29 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2018-06-11 10:12:29 +0300
commit474a145d78ff9870e24fe6a2969bce6375da0754 (patch)
tree9e34c91a0a651eb359bac957881563ee44c08db1 /source/blender/editors/sculpt_paint
parentd0a16772ad08dafa7300795e6c04a90bf94cde4b (diff)
Fix T55349: crash adding paint slot when object is on hidden layer
use better poll and get ob with 'ED_object_active_context' (instead of 'CTX_data_active_object') Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D3467
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_proj.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index 96aa4b17788..a24599f813f 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -83,6 +83,7 @@
#include "UI_interface.h"
+#include "ED_object.h"
#include "ED_mesh.h"
#include "ED_node.h"
#include "ED_paint.h"
@@ -5680,7 +5681,7 @@ static Image *proj_paint_image_create(wmOperator *op, Main *bmain)
static bool proj_paint_add_slot(bContext *C, wmOperator *op)
{
- Object *ob = CTX_data_active_object(C);
+ Object *ob = ED_object_active_context(C);
Scene *scene = CTX_data_scene(C);
Material *ma;
bool is_bi = BKE_scene_uses_blender_internal(scene) || BKE_scene_uses_blender_game(scene);
@@ -5772,7 +5773,7 @@ static int texture_paint_add_texture_paint_slot_invoke(bContext *C, wmOperator *
{
char imagename[MAX_ID_NAME - 2];
Main *bmain = CTX_data_main(C);
- Object *ob = CTX_data_active_object(C);
+ Object *ob = ED_object_active_context(C);
Material *ma = give_current_material(ob, ob->actcol);
int type = RNA_enum_get(op->ptr, "type");
@@ -5810,7 +5811,7 @@ void PAINT_OT_add_texture_paint_slot(wmOperatorType *ot)
/* api callbacks */
ot->invoke = texture_paint_add_texture_paint_slot_invoke;
ot->exec = texture_paint_add_texture_paint_slot_exec;
- ot->poll = ED_operator_region_view3d_active;
+ ot->poll = ED_operator_object_active;
/* flags */
ot->flag = OPTYPE_UNDO;