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:
authorJacques Lucke <jacques@blender.org>2022-02-15 14:32:15 +0300
committerJacques Lucke <jacques@blender.org>2022-02-15 14:32:15 +0300
commit07032dd218922d2f1ba3275470bee01579f739c7 (patch)
tree0dbb41127ef33eb1006ba1b49d552c40d3c4d884 /source/blender/makesdna
parent07ed869b94fa8acf18d64864c6d8662bfbec33dd (diff)
Curves: add initial sculpt mode
This adds a new sculpt mode to the experimental new curves object. Currently, this mode can only be entered and exited, nothing else. The main initial purpose of this node will be to use it for hair grooming. The patch also adds the `editors/curves/` directory for the new curves object, which will be necessary for many other things as well. I added a completely new mode (`OB_MODE_SCULPT_CURVES`), because `OB_MODE_SCULPT` seems to be rather specific to meshes, and reusing it doesn't seem worth the trouble. The tools/brushes used in mesh vs. curves sculpt mode are quite distinct as well. I had to add DNA_userdef_enums.h to make the patch compile with C++ (forward declaration of enums isn't allowed). This follows the same pattern that we use for other enums in dna. Differential Revision: https://developer.blender.org/D14107
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/DNA_object_enums.h3
-rw-r--r--source/blender/makesdna/DNA_userdef_enums.h48
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h34
3 files changed, 51 insertions, 34 deletions
diff --git a/source/blender/makesdna/DNA_object_enums.h b/source/blender/makesdna/DNA_object_enums.h
index ce9b97284bc..3a3e4a01d7c 100644
--- a/source/blender/makesdna/DNA_object_enums.h
+++ b/source/blender/makesdna/DNA_object_enums.h
@@ -27,6 +27,7 @@ typedef enum eObjectMode {
OB_MODE_SCULPT_GPENCIL = 1 << 9,
OB_MODE_WEIGHT_GPENCIL = 1 << 10,
OB_MODE_VERTEX_GPENCIL = 1 << 11,
+ OB_MODE_SCULPT_CURVES = 1 << 12,
} eObjectMode;
/** #Object.dt, #View3DShading.type */
@@ -60,7 +61,7 @@ typedef enum eDrawType {
#define OB_MODE_ALL_MODE_DATA \
(OB_MODE_EDIT | OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT | OB_MODE_SCULPT | OB_MODE_POSE | \
OB_MODE_PAINT_GPENCIL | OB_MODE_EDIT_GPENCIL | OB_MODE_SCULPT_GPENCIL | \
- OB_MODE_WEIGHT_GPENCIL | OB_MODE_VERTEX_GPENCIL)
+ OB_MODE_WEIGHT_GPENCIL | OB_MODE_VERTEX_GPENCIL | OB_MODE_SCULPT_CURVES)
#ifdef __cplusplus
}
diff --git a/source/blender/makesdna/DNA_userdef_enums.h b/source/blender/makesdna/DNA_userdef_enums.h
new file mode 100644
index 00000000000..bb061e73c9c
--- /dev/null
+++ b/source/blender/makesdna/DNA_userdef_enums.h
@@ -0,0 +1,48 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+/** \file
+ * \ingroup DNA
+ */
+
+#pragma once
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** #UserDef.dupflag */
+typedef enum eDupli_ID_Flags {
+ USER_DUP_MESH = (1 << 0),
+ USER_DUP_CURVE = (1 << 1),
+ USER_DUP_SURF = (1 << 2),
+ USER_DUP_FONT = (1 << 3),
+ USER_DUP_MBALL = (1 << 4),
+ USER_DUP_LAMP = (1 << 5),
+ /* USER_DUP_FCURVE = (1 << 6), */ /* UNUSED, keep because we may implement. */
+ USER_DUP_MAT = (1 << 7),
+ /* USER_DUP_TEX = (1 << 8), */ /* UNUSED, keep because we may implement. */
+ USER_DUP_ARM = (1 << 9),
+ USER_DUP_ACT = (1 << 10),
+ USER_DUP_PSYS = (1 << 11),
+ USER_DUP_LIGHTPROBE = (1 << 12),
+ USER_DUP_GPENCIL = (1 << 13),
+ USER_DUP_CURVES = (1 << 14),
+ USER_DUP_POINTCLOUD = (1 << 15),
+ USER_DUP_VOLUME = (1 << 16),
+ USER_DUP_LATTICE = (1 << 17),
+ USER_DUP_CAMERA = (1 << 18),
+ USER_DUP_SPEAKER = (1 << 19),
+
+ USER_DUP_OBDATA = (~0) & ((1 << 24) - 1),
+
+ /* Those are not exposed as user preferences, only used internally. */
+ USER_DUP_OBJECT = (1 << 24),
+ /* USER_DUP_COLLECTION = (1 << 25), */ /* UNUSED, keep because we may implement. */
+
+ /* Duplicate (and hence make local) linked data. */
+ USER_DUP_LINKED_ID = (1 << 30),
+} eDupli_ID_Flags;
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index 59b17c5c7c4..e081be73a1c 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -9,6 +9,7 @@
#include "DNA_listBase.h"
#include "DNA_texture_types.h" /* ColorBand */
+#include "DNA_userdef_enums.h"
#ifdef __cplusplus
extern "C" {
@@ -1220,39 +1221,6 @@ typedef enum eUserpref_Translation_Flags {
USER_TR_NEWDATANAME = (1 << 8),
} eUserpref_Translation_Flags;
-/** #UserDef.dupflag */
-typedef enum eDupli_ID_Flags {
- USER_DUP_MESH = (1 << 0),
- USER_DUP_CURVE = (1 << 1),
- USER_DUP_SURF = (1 << 2),
- USER_DUP_FONT = (1 << 3),
- USER_DUP_MBALL = (1 << 4),
- USER_DUP_LAMP = (1 << 5),
- /* USER_DUP_FCURVE = (1 << 6), */ /* UNUSED, keep because we may implement. */
- USER_DUP_MAT = (1 << 7),
- /* USER_DUP_TEX = (1 << 8), */ /* UNUSED, keep because we may implement. */
- USER_DUP_ARM = (1 << 9),
- USER_DUP_ACT = (1 << 10),
- USER_DUP_PSYS = (1 << 11),
- USER_DUP_LIGHTPROBE = (1 << 12),
- USER_DUP_GPENCIL = (1 << 13),
- USER_DUP_CURVES = (1 << 14),
- USER_DUP_POINTCLOUD = (1 << 15),
- USER_DUP_VOLUME = (1 << 16),
- USER_DUP_LATTICE = (1 << 17),
- USER_DUP_CAMERA = (1 << 18),
- USER_DUP_SPEAKER = (1 << 19),
-
- USER_DUP_OBDATA = (~0) & ((1 << 24) - 1),
-
- /* Those are not exposed as user preferences, only used internally. */
- USER_DUP_OBJECT = (1 << 24),
- /* USER_DUP_COLLECTION = (1 << 25), */ /* UNUSED, keep because we may implement. */
-
- /* Duplicate (and hence make local) linked data. */
- USER_DUP_LINKED_ID = (1 << 30),
-} eDupli_ID_Flags;
-
/**
* Text Editor options
* #UserDef.text_flag