Merge branch 'master' into blender2.8
[blender.git] / source / blender / editors / sculpt_paint / paint_curve.c
index 8d9812f41d94f869894459475a6b9ec05b5fae97..fb8dea2af0e3a26d653bcd16f590ed0634b3b61e 100644 (file)
@@ -32,6 +32,7 @@
 #include "DNA_screen_types.h"
 #include "DNA_space_types.h"
 #include "DNA_view3d_types.h"
+#include "DNA_workspace_types.h"
 
 #include "BLI_math_vector.h"
 
@@ -39,6 +40,8 @@
 #include "BKE_main.h"
 #include "BKE_paint.h"
 
+#include "DEG_depsgraph.h"
+
 #include "ED_view3d.h"
 
 #include "WM_api.h"
 
 int paint_curve_poll(bContext *C)
 {
+       const WorkSpace *workspace = CTX_wm_workspace(C);
        Object *ob = CTX_data_active_object(C);
        Paint *p;
        RegionView3D *rv3d = CTX_wm_region_view3d(C);
        SpaceImage *sima;
 
-       if (rv3d && !(ob && ((ob->mode & OB_MODE_ALL_PAINT) != 0)))
+       if (rv3d && !(ob && ((workspace->object_mode & OB_MODE_ALL_PAINT) != 0)))
                return false;
 
        sima = CTX_wm_space_image(C);