2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * Contributor(s): Miika Hämäläinen
11 * ***** END GPL LICENSE BLOCK *****
14 #ifndef BKE_DYNAMIC_PAINT_H_
15 #define BKE_DYNAMIC_PAINT_H_
20 /* Actual surface point */
21 typedef struct PaintSurfaceData {
22 void *format_data; /* special data for each surface "format" */
23 void *type_data; /* data used by specific surface type */
24 struct PaintAdjData *adj_data; /* adjacency data for current surface */
26 struct PaintBakeData *bData; /* temporary per step data used for frame calculation */
31 /* Paint type surface point */
32 typedef struct PaintPoint {
34 /* Wet paint is handled at effect layer only
35 * and mixed to surface when drying */
44 /* heigh field waves */
45 typedef struct PaintWavePoint {
53 struct DerivedMesh *dynamicPaint_Modifier_do(struct DynamicPaintModifierData *pmd, struct Scene *scene, struct Object *ob, struct DerivedMesh *dm);
54 void dynamicPaint_Modifier_free (struct DynamicPaintModifierData *pmd);
55 void dynamicPaint_Modifier_copy(struct DynamicPaintModifierData *pmd, struct DynamicPaintModifierData *tsmd);
57 int dynamicPaint_createType(struct DynamicPaintModifierData *pmd, int type, struct Scene *scene);
58 struct DynamicPaintSurface *dynamicPaint_createNewSurface(struct DynamicPaintCanvasSettings *canvas, struct Scene *scene);
59 void dynamicPaint_clearSurface(struct DynamicPaintSurface *surface);
60 int dynamicPaint_resetSurface(struct DynamicPaintSurface *surface);
61 void dynamicPaint_freeSurface(struct DynamicPaintSurface *surface);
62 void dynamicPaint_freeCanvas(struct DynamicPaintModifierData *pmd);
63 void dynamicPaint_freeBrush(struct DynamicPaintModifierData *pmd);
64 void dynamicPaint_freeSurfaceData(struct DynamicPaintSurface *surface);
66 void dynamicPaint_cacheUpdateFrames(struct DynamicPaintSurface *surface);
67 int dynamicPaint_surfaceHasColorPreview(struct DynamicPaintSurface *surface);
68 int dynamicPaint_outputLayerExists(struct DynamicPaintSurface *surface, struct Object *ob, int output);
69 void dynamicPaintSurface_updateType(struct DynamicPaintSurface *surface);
70 void dynamicPaintSurface_setUniqueName(struct DynamicPaintSurface *surface, const char *basename);
71 void dynamicPaint_resetPreview(struct DynamicPaintCanvasSettings *canvas);
72 struct DynamicPaintSurface *get_activeSurface(struct DynamicPaintCanvasSettings *canvas);
74 /* image sequence baking */
75 int dynamicPaint_createUVSurface(struct DynamicPaintSurface *surface);
76 int dynamicPaint_calculateFrame(struct DynamicPaintSurface *surface, struct Scene *scene, struct Object *cObject, int frame);
77 void dynamicPaint_outputSurfaceImage(struct DynamicPaintSurface *surface, char* filename, short output_layer);
79 /* PaintPoint state */
80 #define DPAINT_PAINT_NONE -1
81 #define DPAINT_PAINT_DRY 0
82 #define DPAINT_PAINT_WET 1
83 #define DPAINT_PAINT_NEW 2
85 /* PaintWavePoint state */
86 #define DPAINT_WAVE_ISECT_CHANGED -1
87 #define DPAINT_WAVE_NONE 0
88 #define DPAINT_WAVE_OBSTACLE 1
89 #define DPAINT_WAVE_REFLECT_ONLY 2
91 #endif /* BKE_DYNAMIC_PAINT_H_ */