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:
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/DNA_material_types.h9
-rw-r--r--source/blender/makesdna/DNA_node_types.h2
-rw-r--r--source/blender/makesdna/DNA_scene_types.h34
3 files changed, 39 insertions, 6 deletions
diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h
index e83e68a091b..b535d3cdb8a 100644
--- a/source/blender/makesdna/DNA_material_types.h
+++ b/source/blender/makesdna/DNA_material_types.h
@@ -27,11 +27,16 @@ struct bNodeTree;
/* WATCH IT: change type? also make changes in ipo.h */
typedef struct TexPaintSlot {
- /** Image to be painted on. */
+ /** Image to be painted on. Mutual exclusive with attribute_name. */
struct Image *ima;
/** Custom-data index for uv layer, #MAX_NAME. */
char *uvname;
- /** Do we have a valid image and UV map. */
+ /**
+ * Color attribute name when painting using color attributes. Mutual exclusive with ima.
+ * Points to the name of a CustomDataLayer.
+ */
+ char *attribute_name;
+ /** Do we have a valid image and UV map or attribute. */
int valid;
/** Copy of node interpolation setting. */
int interp;
diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h
index ff7686d87af..5f909ea325b 100644
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@ -397,6 +397,8 @@ typedef struct bNode {
#define NODE_DO_OUTPUT_RECALC (1 << 17)
/* A preview for the data in this node can be displayed in the spreadsheet editor. */
#define __NODE_ACTIVE_PREVIEW (1 << 18) /* deprecated */
+/* Active node that is used to paint on. */
+#define NODE_ACTIVE_PAINT_CANVAS (1 << 19)
/* node->update */
#define NODE_UPDATE_ID 1 /* associated id data block has changed */
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index fb1ba15a099..9cc4d5ed55b 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -930,6 +930,19 @@ typedef struct ImagePaintSettings {
} ImagePaintSettings;
/* ------------------------------------------- */
+/* Paint mode settings */
+
+typedef struct PaintModeSettings {
+ /** Source to select canvas from to paint on (ePaintCanvasSource) */
+ char canvas_source;
+ char _pad[7];
+
+ /** Selected image when canvas_source=PAINT_CANVAS_SOURCE_IMAGE. */
+ Image *canvas_image;
+
+} PaintModeSettings;
+
+/* ------------------------------------------- */
/* Particle Edit */
/** Settings for a Particle Editing Brush. */
@@ -1462,6 +1475,9 @@ typedef struct ToolSettings {
/* Image Paint (8 bytes aligned please!) */
struct ImagePaintSettings imapaint;
+ /** Settings for paint mode. */
+ struct PaintModeSettings paint_mode;
+
/* Particle Editing */
struct ParticleEditSettings particle;
@@ -2278,11 +2294,21 @@ typedef enum eSculptFlags {
SCULPT_HIDE_FACE_SETS = (1 << 17),
} eSculptFlags;
+/** PaintModeSettings.mode */
+typedef enum ePaintCanvasSource {
+ /** Paint on the active node of the active material slot. */
+ PAINT_CANVAS_SOURCE_MATERIAL = 0,
+ /** Paint on a selected image. */
+ PAINT_CANVAS_SOURCE_IMAGE = 1,
+ /** Paint on the active color attribute (vertex color) layer. */
+ PAINT_CANVAS_SOURCE_COLOR_ATTRIBUTE = 2,
+} ePaintCanvasSource;
+
/** #ImagePaintSettings.mode */
-typedef enum eImagePaintMode {
- IMAGEPAINT_MODE_MATERIAL = 0, /* detect texture paint slots from the material */
- IMAGEPAINT_MODE_IMAGE = 1, /* select texture paint image directly */
-} eImagePaintMode;
+/* Defines to let old texture painting use the new enum. */
+/* TODO(jbakker): rename usages. */
+#define IMAGEPAINT_MODE_MATERIAL PAINT_CANVAS_SOURCE_MATERIAL
+#define IMAGEPAINT_MODE_IMAGE PAINT_CANVAS_SOURCE_IMAGE
/** #ImagePaintSettings.interp */
enum {