Blender V2.61 - r43446
|
00001 /* 00002 * ***** BEGIN GPL LICENSE BLOCK ***** 00003 * 00004 * This program is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public License 00006 * as published by the Free Software Foundation; either version 2 00007 * of the License, or (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software Foundation, 00016 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00017 * 00018 * Contributor(s): Miika Hämäläinen 00019 * 00020 * ***** END GPL LICENSE BLOCK ***** 00021 * 00022 */ 00023 00028 #ifndef DNA_DYNAMICPAINT_TYPES_H 00029 #define DNA_DYNAMICPAINT_TYPES_H 00030 00031 #include "DNA_listBase.h" 00032 struct CurveMapping; 00033 struct PaintSurfaceData; 00034 00035 /* surface format */ 00036 #define MOD_DPAINT_SURFACE_F_PTEX 0 00037 #define MOD_DPAINT_SURFACE_F_VERTEX 1 00038 #define MOD_DPAINT_SURFACE_F_IMAGESEQ 2 00039 00040 /* surface type */ 00041 #define MOD_DPAINT_SURFACE_T_PAINT 0 00042 #define MOD_DPAINT_SURFACE_T_DISPLACE 1 00043 #define MOD_DPAINT_SURFACE_T_WEIGHT 2 00044 #define MOD_DPAINT_SURFACE_T_WAVE 3 00045 00046 /* surface flags */ 00047 #define MOD_DPAINT_ACTIVE (1<<0) /* Is surface enabled */ 00048 00049 #define MOD_DPAINT_ANTIALIAS (1<<1) /* do antialiasing */ 00050 #define MOD_DPAINT_DISSOLVE (1<<2) /* do dissolve */ 00051 #define MOD_DPAINT_MULALPHA (1<<3) /* Multiply color by alpha when saving image */ 00052 #define MOD_DPAINT_DISSOLVE_LOG (1<<4) /* Use 1/x for surface dissolve */ 00053 #define MOD_DPAINT_DRY_LOG (1<<5) /* Use 1/x for drying paint */ 00054 #define MOD_DPAINT_PREVIEW (1<<6) /* preview this surface on viewport*/ 00055 00056 #define MOD_DPAINT_WAVE_OPEN_BORDERS (1<<7) /* passes waves through mesh edges */ 00057 #define MOD_DPAINT_DISP_INCREMENTAL (1<<8) /* builds displace on top of earlier values */ 00058 #define MOD_DPAINT_USE_DRYING (1<<9) /* use drying */ 00059 00060 #define MOD_DPAINT_OUT1 (1<<10) /* output primary surface */ 00061 #define MOD_DPAINT_OUT2 (1<<11) /* output secondary surface */ 00062 00063 /* image_fileformat */ 00064 #define MOD_DPAINT_IMGFORMAT_PNG 0 00065 #define MOD_DPAINT_IMGFORMAT_OPENEXR 1 00066 00067 /* disp_format */ 00068 #define MOD_DPAINT_DISP_DISPLACE 0 /* displacement output displace map */ 00069 #define MOD_DPAINT_DISP_DEPTH 1 /* displacement output depth data */ 00070 00071 /* effect */ 00072 #define MOD_DPAINT_EFFECT_DO_SPREAD (1<<0) /* do spread effect */ 00073 #define MOD_DPAINT_EFFECT_DO_DRIP (1<<1) /* do drip effect */ 00074 #define MOD_DPAINT_EFFECT_DO_SHRINK (1<<2) /* do shrink effect */ 00075 00076 /* preview_id */ 00077 #define MOD_DPAINT_SURFACE_PREV_PAINT 0 00078 #define MOD_DPAINT_SURFACE_PREV_WETMAP 1 00079 00080 /* init_color_type */ 00081 #define MOD_DPAINT_INITIAL_NONE 0 00082 #define MOD_DPAINT_INITIAL_COLOR 1 00083 #define MOD_DPAINT_INITIAL_TEXTURE 2 00084 #define MOD_DPAINT_INITIAL_VERTEXCOLOR 3 00085 00086 typedef struct DynamicPaintSurface { 00087 00088 struct DynamicPaintSurface *next, *prev; 00089 struct DynamicPaintCanvasSettings *canvas; /* for fast RNA access */ 00090 struct PaintSurfaceData *data; 00091 00092 struct Group *brush_group; 00093 struct EffectorWeights *effector_weights; 00094 00095 /* cache */ 00096 struct PointCache *pointcache; 00097 struct ListBase ptcaches; 00098 int current_frame; 00099 00100 /* surface */ 00101 char name[64]; 00102 short format, type; 00103 short disp_type, image_fileformat; 00104 short effect_ui; /* ui selection box */ 00105 short preview_id; /* surface output id to preview */ 00106 short init_color_type, pad_s; 00107 int flags, effect; 00108 00109 int image_resolution, substeps; 00110 int start_frame, end_frame, pad; 00111 00112 /* initial color */ 00113 float init_color[4]; 00114 struct Tex *init_texture; 00115 char init_layername[64]; /* MAX_CUSTOMDATA_LAYER_NAME */ 00116 00117 int dry_speed, diss_speed; 00118 float color_dry_threshold; 00119 float depth_clamp, disp_factor; 00120 00121 float spread_speed, color_spread_speed, shrink_speed; 00122 float drip_vel, drip_acc; 00123 00124 /* per surface brush settings */ 00125 float influence_scale, radius_scale; 00126 00127 /* wave settings */ 00128 float wave_damping, wave_speed, wave_timescale, wave_spring; 00129 00130 char uvlayer_name[64]; /* MAX_CUSTOMDATA_LAYER_NAME */ 00131 char image_output_path[240]; /* 240 = FILE_MAX */ 00132 char output_name[64]; /* MAX_CUSTOMDATA_LAYER_NAME */ 00133 char output_name2[64]; /* MAX_CUSTOMDATA_LAYER_NAME */ /* some surfaces have 2 outputs */ 00134 00135 } DynamicPaintSurface; 00136 00137 /* canvas flags */ 00138 #define MOD_DPAINT_PREVIEW_READY (1<<0) /* if viewport preview is ready */ 00139 #define MOD_DPAINT_BAKING (1<<1) /* surface is already baking, so it wont get updated (loop) */ 00140 00141 /* Canvas settings */ 00142 typedef struct DynamicPaintCanvasSettings { 00143 struct DynamicPaintModifierData *pmd; /* for fast RNA access */ 00144 struct DerivedMesh *dm; 00145 00146 struct ListBase surfaces; 00147 short active_sur, flags; 00148 int pad; 00149 00150 char error[64]; /* Bake error description */ 00151 00152 } DynamicPaintCanvasSettings; 00153 00154 00155 /* flags */ 00156 #define MOD_DPAINT_PART_RAD (1<<0) /* use particle radius */ 00157 #define MOD_DPAINT_USE_MATERIAL (1<<1) /* use object material */ 00158 #define MOD_DPAINT_ABS_ALPHA (1<<2) /* don't increase alpha unless 00159 paint alpha is higher than existing */ 00160 #define MOD_DPAINT_ERASE (1<<3) /* removes paint */ 00161 00162 #define MOD_DPAINT_RAMP_ALPHA (1<<4) /* only read falloff ramp alpha */ 00163 #define MOD_DPAINT_PROX_PROJECT (1<<5) /* do proximity check only in defined dir */ 00164 #define MOD_DPAINT_INVERSE_PROX (1<<6) /* inverse proximity painting */ 00165 #define MOD_DPAINT_NEGATE_VOLUME (1<<7) /* negates volume influence on "volume + prox" mode */ 00166 00167 #define MOD_DPAINT_DO_SMUDGE (1<<8) /* brush smudges existing paint */ 00168 #define MOD_DPAINT_VELOCITY_ALPHA (1<<9) /* multiply brush influence by velocity */ 00169 #define MOD_DPAINT_VELOCITY_COLOR (1<<10) /* replace brush color by velocity color ramp */ 00170 #define MOD_DPAINT_VELOCITY_DEPTH (1<<11) /* multiply brush intersection depth by velocity */ 00171 00172 #define MOD_DPAINT_USES_VELOCITY ((1<<8)|(1<<9)|(1<<10)|(1<<11)) 00173 00174 /* collision type */ 00175 #define MOD_DPAINT_COL_VOLUME 0 /* paint with mesh volume */ 00176 #define MOD_DPAINT_COL_DIST 1 /* paint using distance to mesh surface */ 00177 #define MOD_DPAINT_COL_VOLDIST 2 /* use both volume and distance */ 00178 #define MOD_DPAINT_COL_PSYS 3 /* use particle system */ 00179 #define MOD_DPAINT_COL_POINT 4 /* use distance to object center point */ 00180 00181 /* proximity_falloff */ 00182 #define MOD_DPAINT_PRFALL_CONSTANT 0 /* no-falloff */ 00183 #define MOD_DPAINT_PRFALL_SMOOTH 1 /* smooth, linear falloff */ 00184 #define MOD_DPAINT_PRFALL_RAMP 2 /* use color ramp */ 00185 00186 /* wave_brush_type */ 00187 #define MOD_DPAINT_WAVEB_DEPTH 0 /* use intersection depth */ 00188 #define MOD_DPAINT_WAVEB_FORCE 1 /* act as a force on intersection area */ 00189 #define MOD_DPAINT_WAVEB_REFLECT 2 /* obstacle that reflects waves */ 00190 #define MOD_DPAINT_WAVEB_CHANGE 3 /* use change of intersection depth from previous frame */ 00191 00192 /* brush ray_dir */ 00193 #define MOD_DPAINT_RAY_CANVAS 0 00194 #define MOD_DPAINT_RAY_BRUSH_AVG 1 00195 #define MOD_DPAINT_RAY_ZPLUS 2 00196 00197 00198 /* Brush settings */ 00199 typedef struct DynamicPaintBrushSettings { 00200 struct DynamicPaintModifierData *pmd; /* for fast RNA access */ 00201 struct DerivedMesh *dm; 00202 struct ParticleSystem *psys; 00203 struct Material *mat; 00204 00205 int flags; 00206 int collision; 00207 00208 float r, g, b, alpha; 00209 float wetness; 00210 00211 float particle_radius, particle_smooth; 00212 float paint_distance; 00213 00214 /* color ramps */ 00215 struct ColorBand *paint_ramp; /* Proximity paint falloff */ 00216 struct ColorBand *vel_ramp; /* Velocity paint ramp */ 00217 00218 short proximity_falloff; 00219 short wave_type; 00220 short ray_dir; 00221 short pad; 00222 00223 float wave_factor, wave_clamp; 00224 float max_velocity, smudge_strength; 00225 } DynamicPaintBrushSettings; 00226 00227 #endif