1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
17 /** \file
18  * \ingroup DNA
19  *
20  * Enums typedef's for use in public headers.
21  */
22 
23 #pragma once
24 
25 /** #Object.mode */
26 typedef enum eObjectMode {
27   OB_MODE_OBJECT = 0,
28   OB_MODE_EDIT = 1 << 0,
29   OB_MODE_SCULPT = 1 << 1,
30   OB_MODE_VERTEX_PAINT = 1 << 2,
31   OB_MODE_WEIGHT_PAINT = 1 << 3,
32   OB_MODE_TEXTURE_PAINT = 1 << 4,
33   OB_MODE_PARTICLE_EDIT = 1 << 5,
34   OB_MODE_POSE = 1 << 6,
35   OB_MODE_EDIT_GPENCIL = 1 << 7,
36   OB_MODE_PAINT_GPENCIL = 1 << 8,
37   OB_MODE_SCULPT_GPENCIL = 1 << 9,
38   OB_MODE_WEIGHT_GPENCIL = 1 << 10,
39   OB_MODE_VERTEX_GPENCIL = 1 << 11,
40 } eObjectMode;
41 
42 /** #Object.dt, #View3DShading.type */
43 typedef enum eDrawType {
44   OB_BOUNDBOX = 1,
45   OB_WIRE = 2,
46   OB_SOLID = 3,
47   OB_MATERIAL = 4,
48   OB_TEXTURE = 5,
49   OB_RENDER = 6,
50 } eDrawType;
51 
52 /** Any mode where the brush system is used. */
53 #define OB_MODE_ALL_PAINT \
54   (OB_MODE_SCULPT | OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT | OB_MODE_TEXTURE_PAINT)
55 
56 #define OB_MODE_ALL_PAINT_GPENCIL \
57   (OB_MODE_PAINT_GPENCIL | OB_MODE_SCULPT_GPENCIL | OB_MODE_WEIGHT_GPENCIL | \
58    OB_MODE_VERTEX_GPENCIL)
59 
60 /** Any mode that uses Object.sculpt. */
61 #define OB_MODE_ALL_SCULPT (OB_MODE_SCULPT | OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT)
62 
63 /** Any mode that uses weightpaint. */
64 #define OB_MODE_ALL_WEIGHT_PAINT (OB_MODE_WEIGHT_PAINT | OB_MODE_WEIGHT_GPENCIL)
65 
66 /**
67  * Any mode that has data or for Grease Pencil modes, we need to free when switching modes,
68  * see: #ED_object_mode_generic_exit
69  */
70 #define OB_MODE_ALL_MODE_DATA \
71   (OB_MODE_EDIT | OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT | OB_MODE_SCULPT | OB_MODE_POSE | \
72    OB_MODE_PAINT_GPENCIL | OB_MODE_EDIT_GPENCIL | OB_MODE_SCULPT_GPENCIL | \
73    OB_MODE_WEIGHT_GPENCIL | OB_MODE_VERTEX_GPENCIL)
74