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:
authorMiika Hamalainen <blender@miikah.org>2011-05-24 11:08:58 +0400
committerMiika Hamalainen <blender@miikah.org>2011-05-24 11:08:58 +0400
commit3b41ab432badf2d4598b798e0d0c6c9ece51172b (patch)
tree8b646a88ae5dbc8441b0434fc925f7e3f09c7bb5 /source/blender/makesdna
parent25e276d3570d292f7e0a1306a864419024465d3b (diff)
Applied Dynamic Paint 1.18f patch as a codebase for GSoC.
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/DNA_dynamicpaint_types.h132
-rw-r--r--source/blender/makesdna/DNA_modifier_types.h19
-rw-r--r--source/blender/makesdna/intern/makesdna.c2
3 files changed, 153 insertions, 0 deletions
diff --git a/source/blender/makesdna/DNA_dynamicpaint_types.h b/source/blender/makesdna/DNA_dynamicpaint_types.h
new file mode 100644
index 00000000000..96b673fc70b
--- /dev/null
+++ b/source/blender/makesdna/DNA_dynamicpaint_types.h
@@ -0,0 +1,132 @@
+/**
+* ***** BEGIN GPL LICENSE BLOCK *****
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* Contributor(s): Miika Hämäläinen
+*
+* ***** END GPL LICENSE BLOCK *****
+*/
+#ifndef DNA_DYNAMICPAINT_TYPES_H
+#define DNA_DYNAMICPAINT_TYPES_H
+
+struct CurveMapping;
+
+/* flags */
+#define MOD_DPAINT_ANTIALIAS (1<<0) /* do antialiasing */
+#define MOD_DPAINT_DISSOLVE (1<<1) /* do dissolve */
+#define MOD_DPAINT_FLATTEN (1<<2) /* do displace flatten */
+#define MOD_DPAINT_MULALPHA (1<<3) /* Multiply color by alpha when saving */
+
+#define MOD_DPAINT_DRY_LOG (1<<4) /* Use 1/x for drying paint */
+
+/* output */
+#define MOD_DPAINT_OUT_PAINT (1<<0) /* output paint texture */
+#define MOD_DPAINT_OUT_WET (1<<1) /* output wetmap */
+#define MOD_DPAINT_OUT_DISP (1<<2) /* output displace texture */
+
+/* disp_type */
+#define MOD_DPAINT_DISPFOR_PNG 0 /* displacement output format */
+#define MOD_DPAINT_DISPFOR_OPENEXR 1 /* displacement output format */
+
+/* disp_format */
+#define MOD_DPAINT_DISP_DISPLACE 0 /* displacement output displace map */
+#define MOD_DPAINT_DISP_DEPTH 1 /* displacement output depth data */
+
+/* effect */
+#define MOD_DPAINT_EFFECT_DO_SPREAD (1<<0) /* do spread effect */
+#define MOD_DPAINT_EFFECT_DO_DRIP (1<<1) /* do spread effect */
+#define MOD_DPAINT_EFFECT_DO_SHRINK (1<<2) /* do spread effect */
+
+
+/* Canvas settings */
+typedef struct DynamicPaintCanvasSettings {
+ struct DynamicPaintModifierData *pmd; /* for fast RNA access */
+ struct DerivedMesh *dm;
+ struct PaintSurface *surface;
+
+ int flags;
+ int output;
+ short disp_type, disp_format;
+ int effect;
+ short effect_ui; // just ui selection box
+ short pad; // replace if need for another short
+
+ int resolution;
+ int start_frame, end_frame;
+ int substeps;
+
+ int dry_speed;
+ int diss_speed;
+ float disp_depth;
+ int dflat_speed; // displace flattening speed
+
+ char paint_output_path[240], wet_output_path[240], displace_output_path[240];
+
+ float spread_speed, drip_speed, shrink_speed;
+ char uvlayer_name[32];
+
+ char ui_info[128]; // UI info text
+ char error[64]; // Bake error description
+
+} DynamicPaintCanvasSettings;
+
+
+/* flags */
+#define MOD_DPAINT_PART_RAD (1<<0) /* use particle radius */
+#define MOD_DPAINT_DO_PAINT (1<<1) /* use particle radius */
+#define MOD_DPAINT_DO_WETNESS (1<<2) /* use particle radius */
+#define MOD_DPAINT_DO_DISPLACE (1<<3) /* use particle radius */
+
+#define MOD_DPAINT_USE_MATERIAL (1<<4) /* use object material */
+#define MOD_DPAINT_ABS_ALPHA (1<<5) /* doesn't increase alpha unless
+ paint alpha is higher than existing */
+#define MOD_DPAINT_ERASE (1<<6) /* removes paint */
+
+#define MOD_DPAINT_RAMP_ALPHA (1<<7) /* only read falloff ramp alpha */
+#define MOD_DPAINT_EDGE_DISP (1<<8) /* add displacement to intersection edges */
+#define MOD_DPAINT_PROX_FACEALIGNED (1<<9) /* do proximity check only in normal dir */
+
+/* collision type */
+#define MOD_DPAINT_COL_VOLUME 1 /* paint with mesh volume */
+#define MOD_DPAINT_COL_DIST 2 /* paint using distance to mesh surface */
+#define MOD_DPAINT_COL_VOLDIST 3 /* use both volume and distance */
+#define MOD_DPAINT_COL_PSYS 4 /* use particle system */
+
+/* proximity_falloff */
+#define MOD_DPAINT_PRFALL_SHARP 0 /* no-falloff */
+#define MOD_DPAINT_PRFALL_SMOOTH 1 /* smooth, linear falloff */
+#define MOD_DPAINT_PRFALL_RAMP 2 /* use color ramp */
+
+
+/* Painter settings */
+typedef struct DynamicPaintPainterSettings {
+ struct DynamicPaintModifierData *pmd; /* for fast RNA access */
+ struct DerivedMesh *dm;
+ struct ParticleSystem *psys;
+ struct Material *mat;
+
+ int flags;
+ int collision;
+
+ float r, g, b, alpha;
+ float wetness;
+
+ float particle_radius, particle_smooth;
+ float paint_distance;
+ float displace_distance, prox_displace_strength;
+
+ // Falloff curves
+ struct ColorBand *paint_ramp; /* Proximity paint falloff */
+
+ short proximity_falloff;
+ short pad; // replace if need for new value
+ int pad2; // replace if need for new value
+
+ //int pad;
+} DynamicPaintPainterSettings;
+
+#endif
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index d2d8e014015..f7d30a45e6b 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -71,6 +71,7 @@ typedef enum ModifierType {
eModifierType_Solidify,
eModifierType_Screw,
eModifierType_Warp,
+ eModifierType_DynamicPaint,
NUM_MODIFIER_TYPES
} ModifierType;
@@ -749,6 +750,9 @@ typedef struct ScrewModifierData {
typedef struct WarpModifierData {
ModifierData modifier;
+
+
+
/* keep in sync with MappingInfoModifierData */
struct Tex *texture;
struct Object *map_object;
@@ -783,5 +787,20 @@ typedef enum {
eWarp_Falloff_Sphere = 7, /* PROP_SPHERE */
/* PROP_RANDOM not used */
} WarpModifierFalloff;
+/* Dynamic paint modifier flags */
+#define MOD_DYNAMICPAINT_TYPE_CANVAS (1 << 0)
+#define MOD_DYNAMICPAINT_TYPE_PAINT (1 << 1)
+typedef struct DynamicPaintModifierData {
+ ModifierData modifier;
+
+ struct DynamicPaintCanvasSettings *canvas;
+ struct DynamicPaintPainterSettings *paint;
+ float time;
+ int type; /* canvas / painter */
+ short baking; /* Set nonzero if baking,
+ * -> updates derived mesh on modifier call*/
+ short pad;
+ int pad2;
+} DynamicPaintModifierData;
#endif
diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c
index 07ee084f976..0508874ed0c 100644
--- a/source/blender/makesdna/intern/makesdna.c
+++ b/source/blender/makesdna/intern/makesdna.c
@@ -132,6 +132,7 @@ const char *includefiles[] = {
"DNA_anim_types.h",
"DNA_boid_types.h",
"DNA_smoke_types.h",
+ "DNA_dynamicpaint_types.h",
// empty string to indicate end of includefiles
""
@@ -1183,4 +1184,5 @@ int main(int argc, char ** argv)
#include "DNA_anim_types.h"
#include "DNA_boid_types.h"
#include "DNA_smoke_types.h"
+#include "DNA_dynamicpaint_types.h"
/* end of list */