2011-05-24 07:08:58 +00:00
|
|
|
/**
|
|
|
|
* ***** 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.
|
|
|
|
*
|
2011-11-10 12:28:26 +00:00
|
|
|
* Contributor(s): Miika Hämäläinen
|
2011-05-24 07:08:58 +00:00
|
|
|
*
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef BKE_DYNAMIC_PAINT_H_
|
|
|
|
#define BKE_DYNAMIC_PAINT_H_
|
|
|
|
|
2011-09-05 16:04:15 +00:00
|
|
|
struct bContext;
|
|
|
|
struct wmOperator;
|
2011-06-27 07:30:58 +00:00
|
|
|
|
2011-05-24 07:08:58 +00:00
|
|
|
/* Actual surface point */
|
2011-06-16 10:41:00 +00:00
|
|
|
typedef struct PaintSurfaceData {
|
2011-08-21 19:03:47 +00:00
|
|
|
void *format_data; /* special data for each surface "format" */
|
|
|
|
void *type_data; /* data used by specific surface type */
|
|
|
|
struct PaintAdjData *adj_data; /* adjacency data for current surface */
|
|
|
|
|
|
|
|
struct PaintBakeData *bData; /* temporary per step data used for frame calculation */
|
2011-11-10 13:00:27 +00:00
|
|
|
int total_points;
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2011-06-16 10:41:00 +00:00
|
|
|
} PaintSurfaceData;
|
|
|
|
|
|
|
|
/* Paint type surface point */
|
|
|
|
typedef struct PaintPoint {
|
2011-05-24 07:08:58 +00:00
|
|
|
|
|
|
|
/* Wet paint is handled at effect layer only
|
|
|
|
* and mixed to surface when drying */
|
|
|
|
float e_color[3];
|
|
|
|
float e_alpha;
|
|
|
|
float wetness;
|
2011-10-28 14:46:09 +00:00
|
|
|
short state;
|
2011-06-16 10:41:00 +00:00
|
|
|
float color[3];
|
|
|
|
float alpha;
|
|
|
|
} PaintPoint;
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2011-07-02 18:06:39 +00:00
|
|
|
/* heigh field waves */
|
|
|
|
typedef struct PaintWavePoint {
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2011-07-02 18:06:39 +00:00
|
|
|
float height;
|
|
|
|
float velocity;
|
2011-10-28 14:46:09 +00:00
|
|
|
short state;
|
2011-07-02 18:06:39 +00:00
|
|
|
} PaintWavePoint;
|
2011-05-24 07:08:58 +00:00
|
|
|
|
2011-06-16 10:41:00 +00:00
|
|
|
struct DerivedMesh *dynamicPaint_Modifier_do(struct DynamicPaintModifierData *pmd, struct Scene *scene, struct Object *ob, struct DerivedMesh *dm);
|
2011-05-24 07:08:58 +00:00
|
|
|
void dynamicPaint_Modifier_free (struct DynamicPaintModifierData *pmd);
|
|
|
|
void dynamicPaint_Modifier_copy(struct DynamicPaintModifierData *pmd, struct DynamicPaintModifierData *tsmd);
|
|
|
|
|
2011-09-05 16:04:15 +00:00
|
|
|
int dynamicPaint_createType(struct DynamicPaintModifierData *pmd, int type, struct Scene *scene);
|
|
|
|
struct DynamicPaintSurface *dynamicPaint_createNewSurface(struct DynamicPaintCanvasSettings *canvas, struct Scene *scene);
|
|
|
|
void dynamicPaint_clearSurface(struct DynamicPaintSurface *surface);
|
2011-07-02 18:06:39 +00:00
|
|
|
int dynamicPaint_resetSurface(struct DynamicPaintSurface *surface);
|
2011-09-05 16:04:15 +00:00
|
|
|
void dynamicPaint_freeSurface(struct DynamicPaintSurface *surface);
|
|
|
|
void dynamicPaint_freeCanvas(struct DynamicPaintModifierData *pmd);
|
|
|
|
void dynamicPaint_freeBrush(struct DynamicPaintModifierData *pmd);
|
2011-10-13 20:00:22 +00:00
|
|
|
void dynamicPaint_freeSurfaceData(struct DynamicPaintSurface *surface);
|
2011-09-05 16:04:15 +00:00
|
|
|
|
|
|
|
void dynamicPaint_cacheUpdateFrames(struct DynamicPaintSurface *surface);
|
|
|
|
int dynamicPaint_surfaceHasColorPreview(struct DynamicPaintSurface *surface);
|
2011-11-14 06:46:07 +00:00
|
|
|
int dynamicPaint_outputLayerExists(struct DynamicPaintSurface *surface, struct Object *ob, int output);
|
2011-07-02 18:06:39 +00:00
|
|
|
void dynamicPaintSurface_updateType(struct DynamicPaintSurface *surface);
|
2011-11-10 12:28:26 +00:00
|
|
|
void dynamicPaintSurface_setUniqueName(struct DynamicPaintSurface *surface, const char *basename);
|
2011-09-05 16:04:15 +00:00
|
|
|
void dynamicPaint_resetPreview(struct DynamicPaintCanvasSettings *canvas);
|
|
|
|
struct DynamicPaintSurface *get_activeSurface(struct DynamicPaintCanvasSettings *canvas);
|
|
|
|
|
2011-10-13 20:00:22 +00:00
|
|
|
/* image sequence baking */
|
|
|
|
int dynamicPaint_createUVSurface(struct DynamicPaintSurface *surface);
|
|
|
|
int dynamicPaint_calculateFrame(struct DynamicPaintSurface *surface, struct Scene *scene, struct Object *cObject, int frame);
|
2011-10-28 14:46:09 +00:00
|
|
|
void dynamicPaint_outputSurfaceImage(struct DynamicPaintSurface *surface, char* filename, short output_layer);
|
|
|
|
|
|
|
|
/* PaintPoint state */
|
|
|
|
#define DPAINT_PAINT_NONE -1
|
|
|
|
#define DPAINT_PAINT_DRY 0
|
|
|
|
#define DPAINT_PAINT_WET 1
|
|
|
|
#define DPAINT_PAINT_NEW 2
|
|
|
|
|
|
|
|
/* PaintWavePoint state */
|
|
|
|
#define DPAINT_WAVE_NONE 0
|
|
|
|
#define DPAINT_WAVE_OBSTACLE 1
|
|
|
|
#define DPAINT_WAVE_REFLECT_ONLY 2
|
2011-07-02 18:06:39 +00:00
|
|
|
|
2011-05-24 07:08:58 +00:00
|
|
|
#endif /* BKE_DYNAMIC_PAINT_H_ */
|