Blender V5.0
BKE_dynamicpaint.h File Reference

Go to the source code of this file.

Classes

struct  PaintSurfaceData
struct  PaintPoint
struct  PaintWavePoint

Macros

#define DPAINT_PAINT_NONE   -1
#define DPAINT_PAINT_DRY   0
#define DPAINT_PAINT_WET   1
#define DPAINT_PAINT_NEW   2
#define DPAINT_WAVE_ISECT_CHANGED   -1
#define DPAINT_WAVE_NONE   0
#define DPAINT_WAVE_OBSTACLE   1
#define DPAINT_WAVE_REFLECT_ONLY   2

Typedefs

typedef struct PaintSurfaceData PaintSurfaceData
typedef struct PaintPoint PaintPoint
typedef struct PaintWavePoint PaintWavePoint

Functions

struct MeshdynamicPaint_Modifier_do (struct DynamicPaintModifierData *pmd, struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, struct Mesh *mesh)
void dynamicPaint_Modifier_free (struct DynamicPaintModifierData *pmd)
void dynamicPaint_Modifier_free_runtime (struct DynamicPaintRuntime *runtime)
void dynamicPaint_Modifier_copy (const struct DynamicPaintModifierData *pmd, struct DynamicPaintModifierData *tpmd, int flag)
bool dynamicPaint_createType (struct DynamicPaintModifierData *pmd, int type, struct Scene *scene)
struct DynamicPaintSurfacedynamicPaint_createNewSurface (struct DynamicPaintCanvasSettings *canvas, struct Scene *scene)
void dynamicPaint_clearSurface (const struct Scene *scene, struct DynamicPaintSurface *surface)
bool dynamicPaint_resetSurface (const struct Scene *scene, struct DynamicPaintSurface *surface)
void dynamicPaint_freeSurface (const struct DynamicPaintModifierData *pmd, struct DynamicPaintSurface *surface)
void dynamicPaint_freeCanvas (struct DynamicPaintModifierData *pmd)
void dynamicPaint_freeBrush (struct DynamicPaintModifierData *pmd)
void dynamicPaint_freeSurfaceData (struct DynamicPaintSurface *surface)
void dynamicPaint_cacheUpdateFrames (struct DynamicPaintSurface *surface)
bool dynamicPaint_outputLayerExists (struct DynamicPaintSurface *surface, struct Object *ob, int output)
void dynamicPaintSurface_updateType (struct DynamicPaintSurface *surface)
void dynamicPaintSurface_setUniqueName (struct DynamicPaintSurface *surface, const char *basename)
struct DynamicPaintSurfaceget_activeSurface (struct DynamicPaintCanvasSettings *canvas)
int dynamicPaint_createUVSurface (struct Scene *scene, struct DynamicPaintSurface *surface, float *progress, bool *do_update)
int dynamicPaint_calculateFrame (struct DynamicPaintSurface *surface, struct Depsgraph *depsgraph, struct Scene *scene, struct Object *cObject, int frame)
void dynamicPaint_outputSurfaceImage (struct DynamicPaintSurface *surface, const char *filepath, short output_layer)

Macro Definition Documentation

◆ DPAINT_PAINT_DRY

#define DPAINT_PAINT_DRY   0

Definition at line 133 of file BKE_dynamicpaint.h.

Referenced by dynamic_paint_surface_pre_step_cb().

◆ DPAINT_PAINT_NEW

#define DPAINT_PAINT_NEW   2

Definition at line 135 of file BKE_dynamicpaint.h.

Referenced by dynamicPaint_mixPaintColors().

◆ DPAINT_PAINT_NONE

#define DPAINT_PAINT_NONE   -1

Definition at line 132 of file BKE_dynamicpaint.h.

◆ DPAINT_PAINT_WET

#define DPAINT_PAINT_WET   1

Definition at line 134 of file BKE_dynamicpaint.h.

Referenced by dynamic_paint_surface_pre_step_cb().

◆ DPAINT_WAVE_ISECT_CHANGED

#define DPAINT_WAVE_ISECT_CHANGED   -1

Definition at line 138 of file BKE_dynamicpaint.h.

Referenced by dynamicPaint_mixWaveHeight().

◆ DPAINT_WAVE_NONE

#define DPAINT_WAVE_NONE   0

Definition at line 139 of file BKE_dynamicpaint.h.

Referenced by dynamic_paint_wave_step_cb().

◆ DPAINT_WAVE_OBSTACLE

#define DPAINT_WAVE_OBSTACLE   1

Definition at line 140 of file BKE_dynamicpaint.h.

