Blender V4.3
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
11#include "BLI_utildefines.h"
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17struct Depsgraph;
21struct Object;
22struct Scene;
23
24/* Actual surface point */
25typedef struct PaintSurfaceData {
26 void *format_data; /* special data for each surface "format" */
27 void *type_data; /* data used by specific surface type */
28 struct PaintAdjData *adj_data; /* adjacency data for current surface */
29
30 struct PaintBakeData *bData; /* temporary per step data used for frame calculation */
32
34
35/* Paint type surface point */
36typedef struct PaintPoint {
37
38 /* Wet paint is handled at effect layer only
39 * and mixed to surface when drying */
40 float e_color[4];
41 float wetness;
42 short state;
43 float color[4];
45
46/* height field waves */
47typedef struct PaintWavePoint {
48
49 float height;
50 float velocity;
52 short state;
54
59 struct Depsgraph *depsgraph,
60 struct Scene *scene,
61 struct Object *ob,
62 struct Mesh *mesh);
69 struct DynamicPaintModifierData *tpmd,
70 int flag);
71
75bool dynamicPaint_createType(struct DynamicPaintModifierData *pmd, int type, struct Scene *scene);
82 struct DynamicPaintCanvasSettings *canvas, struct Scene *scene);
86void dynamicPaint_clearSurface(const struct Scene *scene, struct DynamicPaintSurface *surface);
90bool dynamicPaint_resetSurface(const struct Scene *scene, struct DynamicPaintSurface *surface);
92 struct DynamicPaintSurface *surface);
97/* Free brush data */
100
106 struct Object *ob,
107 int output);
112void dynamicPaintSurface_setUniqueName(struct DynamicPaintSurface *surface, const char *basename);
117
121int dynamicPaint_createUVSurface(struct Scene *scene,
122 struct DynamicPaintSurface *surface,
123 float *progress,
124 bool *do_update);
129 struct Depsgraph *depsgraph,
130 struct Scene *scene,
131 struct Object *cObject,
132 int frame);
134 const char *filepath,
135 short output_layer);
136
137/* PaintPoint state */
138#define DPAINT_PAINT_NONE -1
139#define DPAINT_PAINT_DRY 0
140#define DPAINT_PAINT_WET 1
141#define DPAINT_PAINT_NEW 2
142
143/* PaintWavePoint state */
144#define DPAINT_WAVE_ISECT_CHANGED -1
145#define DPAINT_WAVE_NONE 0
146#define DPAINT_WAVE_OBSTACLE 1
147#define DPAINT_WAVE_REFLECT_ONLY 2
148
149#ifdef __cplusplus
150}
151#endif
struct PaintPoint PaintPoint
struct DynamicPaintSurface * get_activeSurface(struct DynamicPaintCanvasSettings *canvas)
struct PaintWavePoint PaintWavePoint
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)
struct PaintSurfaceData PaintSurfaceData
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)
const Depsgraph * depsgraph
struct DynamicPaintCanvasSettings * canvas
MeshRuntimeHandle * runtime
float e_color[4]
struct PaintBakeData * bData
struct PaintAdjData * adj_data
uint8_t flag
Definition wm_window.cc:138