Commit: c652eb0a455438db428dfb9a3048bb27bab303cc
Author: Antonioya
Date:   Fri Mar 2 11:39:12 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rBc652eb0a455438db428dfb9a3048bb27bab303cc

Adapt code after merge

THe code was moved to new module

===================================================================

M       source/blender/editors/object/object_modes.c

===================================================================

diff --git a/source/blender/editors/object/object_modes.c 
b/source/blender/editors/object/object_modes.c
index 8cdec2968b3..5b2eeaff772 100644
--- a/source/blender/editors/object/object_modes.c
+++ b/source/blender/editors/object/object_modes.c
@@ -27,6 +27,7 @@
  * actual mode switching logic is per-object type.
  */
 
+#include "DNA_gpencil_types.h"
 #include "DNA_object_types.h"
 #include "DNA_scene_types.h"
 #include "DNA_workspace_types.h"
@@ -68,8 +69,14 @@ static const char *object_mode_op_string(eObjectMode mode)
                return "PARTICLE_OT_particle_edit_toggle";
        if (mode == OB_MODE_POSE)
                return "OBJECT_OT_posemode_toggle";
-       if (mode == OB_MODE_GPENCIL)
+       if (mode == OB_MODE_GPENCIL_EDIT)
                return "GPENCIL_OT_editmode_toggle";
+       if (mode == OB_MODE_GPENCIL_PAINT)
+               return "GPENCIL_OT_paintmode_toggle";
+       if (mode == OB_MODE_GPENCIL_SCULPT)
+               return "GPENCIL_OT_sculptmode_toggle";
+       if (mode == OB_MODE_GPENCIL_WEIGHT)
+               return "GPENCIL_OT_weightmode_toggle"; 
        return NULL;
 }
 
@@ -82,8 +89,6 @@ bool ED_object_mode_compat_test(const Object *ob, eObjectMode 
mode)
        if (ob) {
                if (mode == OB_MODE_OBJECT)
                        return true;
-               else if (mode == OB_MODE_GPENCIL)
-                       return true; /* XXX: assume this is the case for now... 
*/
 
                switch (ob->type) {
                        case OB_MESH:
@@ -108,6 +113,13 @@ bool ED_object_mode_compat_test(const Object *ob, 
eObjectMode mode)
                                if (mode & (OB_MODE_EDIT | OB_MODE_POSE))
                                        return true;
                                break;
+                       case OB_GPENCIL:
+                               if (mode & (OB_MODE_GPENCIL_EDIT | 
OB_MODE_GPENCIL_PAINT |
+                                       OB_MODE_GPENCIL_SCULPT | 
OB_MODE_GPENCIL_WEIGHT))
+                               {
+                                       return true;
+                               }
+                               break;
                }
        }

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to