Referenced by dynamicPaint_mixWaveHeight().

◆ DPAINT_WAVE_REFLECT_ONLY

#define DPAINT_WAVE_REFLECT_ONLY   2

Definition at line 141 of file BKE_dynamicpaint.h.

Referenced by dynamicPaint_mixWaveHeight().

Typedef Documentation

◆ PaintPoint

typedef struct PaintPoint PaintPoint

◆ PaintSurfaceData

typedef struct PaintSurfaceData PaintSurfaceData

◆ PaintWavePoint

typedef struct PaintWavePoint PaintWavePoint

Function Documentation

◆ dynamicPaint_cacheUpdateFrames()

void dynamicPaint_cacheUpdateFrames ( struct DynamicPaintSurface * surface)

◆ dynamicPaint_calculateFrame()

int dynamicPaint_calculateFrame ( struct DynamicPaintSurface * surface,
struct Depsgraph * depsgraph,
struct Scene * scene,
struct Object * cObject,
int frame )

◆ dynamicPaint_clearSurface()

void dynamicPaint_clearSurface ( const struct Scene * scene,
struct DynamicPaintSurface * surface )

Clears surface data back to zero.

Referenced by BKE_ptcache_id_reset().

◆ dynamicPaint_createNewSurface()

struct DynamicPaintSurface * dynamicPaint_createNewSurface ( struct DynamicPaintCanvasSettings * canvas,
struct Scene * scene )

Creates a new surface and adds it to the list If scene is null, frame range of 1-250 is used A pointer to this surface is returned.

Definition at line 1044 of file dynamicpaint.cc.

References BKE_effector_add_weights(), BKE_modifier_path_init(), BKE_ptcache_add(), BLI_addtail(), BLT_I18NCONTEXT_ID_BRUSH, DynamicPaintSurface::canvas, DynamicPaintSurface::color_dry_threshold, DynamicPaintSurface::color_spread_speed, CTX_DATA_, DynamicPaintSurface::depth_clamp, DynamicPaintSurface::disp_factor, DynamicPaintSurface::disp_type, DynamicPaintSurface::diss_speed, DynamicPaintSurface::dry_speed, dynamicPaintSurface_setUniqueName(), dynamicPaintSurface_updateType(), DynamicPaintSurface::effect, DynamicPaintSurface::effect_ui, DynamicPaintSurface::effector_weights, RenderData::efra, DynamicPaintSurface::end_frame, PointCache::flag, DynamicPaintSurface::flags, DynamicPaintSurface::format, DynamicPaintSurface::image_fileformat, DynamicPaintSurface::image_output_path, DynamicPaintSurface::image_resolution, DynamicPaintSurface::influence_scale, DynamicPaintSurface::init_color, MEM_callocN(), MOD_DPAINT_ACTIVE, MOD_DPAINT_ANTIALIAS, MOD_DPAINT_DISP_DISPLACE, MOD_DPAINT_DISSOLVE_LOG, MOD_DPAINT_DRY_LOG, MOD_DPAINT_IMGFORMAT_PNG, MOD_DPAINT_MULALPHA, MOD_DPAINT_OUT1, MOD_DPAINT_SURFACE_F_VERTEX, MOD_DPAINT_SURFACE_T_PAINT, MOD_DPAINT_USE_DRYING, DynamicPaintSurface::pointcache, PTCACHE_DISK_CACHE, DynamicPaintSurface::ptcaches, Scene::r, DynamicPaintSurface::radius_scale, RenderData::sfra, DynamicPaintSurface::shrink_speed, DynamicPaintSurface::spread_speed, DynamicPaintSurface::start_frame, PointCache::step, DynamicPaintSurface::substeps, DynamicPaintCanvasSettings::surfaces, DynamicPaintSurface::type, DynamicPaintSurface::wave_damping, DynamicPaintSurface::wave_smoothness, DynamicPaintSurface::wave_speed, DynamicPaintSurface::wave_spring, and DynamicPaintSurface::wave_timescale.

Referenced by dynamicPaint_createType(), dynamicPaint_Modifier_copy(), and surface_slot_add_exec().

◆ dynamicPaint_createType()

◆ dynamicPaint_createUVSurface()

int dynamicPaint_createUVSurface ( struct Scene * scene,
struct DynamicPaintSurface * surface,
float * progress,
bool * do_update )

Image sequence baking.

Definition at line 2828 of file dynamicpaint.cc.

