Blender V5.0
BKE_dynamicpaint.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
10
11struct Depsgraph;
15struct Object;
16struct Scene;
17
18/* Actual surface point */
19typedef struct PaintSurfaceData {
20 void *format_data; /* special data for each surface "format" */
21 void *type_data; /* data used by specific surface type */
22 struct PaintAdjData *adj_data; /* adjacency data for current surface */
23
24 struct PaintBakeData *bData; /* temporary per step data used for frame calculation */
26
28
29/* Paint type surface point */
30typedef struct PaintPoint {
31
32 /* Wet paint is handled at effect layer only
33 * and mixed to surface when drying */
34 float e_color[4];
35 float wetness;
36 short state;
37 float color[4];
39
40/* height field waves */
41typedef struct PaintWavePoint {
42
43 float height;
44 float velocity;
46 short state;
48
53 struct Depsgraph *depsgraph,
54 struct Scene *scene,
55 struct Object *ob,
56 struct Mesh *mesh);
63 struct DynamicPaintModifierData *tpmd,
64 int flag);
65
69bool dynamicPaint_createType(struct DynamicPaintModifierData *pmd, int type, struct Scene *scene);
76 struct DynamicPaintCanvasSettings *canvas, struct Scene *scene);
80void dynamicPaint_clearSurface(const struct Scene *scene, struct DynamicPaintSurface *surface);
84bool dynamicPaint_resetSurface(const struct Scene *scene, struct DynamicPaintSurface *surface);
86 struct DynamicPaintSurface *surface);
91/* Free brush data */
94
100 struct Object *ob,
101 int output);
106void dynamicPaintSurface_setUniqueName(struct DynamicPaintSurface *surface, const char *basename);
111
115int dynamicPaint_createUVSurface(struct Scene *scene,
116 struct DynamicPaintSurface *surface,
117 float *progress,
118 bool *do_update);
123 struct Depsgraph *depsgraph,
124 struct Scene *scene,
125 struct Object *cObject,
126 int frame);
128 const char *filepath,
129 short output_layer);
130
131/* PaintPoint state */
132#define DPAINT_PAINT_NONE -1
133#define DPAINT_PAINT_DRY 0
134#define DPAINT_PAINT_WET 1
135#define DPAINT_PAINT_NEW 2
136
137/* PaintWavePoint state */
138#define DPAINT_WAVE_ISECT_CHANGED -1
139#define DPAINT_WAVE_NONE 0
140#define DPAINT_WAVE_OBSTACLE 1
141#define DPAINT_WAVE_REFLECT_ONLY 2
struct DynamicPaintSurface * get_activeSurface(struct DynamicPaintCanvasSettings *canvas)
bool dynamicPaint_outputLayerExists(struct DynamicPaintSurface *surface, struct Object *ob, int output)
void dynamicPaint_outputSurfaceImage(struct DynamicPaintSurface *surface, const char *filepath, short output_layer)
void dynamicPaintSurface_updateType(struct DynamicPaintSurface *surface)
void dynamicPaint_freeCanvas(struct DynamicPaintModifierData *pmd)
void dynamicPaintSurface_setUniqueName(struct DynamicPaintSurface *surface, const char *basename)
bool dynamicPaint_createType(struct DynamicPaintModifierData *pmd, int type, struct Scene *scene)
bool dynamicPaint_resetSurface(const struct Scene *scene, struct DynamicPaintSurface *surface)
struct Mesh * dynamicPaint_Modifier_do(struct DynamicPaintModifierData *pmd, struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, struct Mesh *mesh)
void dynamicPaint_Modifier_free(struct DynamicPaintModifierData *pmd)
int dynamicPaint_createUVSurface(struct Scene *scene, struct DynamicPaintSurface *surface, float *progress, bool *do_update)
void dynamicPaint_freeBrush(struct DynamicPaintModifierData *pmd)
void dynamicPaint_Modifier_free_runtime(struct DynamicPaintRuntime *runtime)
struct DynamicPaintSurface * dynamicPaint_createNewSurface(struct DynamicPaintCanvasSettings *canvas, struct Scene *scene)
void dynamicPaint_clearSurface(const struct Scene *scene, struct DynamicPaintSurface *surface)
int dynamicPaint_calculateFrame(struct DynamicPaintSurface *surface, struct Depsgraph *depsgraph, struct Scene *scene, struct Object *cObject, int frame)
void dynamicPaint_freeSurfaceData(struct DynamicPaintSurface *surface)
void dynamicPaint_Modifier_copy(const struct DynamicPaintModifierData *pmd, struct DynamicPaintModifierData *tpmd, int flag)
void dynamicPaint_freeSurface(const struct DynamicPaintModifierData *pmd, struct DynamicPaintSurface *surface)
void dynamicPaint_cacheUpdateFrames(struct DynamicPaintSurface *surface)
BPy_StructRNA * depsgraph
#define output
struct DynamicPaintCanvasSettings * canvas
MeshRuntimeHandle * runtime
const NodeType * type
Definition graph/node.h:178
float e_color[4]
struct PaintBakeData * bData
struct PaintAdjData * adj_data
uint8_t flag
Definition wm_window.cc:145