Blender V2.61 - r43446

BKE_dynamicpaint.h

Go to the documentation of this file.
00001 
00014 #ifndef BKE_DYNAMIC_PAINT_H_
00015 #define BKE_DYNAMIC_PAINT_H_
00016 
00017 struct bContext;
00018 struct wmOperator;
00019 
00020 /* Actual surface point */
00021 typedef struct PaintSurfaceData {
00022     void *format_data; /* special data for each surface "format" */
00023     void *type_data; /* data used by specific surface type */
00024     struct PaintAdjData *adj_data; /* adjacency data for current surface */
00025 
00026     struct PaintBakeData *bData; /* temporary per step data used for frame calculation */
00027     int total_points;
00028 
00029 } PaintSurfaceData;
00030 
00031 /* Paint type surface point */
00032 typedef struct PaintPoint {
00033 
00034     /* Wet paint is handled at effect layer only
00035     *  and mixed to surface when drying */
00036     float e_color[3];
00037     float e_alpha;
00038     float wetness;
00039     short state;
00040     float color[3];
00041     float alpha;
00042 } PaintPoint;
00043 
00044 /* heigh field waves    */
00045 typedef struct PaintWavePoint {     
00046 
00047     float height;
00048     float velocity;
00049     float brush_isect;
00050     short state;
00051 } PaintWavePoint;
00052 
00053 struct DerivedMesh *dynamicPaint_Modifier_do(struct DynamicPaintModifierData *pmd, struct Scene *scene, struct Object *ob, struct DerivedMesh *dm);
00054 void dynamicPaint_Modifier_free (struct DynamicPaintModifierData *pmd);
00055 void dynamicPaint_Modifier_copy(struct DynamicPaintModifierData *pmd, struct DynamicPaintModifierData *tsmd);
00056 
00057 int dynamicPaint_createType(struct DynamicPaintModifierData *pmd, int type, struct Scene *scene);
00058 struct DynamicPaintSurface *dynamicPaint_createNewSurface(struct DynamicPaintCanvasSettings *canvas, struct Scene *scene);
00059 void dynamicPaint_clearSurface(struct DynamicPaintSurface *surface);
00060 int  dynamicPaint_resetSurface(struct DynamicPaintSurface *surface);
00061 void dynamicPaint_freeSurface(struct DynamicPaintSurface *surface);
00062 void dynamicPaint_freeCanvas(struct DynamicPaintModifierData *pmd);
00063 void dynamicPaint_freeBrush(struct DynamicPaintModifierData *pmd);
00064 void dynamicPaint_freeSurfaceData(struct DynamicPaintSurface *surface);
00065 
00066 void dynamicPaint_cacheUpdateFrames(struct DynamicPaintSurface *surface);
00067 int  dynamicPaint_surfaceHasColorPreview(struct DynamicPaintSurface *surface);
00068 int dynamicPaint_outputLayerExists(struct DynamicPaintSurface *surface, struct Object *ob, int output);
00069 void dynamicPaintSurface_updateType(struct DynamicPaintSurface *surface);
00070 void dynamicPaintSurface_setUniqueName(struct DynamicPaintSurface *surface, const char *basename);
00071 void dynamicPaint_resetPreview(struct DynamicPaintCanvasSettings *canvas);
00072 struct DynamicPaintSurface *get_activeSurface(struct DynamicPaintCanvasSettings *canvas);
00073 
00074 /* image sequence baking */
00075 int dynamicPaint_createUVSurface(struct DynamicPaintSurface *surface);
00076 int dynamicPaint_calculateFrame(struct DynamicPaintSurface *surface, struct Scene *scene, struct Object *cObject, int frame);
00077 void dynamicPaint_outputSurfaceImage(struct DynamicPaintSurface *surface, char* filename, short output_layer);
00078 
00079 /* PaintPoint state */
00080 #define DPAINT_PAINT_NONE -1
00081 #define DPAINT_PAINT_DRY 0
00082 #define DPAINT_PAINT_WET 1
00083 #define DPAINT_PAINT_NEW 2
00084 
00085 /* PaintWavePoint state */
00086 #define DPAINT_WAVE_ISECT_CHANGED -1
00087 #define DPAINT_WAVE_NONE 0
00088 #define DPAINT_WAVE_OBSTACLE 1
00089 #define DPAINT_WAVE_REFLECT_ONLY 2
00090 
00091 #endif /* BKE_DYNAMIC_PAINT_H_ */