References ADJ_BORDER_PIXEL, PaintSurfaceData::adj_data, ADJ_ON_MESH_EDGE, ImgSeqFormatData::barycentricWeights, BKE_mesh_vert_corner_tri_map_create(), BLI_parallel_range_settings_defaults(), BLI_task_parallel_range(), DynamicPaintSurface::canvas, CD_PROP_FLOAT2, CLOG_DEBUG, PaintPoint::color, copy_v2_v2(), blender::bke::Corner, CustomData_has_layer(), CustomData_validate_layer_name(), blender::Span< T >::data(), data, DynamicPaintSurface::data, dynamic_paint_create_uv_surface_direct_cb(), dynamic_paint_create_uv_surface_neighbor_cb(), dynamic_paint_find_neighbor_pixel(), dynamicPaint_allocateSurfaceType(), dynamicPaint_canvas_mesh_get(), dynamicPaint_freeSurfaceData(), dynamicPaint_initAdjacencyData(), dynamicPaint_pointHasNeighbor(), dynamicPaint_setInitialColor(), dynamicPaint_symmetrizeAdjData(), ELEM, error(), DynamicPaintSurface::flags, float, DynamicPaintSurface::format, PaintSurfaceData::format_data, i, DynamicPaintSurface::image_resolution, blender::Span< T >::index_range(), blender::Span< T >::is_empty(), LOG, blender::bke::AttributeAccessor::lookup(), max, MAX_CUSTOMDATA_LAYER_NAME, MEM_calloc_arrayN(), MEM_callocN(), MEM_freeN(), MEM_malloc_arrayN(), min, minmax_v2v2_v2(), MOD_DPAINT_ANTIALIAS, MOD_DPAINT_SURFACE_F_IMAGESEQ, N_, PaintUVPoint::neighbor_pixel, next, ON_MESH_EDGE, OUT_OF_TEXTURE, setError(), blender::Span< T >::size(), PaintSurfaceData::total_points, PaintUVPoint::tri_index, PaintSurfaceData::type_data, TaskParallelSettings::use_threading, ImgSeqFormatData::uv_p, DynamicPaintSurface::uvlayer_name, and w().

Referenced by dynamicPaint_bakeImageSequence().

◆ dynamicPaint_freeBrush()

◆ dynamicPaint_freeCanvas()

◆ dynamicPaint_freeSurface()

void dynamicPaint_freeSurface ( const struct DynamicPaintModifierData * pmd,
struct DynamicPaintSurface * surface )

References depsgraph, and output.

Referenced by surface_slot_remove_exec().

◆ dynamicPaint_freeSurfaceData()

◆ dynamicPaint_Modifier_copy()

void dynamicPaint_Modifier_copy ( const struct DynamicPaintModifierData * pmd,
struct DynamicPaintModifierData * tpmd,
int flag )

References flag.

Referenced by copy_data().

◆ dynamicPaint_Modifier_do()

struct Mesh * dynamicPaint_Modifier_do ( struct DynamicPaintModifierData * pmd,
struct Depsgraph * depsgraph,
struct Scene * scene,
struct Object * ob,
struct Mesh * mesh )

Modifier call. Processes dynamic paint modifier step.

Definition at line 2189 of file dynamicpaint.cc.

References depsgraph, dynamicPaint_frameUpdate(), and dynamicPaint_Modifier_apply().

Referenced by modify_mesh().

◆ dynamicPaint_Modifier_free()

void dynamicPaint_Modifier_free ( struct DynamicPaintModifierData * pmd)

◆ dynamicPaint_Modifier_free_runtime()

void dynamicPaint_Modifier_free_runtime ( struct DynamicPaintRuntime * runtime)

◆ dynamicPaint_outputLayerExists()

◆ dynamicPaint_outputSurfaceImage()

◆ dynamicPaint_resetSurface()

bool dynamicPaint_resetSurface ( const struct Scene * scene,
struct DynamicPaintSurface * surface )

Completely (re)initializes surface (only for point cache types).

◆ dynamicPaintSurface_setUniqueName()

void dynamicPaintSurface_setUniqueName ( struct DynamicPaintSurface * surface,
const char * basename )

◆ dynamicPaintSurface_updateType()

◆ get_activeSurface()

struct DynamicPaintSurface * get_activeSurface ( struct DynamicPaintCanvasSettings * canvas)

Get currently active surface (in user interface).

Definition at line 331 of file dynamicpaint.cc.

References DynamicPaintCanvasSettings::active_sur, BLI_findlink(), and DynamicPaintCanvasSettings::surfaces.

Referenced by dynamicpaint_bake_exec(), and output_toggle_exec().