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:
authorPablo Dobarro <pablodp606@gmail.com>2020-06-22 21:05:28 +0300
committerPablo Dobarro <pablodp606@gmail.com>2020-06-23 17:28:50 +0300
commitf7bbc7cdbb6cb0d28504c6a8dd51bee5330d1f17 (patch)
tree1045d1253114fb67286330f069bde6eb0e7bb068 /source/blender/makesdna
parent27972c4225c26780eb957ddf0c98ce4cee3d29e5 (diff)
Sculpt Vertex Colors: Initial implementation
Sculpt Vertex Colors is a painting system that runs inside sculpt mode, reusing all its tools and optimizations. This provides much better performance, easier to maintain code and more advanced features (new brush engine, filters, symmetry options, masks and face sets compatibility...). This is also the initial step for future features like vertex painting in Multires and brushes that can sculpt and paint at the same time. This commit includes: - SCULPT_UNDO_COLOR for undo support in sculpt mode - SCULPT_UPDATE_COLOR and PBVH flags and rendering - Sculpt Color API functions - Sculpt capability for sculpt tools (only enabled in the Paint Brush for now) - Rendering support in workbench (default to Sculpt Vertex Colors except in Vertex Paint) - Conversion operator between MPropCol (Sculpt Vertex Colors) and MLoopCol (Vertex Paint) - Remesher reprojection in the Voxel Remehser - Paint Brush and Smear Brush with color smoothing in alt-smooth mode - Parameters for the new brush engine (density, opacity, flow, wet paint mixing, tip scale) implemented in Sculpt Vertex Colors - Color Filter - Color picker (uses S shortcut, replaces smooth) - Color selector in the top bar Reviewed By: brecht Maniphest Tasks: T72866 Differential Revision: https://developer.blender.org/D5975
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/DNA_brush_types.h26
-rw-r--r--source/blender/makesdna/DNA_customdata_types.h5
-rw-r--r--source/blender/makesdna/DNA_mesh_types.h3
-rw-r--r--source/blender/makesdna/DNA_meshdata_types.h2
4 files changed, 25 insertions, 11 deletions
diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h
index 7490dbe5cdc..a1c69af4750 100644
--- a/source/blender/makesdna/DNA_brush_types.h
+++ b/source/blender/makesdna/DNA_brush_types.h
@@ -439,6 +439,21 @@ typedef struct Brush {
float rgb[3];
/** Opacity. */
float alpha;
+ /** Hardness */
+ float hardness;
+ /** Flow */
+ float flow;
+ /** Wet Mix */
+ float wet_mix;
+ float wet_persistence;
+ /** Density */
+ float density;
+
+ /** Tip Shape */
+ /* Factor that controls the shape of the brush tip by rounding the corners of a square. */
+ /* 0.0 value produces a square, 1.0 produces a circle. */
+ float tip_roundness;
+ float tip_scale_x;
/** Background color. */
float secondary_rgb[3];
@@ -459,7 +474,7 @@ typedef struct Brush {
/** Source for fill tool color gradient application. */
char gradient_fill_mode;
- char _pad0[1];
+ char _pad0[5];
/** Projection shape (sphere, circle). */
char falloff_shape;
@@ -503,16 +518,11 @@ typedef struct Brush {
float texture_sample_bias;
int curve_preset;
- float hardness;
/* automasking */
int automasking_flags;
int automasking_boundary_edges_propagation_steps;
- /* Factor that controls the shape of the brush tip by rounding the corners of a square. */
- /* 0.0 value produces a square, 1.0 produces a circle. */
- float tip_roundness;
-
int elastic_deform_type;
float elastic_deform_volume_preservation;
@@ -720,6 +730,8 @@ typedef enum eBrushSculptTool {
SCULPT_TOOL_CLAY_THUMB = 25,
SCULPT_TOOL_CLOTH = 26,
SCULPT_TOOL_DRAW_FACE_SETS = 27,
+ SCULPT_TOOL_PAINT = 28,
+ SCULPT_TOOL_SMEAR = 29,
} eBrushSculptTool;
/* Brush.uv_sculpt_tool */
@@ -762,6 +774,8 @@ typedef enum eBrushUVSculptTool {
SCULPT_TOOL_ELASTIC_DEFORM, \
SCULPT_TOOL_POSE, \
SCULPT_TOOL_DRAW_FACE_SETS, \
+ SCULPT_TOOL_PAINT, \
+ SCULPT_TOOL_SMEAR, \
\
/* These brushes could handle dynamic topology, \ \
* but user feedback indicates it's better not to */ \
diff --git a/source/blender/makesdna/DNA_customdata_types.h b/source/blender/makesdna/DNA_customdata_types.h
index e4999fd4464..c24bbccae1e 100644
--- a/source/blender/makesdna/DNA_customdata_types.h
+++ b/source/blender/makesdna/DNA_customdata_types.h
@@ -148,10 +148,9 @@ typedef enum CustomDataType {
CD_CUSTOMLOOPNORMAL = 41,
CD_SCULPT_FACE_SETS = 42,
- /* Hair and PointCloud */
CD_LOCATION = 43,
- CD_RADIUS = 44,
CD_HAIRCURVE = 45,
+ CD_RADIUS = 44,
CD_HAIRMAPPING = 46,
CD_PROP_COLOR = 47,
@@ -205,7 +204,7 @@ typedef enum CustomDataType {
#define CD_MASK_TESSLOOPNORMAL (1LL << CD_TESSLOOPNORMAL)
#define CD_MASK_CUSTOMLOOPNORMAL (1LL << CD_CUSTOMLOOPNORMAL)
#define CD_MASK_SCULPT_FACE_SETS (1LL << CD_SCULPT_FACE_SETS)
-#define CD_MASK_PROP_COLOR (1LL << CD_PROP_COLOR)
+#define CD_MASK_PROP_COLOR (1ULL << CD_PROP_COLOR)
/** Data types that may be defined for all mesh elements types. */
#define CD_MASK_GENERIC_DATA (CD_MASK_PROP_FLOAT | CD_MASK_PROP_INT32 | CD_MASK_PROP_STRING)
diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h
index acc020ec710..f802dd8c55b 100644
--- a/source/blender/makesdna/DNA_mesh_types.h
+++ b/source/blender/makesdna/DNA_mesh_types.h
@@ -46,6 +46,7 @@ struct MLoopTri;
struct MLoopUV;
struct MPoly;
struct MVert;
+struct MPropCol;
struct Material;
struct Mesh;
struct Multires;
@@ -285,7 +286,7 @@ enum {
ME_AUTOSMOOTH = 1 << 5,
ME_FLAG_UNUSED_6 = 1 << 6, /* cleared */
ME_FLAG_UNUSED_7 = 1 << 7, /* cleared */
- ME_FLAG_UNUSED_8 = 1 << 8, /* cleared */
+ ME_REMESH_REPROJECT_VERTEX_COLORS = 1 << 8,
ME_DS_EXPAND = 1 << 9,
ME_SCULPT_DYNAMIC_TOPOLOGY = 1 << 10,
ME_REMESH_SMOOTH_NORMALS = 1 << 11,
diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h
index 04deecde43e..cc2ba3fb999 100644
--- a/source/blender/makesdna/DNA_meshdata_types.h
+++ b/source/blender/makesdna/DNA_meshdata_types.h
@@ -345,7 +345,7 @@ typedef struct MLoopCol {
} MLoopCol;
typedef struct MPropCol {
- float col[4];
+ float color[4];
} MPropCol;
/** Multi-Resolution loop data. */