DPAINT_OT_output_toggle operator was using an index option for what was really a...
[blender.git] / source / blender / blenkernel / BKE_dynamicpaint.h
1 /**
2  * ***** BEGIN GPL LICENSE BLOCK *****
3  *
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.
8  *
9  * Contributor(s): Miika Hämäläinen
10  *
11  * ***** END GPL LICENSE BLOCK *****
12  */
13
14 #ifndef BKE_DYNAMIC_PAINT_H_
15 #define BKE_DYNAMIC_PAINT_H_
16
17 struct bContext;
18 struct wmOperator;
19
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 */
25
26         struct PaintBakeData *bData; /* temporary per step data used for frame calculation */
27         int total_points;
28
29 } PaintSurfaceData;
30
31 /* Paint type surface point     */
32 typedef struct PaintPoint {
33
34         /* Wet paint is handled at effect layer only
35         *  and mixed to surface when drying */
36         float e_color[3];
37         float e_alpha;
38         float wetness;
39         short state;
40         float color[3];
41         float alpha;
42 } PaintPoint;
43
44 /* heigh field waves    */
45 typedef struct PaintWavePoint {         
46
47         float height;
48         float velocity;
49         short state;
50 } PaintWavePoint;
51
52 struct DerivedMesh *dynamicPaint_Modifier_do(struct DynamicPaintModifierData *pmd, struct Scene *scene, struct Object *ob, struct DerivedMesh *dm);
53 void dynamicPaint_Modifier_free (struct DynamicPaintModifierData *pmd);
54 void dynamicPaint_Modifier_copy(struct DynamicPaintModifierData *pmd, struct DynamicPaintModifierData *tsmd);
55
56 int dynamicPaint_createType(struct DynamicPaintModifierData *pmd, int type, struct Scene *scene);
57 struct DynamicPaintSurface *dynamicPaint_createNewSurface(struct DynamicPaintCanvasSettings *canvas, struct Scene *scene);
58 void dynamicPaint_clearSurface(struct DynamicPaintSurface *surface);
59 int  dynamicPaint_resetSurface(struct DynamicPaintSurface *surface);
60 void dynamicPaint_freeSurface(struct DynamicPaintSurface *surface);
61 void dynamicPaint_freeCanvas(struct DynamicPaintModifierData *pmd);
62 void dynamicPaint_freeBrush(struct DynamicPaintModifierData *pmd);
63 void dynamicPaint_freeSurfaceData(struct DynamicPaintSurface *surface);
64
65 void dynamicPaint_cacheUpdateFrames(struct DynamicPaintSurface *surface);
66 int  dynamicPaint_surfaceHasColorPreview(struct DynamicPaintSurface *surface);
67 int dynamicPaint_outputLayerExists(struct DynamicPaintSurface *surface, struct Object *ob, int output);
68 void dynamicPaintSurface_updateType(struct DynamicPaintSurface *surface);
69 void dynamicPaintSurface_setUniqueName(struct DynamicPaintSurface *surface, const char *basename);
70 void dynamicPaint_resetPreview(struct DynamicPaintCanvasSettings *canvas);
71 struct DynamicPaintSurface *get_activeSurface(struct DynamicPaintCanvasSettings *canvas);
72
73 /* image sequence baking */
74 int dynamicPaint_createUVSurface(struct DynamicPaintSurface *surface);
75 int dynamicPaint_calculateFrame(struct DynamicPaintSurface *surface, struct Scene *scene, struct Object *cObject, int frame);
76 void dynamicPaint_outputSurfaceImage(struct DynamicPaintSurface *surface, char* filename, short output_layer);
77
78 /* PaintPoint state */
79 #define DPAINT_PAINT_NONE -1
80 #define DPAINT_PAINT_DRY 0
81 #define DPAINT_PAINT_WET 1
82 #define DPAINT_PAINT_NEW 2
83
84 /* PaintWavePoint state */
85 #define DPAINT_WAVE_NONE 0
86 #define DPAINT_WAVE_OBSTACLE 1
87 #define DPAINT_WAVE_REFLECT_ONLY 2
88
89 #endif /* BKE_DYNAMIC_PAINT_H_ */