Blender  V3.3
Classes | Macros | Typedefs | Functions | Variables
dynamicpaint.c File Reference
#include "MEM_guardedalloc.h"
#include <math.h>
#include <stdio.h>
#include "BLI_blenlib.h"
#include "BLI_kdtree.h"
#include "BLI_math.h"
#include "BLI_string_utils.h"
#include "BLI_task.h"
#include "BLI_threads.h"
#include "BLI_utildefines.h"
#include "BLT_translation.h"
#include "DNA_anim_types.h"
#include "DNA_armature_types.h"
#include "DNA_collection_types.h"
#include "DNA_constraint_types.h"
#include "DNA_dynamicpaint_types.h"
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_modifier_types.h"
#include "DNA_object_force_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_texture_types.h"
#include "BKE_armature.h"
#include "BKE_bvhutils.h"
#include "BKE_collection.h"
#include "BKE_collision.h"
#include "BKE_colorband.h"
#include "BKE_constraint.h"
#include "BKE_customdata.h"
#include "BKE_deform.h"
#include "BKE_dynamicpaint.h"
#include "BKE_effect.h"
#include "BKE_image.h"
#include "BKE_image_format.h"
#include "BKE_lib_id.h"
#include "BKE_main.h"
#include "BKE_material.h"
#include "BKE_mesh.h"
#include "BKE_mesh_mapping.h"
#include "BKE_mesh_runtime.h"
#include "BKE_modifier.h"
#include "BKE_object.h"
#include "BKE_particle.h"
#include "BKE_pointcache.h"
#include "BKE_scene.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_query.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "RE_texture.h"
#include "atomic_ops.h"
#include "CLG_log.h"

Go to the source code of this file.

Classes

struct  Bounds2D
 
struct  Bounds3D
 
struct  VolumeGrid
 
struct  Vec3f
 
struct  BakeAdjPoint
 
struct  PaintBakeNormal
 
struct  PaintBakeData
 
struct  PaintUVPoint
 
struct  ImgSeqFormatData
 
struct  PaintAdjData
 
struct  DynamicPaintSetInitColorData
 
struct  DynamicPaintModifierApplyData
 
struct  DynamicPaintCreateUVSurfaceData
 
struct  DynamicPaintFindIslandBorderData
 
struct  DynamicPaintOutputSurfaceImageData
 
struct  DynamicPaintBrushVelocityData
 
struct  DynamicPaintPaintData
 
struct  DynamicPaintEffectData
 
struct  DynamicPaintDissolveDryData
 
struct  DynamicPaintGenerateBakeData
 

Macros

#define SUBFRAME_RECURSION   5
 
#define BRUSH_USES_VELOCITY   (1 << 0)
 
#define HIT_VOLUME   1
 
#define HIT_PROXIMITY   2
 
#define NOT_FOUND   -1
 
#define ON_MESH_EDGE   -2
 
#define OUT_OF_TEXTURE   -3
 
#define EFF_MOVEMENT_PER_FRAME   0.05f
 
#define WAVE_TIME_FAC   (1.0f / 24.0f)
 
#define CANVAS_REL_SIZE   5.0f
 
#define MIN_WETNESS   0.001f
 
#define MAX_WETNESS   5.0f
 
#define ADJ_ON_MESH_EDGE   (1 << 0)
 
#define ADJ_BORDER_PIXEL   (1 << 1)
 

Typedefs

typedef struct Bounds2D Bounds2D
 
typedef struct Bounds3D Bounds3D
 
typedef struct VolumeGrid VolumeGrid
 
typedef struct Vec3f Vec3f
 
typedef struct BakeAdjPoint BakeAdjPoint
 
typedef struct PaintBakeNormal PaintBakeNormal
 
typedef struct PaintBakeData PaintBakeData
 
typedef struct PaintUVPoint PaintUVPoint
 
typedef struct ImgSeqFormatData ImgSeqFormatData
 
typedef struct PaintAdjData PaintAdjData
 
typedef struct DynamicPaintSetInitColorData DynamicPaintSetInitColorData
 
typedef struct DynamicPaintModifierApplyData DynamicPaintModifierApplyData
 
typedef struct DynamicPaintBrushVelocityData DynamicPaintBrushVelocityData
 
typedef struct DynamicPaintPaintData DynamicPaintPaintData
 
typedef struct DynamicPaintEffectData DynamicPaintEffectData
 
typedef struct DynamicPaintDissolveDryData DynamicPaintDissolveDryData
 
typedef struct DynamicPaintGenerateBakeData DynamicPaintGenerateBakeData
 

Functions

BLI_INLINE void value_dissolve (float *r_value, const float time, const float scale, const bool is_log)
 
void dynamicPaint_Modifier_free_runtime (DynamicPaintRuntime *runtime_data)
 
static DynamicPaintRuntimedynamicPaint_Modifier_runtime_ensure (DynamicPaintModifierData *pmd)
 
static MeshdynamicPaint_canvas_mesh_get (DynamicPaintCanvasSettings *canvas)
 
static MeshdynamicPaint_brush_mesh_get (DynamicPaintBrushSettings *brush)
 
static bool setError (DynamicPaintCanvasSettings *canvas, const char *string)
 
static int dynamicPaint_surfaceNumOfPoints (DynamicPaintSurface *surface)
 
DynamicPaintSurfaceget_activeSurface (DynamicPaintCanvasSettings *canvas)
 
bool dynamicPaint_outputLayerExists (struct DynamicPaintSurface *surface, Object *ob, int output)
 
static bool surface_duplicateOutputExists (void *arg, const char *name)
 
static void surface_setUniqueOutputName (DynamicPaintSurface *surface, char *basename, int output)
 
static bool surface_duplicateNameExists (void *arg, const char *name)
 
void dynamicPaintSurface_setUniqueName (DynamicPaintSurface *surface, const char *basename)
 
void dynamicPaintSurface_updateType (struct DynamicPaintSurface *surface)
 
static int surface_totalSamples (DynamicPaintSurface *surface)
 
static void blendColors (const float t_color[3], const float t_alpha, const float s_color[3], const float s_alpha, float result[4])
 
static float mixColors (float a_color[3], float a_weight, const float b_color[3], float b_weight, float ratio)
 
static void scene_setSubframe (Scene *scene, float subframe)
 
static int surface_getBrushFlags (DynamicPaintSurface *surface, Depsgraph *depsgraph)
 
static bool boundsIntersect (Bounds3D *b1, Bounds3D *b2)
 
static bool boundsIntersectDist (Bounds3D *b1, Bounds3D *b2, const float dist)
 
static bool boundIntersectPoint (Bounds3D *b, const float point[3], const float radius)
 
static void boundInsert (Bounds3D *b, const float point[3])
 
static float getSurfaceDimension (PaintSurfaceData *sData)
 
static void freeGrid (PaintSurfaceData *data)
 
static void grid_bound_insert_cb_ex (void *__restrict userdata, const int i, const TaskParallelTLS *__restrict tls)
 
static void grid_bound_insert_reduce (const void *__restrict UNUSED(userdata), void *__restrict chunk_join, void *__restrict chunk)
 
static void grid_cell_points_cb_ex (void *__restrict userdata, const int i, const TaskParallelTLS *__restrict tls)
 
static void grid_cell_points_reduce (const void *__restrict userdata, void *__restrict chunk_join, void *__restrict chunk)
 
static void grid_cell_bounds_cb (void *__restrict userdata, const int x, const TaskParallelTLS *__restrict UNUSED(tls))
 
static void surfaceGenerateGrid (struct DynamicPaintSurface *surface)
 
void dynamicPaint_freeBrush (struct DynamicPaintModifierData *pmd)
 
static void dynamicPaint_freeAdjData (PaintSurfaceData *data)
 
static void free_bakeData (PaintSurfaceData *data)
 
static void surface_freeUnusedData (DynamicPaintSurface *surface)
 
void dynamicPaint_freeSurfaceData (DynamicPaintSurface *surface)
 
void dynamicPaint_freeSurface (const DynamicPaintModifierData *pmd, DynamicPaintSurface *surface)
 
void dynamicPaint_freeCanvas (DynamicPaintModifierData *pmd)
 
void dynamicPaint_Modifier_free (DynamicPaintModifierData *pmd)
 
DynamicPaintSurfacedynamicPaint_createNewSurface (DynamicPaintCanvasSettings *canvas, Scene *scene)
 
bool dynamicPaint_createType (struct DynamicPaintModifierData *pmd, int type, struct Scene *scene)
 
void dynamicPaint_Modifier_copy (const struct DynamicPaintModifierData *pmd, struct DynamicPaintModifierData *tpmd, int flag)
 
static void dynamicPaint_allocateSurfaceType (DynamicPaintSurface *surface)
 
static bool surface_usesAdjDistance (DynamicPaintSurface *surface)
 
static bool surface_usesAdjData (DynamicPaintSurface *surface)
 
static void dynamicPaint_initAdjacencyData (DynamicPaintSurface *surface, const bool force_init)
 
static void dynamic_paint_set_init_color_tex_to_vcol_cb (void *__restrict userdata, const int i, const TaskParallelTLS *__restrict UNUSED(tls))
 
static void dynamic_paint_set_init_color_tex_to_imseq_cb (void *__restrict userdata, const int i, const TaskParallelTLS *__restrict UNUSED(tls))
 
static void dynamic_paint_set_init_color_vcol_to_imseq_cb (void *__restrict userdata, const int i, const TaskParallelTLS *__restrict UNUSED(tls))
 
static void dynamicPaint_setInitialColor (const Scene *scene, DynamicPaintSurface *surface)
 
void dynamicPaint_clearSurface (const Scene *scene, DynamicPaintSurface *surface)
 
bool dynamicPaint_resetSurface (const Scene *scene, DynamicPaintSurface *surface)
 
static bool dynamicPaint_checkSurfaceData (const Scene *scene, DynamicPaintSurface *surface)
 
static void dynamic_paint_apply_surface_displace_cb (void *__restrict userdata, const int i, const TaskParallelTLS *__restrict UNUSED(tls))
 
static void dynamicPaint_applySurfaceDisplace (DynamicPaintSurface *surface, Mesh *result)
 
static void dynamic_paint_apply_surface_vpaint_blend_cb (void *__restrict userdata, const int i, const TaskParallelTLS *__restrict UNUSED(tls))
 
static void dynamic_paint_apply_surface_vpaint_cb (void *__restrict userdata, const int p_index, const TaskParallelTLS *__restrict UNUSED(tls))
 
static void dynamic_paint_apply_surface_wave_cb (void *__restrict userdata, const int i, const TaskParallelTLS *__restrict UNUSED(tls))
 
static MeshdynamicPaint_Modifier_apply (DynamicPaintModifierData *pmd, Object *ob, Mesh *mesh)
 
void dynamicPaint_cacheUpdateFrames (DynamicPaintSurface *surface)
 
static void canvas_copyMesh (DynamicPaintCanvasSettings *canvas, Mesh *mesh)
 
static void dynamicPaint_frameUpdate (DynamicPaintModifierData *pmd, struct Depsgraph *depsgraph, Scene *scene, Object *ob, Mesh *mesh)
 
MeshdynamicPaint_Modifier_do (DynamicPaintModifierData *pmd, struct Depsgraph *depsgraph, Scene *scene, Object *ob, Mesh *mesh)
 
static void mesh_tris_spherecast_dp (void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit)
 
static void mesh_tris_nearest_point_dp (void *userdata, int index, const float co[3], BVHTreeNearest *nearest)
 
static void dynamicPaint_mixPaintColors (const DynamicPaintSurface *surface, const int index, const int paintFlags, const float paintColor[3], const float paintAlpha, const float paintWetness, const float timescale)
 
static void dynamicPaint_mixWaveHeight (PaintWavePoint *wPoint, const DynamicPaintBrushSettings *brush, float isect_height)
 
static void dynamicPaint_updatePointData (const DynamicPaintSurface *surface, const int index, const DynamicPaintBrushSettings *brush, float paint[3], float influence, float depth, float vel_factor, const float timescale)
 
static bool meshBrush_boundsIntersect (Bounds3D *b1, Bounds3D *b2, DynamicPaintBrushSettings *brush, float brush_radius)
 
static void dynamic_paint_brush_velocity_compute_cb (void *__restrict userdata, const int i, const TaskParallelTLS *__restrict UNUSED(tls))
 
static void dynamicPaint_brushMeshCalculateVelocity (Depsgraph *depsgraph, Scene *scene, Object *ob, DynamicPaintBrushSettings *brush, Vec3f **brushVel, float timescale)
 
static void dynamicPaint_brushObjectCalculateVelocity (Depsgraph *depsgraph, Scene *scene, Object *ob, Vec3f *brushVel, float timescale)
 
static void dynamic_paint_paint_mesh_cell_point_cb_ex (void *__restrict userdata, const int id, const TaskParallelTLS *__restrict UNUSED(tls))
 
static bool dynamicPaint_paintMesh (Depsgraph *depsgraph, DynamicPaintSurface *surface, DynamicPaintBrushSettings *brush, Object *brushOb, Scene *scene, float timescale)
 
static void dynamic_paint_paint_particle_cell_point_cb_ex (void *__restrict userdata, const int id, const TaskParallelTLS *__restrict UNUSED(tls))
 
static bool dynamicPaint_paintParticles (DynamicPaintSurface *surface, ParticleSystem *psys, DynamicPaintBrushSettings *brush, float timescale)
 
static void dynamic_paint_paint_single_point_cb_ex (void *__restrict userdata, const int index, const TaskParallelTLS *__restrict UNUSED(tls))
 
static bool dynamicPaint_paintSinglePoint (Depsgraph *depsgraph, DynamicPaintSurface *surface, float *pointCoord, DynamicPaintBrushSettings *brush, Object *brushOb, Scene *scene, float timescale)
 
static void dynamic_paint_prepare_adjacency_cb (void *__restrict userdata, const int index, const TaskParallelTLS *__restrict UNUSED(tls))
 
static void dynamicPaint_prepareAdjacencyData (DynamicPaintSurface *surface, const bool force_init)
 
static void surface_determineForceTargetPoints (const PaintSurfaceData *sData, const int index, const float force[3], float closest_d[2], int closest_id[2])
 
static void dynamicPaint_doSmudge (DynamicPaintSurface *surface, DynamicPaintBrushSettings *brush, float timescale)
 
static void dynamic_paint_prepare_effect_cb (void *__restrict userdata, const int index, const TaskParallelTLS *__restrict UNUSED(tls))
 
static int dynamicPaint_prepareEffectStep (struct Depsgraph *depsgraph, DynamicPaintSurface *surface, Scene *scene, Object *ob, float **force, float timescale)
 
static void dynamic_paint_effect_spread_cb (void *__restrict userdata, const int index, const TaskParallelTLS *__restrict UNUSED(tls))
 
static void dynamic_paint_effect_shrink_cb (void *__restrict userdata, const int index, const TaskParallelTLS *__restrict UNUSED(tls))
 
static void dynamic_paint_effect_drip_cb (void *__restrict userdata, const int index, const TaskParallelTLS *__restrict UNUSED(tls))
 
static void dynamicPaint_doEffectStep (DynamicPaintSurface *surface, float *force, PaintPoint *prevPoint, float timescale, float steps)
 
static void dynamic_paint_border_cb (void *__restrict userdata, const int b_index, const TaskParallelTLS *__restrict UNUSED(tls))
 
static void dynamicPaint_doBorderStep (DynamicPaintSurface *surface)
 
static void dynamic_paint_wave_step_cb (void *__restrict userdata, const int index, const TaskParallelTLS *__restrict UNUSED(tls))
 
static void dynamicPaint_doWaveStep (DynamicPaintSurface *surface, float timescale)
 
static bool dynamic_paint_surface_needs_dry_dissolve (DynamicPaintSurface *surface)
 
static void dynamic_paint_surface_pre_step_cb (void *__restrict userdata, const int index, const TaskParallelTLS *__restrict UNUSED(tls))
 
static bool dynamicPaint_surfaceHasMoved (DynamicPaintSurface *surface, Object *ob)
 
static void dynamic_paint_generate_bake_data_cb (void *__restrict userdata, const int index, const TaskParallelTLS *__restrict UNUSED(tls))
 
static bool dynamicPaint_generateBakeData (DynamicPaintSurface *surface, Depsgraph *depsgraph, Object *ob)
 
static int dynamicPaint_doStep (Depsgraph *depsgraph, Scene *scene, Object *ob, DynamicPaintSurface *surface, float timescale, float subframe)
 
int dynamicPaint_calculateFrame (DynamicPaintSurface *surface, struct Depsgraph *depsgraph, Scene *scene, Object *cObject, int frame)
 

Variables

static CLG_LogRef LOG = {"bke.dynamicpaint"}
 
static const float gaussianFactors [5]
 
static const float gaussianTotal = 3.309425f
 
static int neighX [8] = {1, 1, 0, -1, -1, -1, 0, 1}
 
static int neighY [8] = {0, 1, 1, 1, 0, -1, -1, -1}
 
static int neighStraightX [8] = {1, 0, -1, 0, 1, -1, -1, 1}
 
static int neighStraightY [8] = {0, 1, 0, -1, 1, 1, -1, -1}
 

Image Sequence / UV Image Surface Calls

#define JITTER_SAMPLES
 
typedef struct DynamicPaintCreateUVSurfaceData DynamicPaintCreateUVSurfaceData
 
typedef struct DynamicPaintFindIslandBorderData DynamicPaintFindIslandBorderData
 
typedef struct DynamicPaintOutputSurfaceImageData DynamicPaintOutputSurfaceImageData
 
static void dynamic_paint_create_uv_surface_direct_cb (void *__restrict userdata, const int ty, const TaskParallelTLS *__restrict UNUSED(tls))
 
static void dynamic_paint_create_uv_surface_neighbor_cb (void *__restrict userdata, const int ty, const TaskParallelTLS *__restrict UNUSED(tls))
 
static float dist_squared_to_looptri_uv_edges (const MLoopTri *mlooptri, const MLoopUV *mloopuv, int tri_index, const float point[2])
 
static void dynamic_paint_find_island_border (const DynamicPaintCreateUVSurfaceData *data, DynamicPaintFindIslandBorderData *bdata, int tri_index, const float pixel[2], int in_edge, int depth)
 
static int dynamic_paint_find_neighbor_pixel (const DynamicPaintCreateUVSurfaceData *data, const MeshElemMap *vert_to_looptri_map, const int w, const int h, const int px, const int py, const int n_index)
 
static bool dynamicPaint_pointHasNeighbor (PaintAdjData *ed, int index, int neighbor)
 
static bool dynamicPaint_symmetrizeAdjData (PaintAdjData *ed, int active_points)
 
int dynamicPaint_createUVSurface (Scene *scene, DynamicPaintSurface *surface, float *progress, short *do_update)
 
static void dynamic_paint_output_surface_image_paint_cb (void *__restrict userdata, const int index, const TaskParallelTLS *__restrict UNUSED(tls))
 
static void dynamic_paint_output_surface_image_displace_cb (void *__restrict userdata, const int index, const TaskParallelTLS *__restrict UNUSED(tls))
 
static void dynamic_paint_output_surface_image_wave_cb (void *__restrict userdata, const int index, const TaskParallelTLS *__restrict UNUSED(tls))
 
static void dynamic_paint_output_surface_image_wetmap_cb (void *__restrict userdata, const int index, const TaskParallelTLS *__restrict UNUSED(tls))
 
void dynamicPaint_outputSurfaceImage (DynamicPaintSurface *surface, const char *filepath, short output_layer)
 

Macro Definition Documentation

◆ ADJ_BORDER_PIXEL

#define ADJ_BORDER_PIXEL   (1 << 1)

Definition at line 231 of file dynamicpaint.c.

◆ ADJ_ON_MESH_EDGE

#define ADJ_ON_MESH_EDGE   (1 << 0)

Definition at line 230 of file dynamicpaint.c.

◆ BRUSH_USES_VELOCITY

#define BRUSH_USES_VELOCITY   (1 << 0)

Definition at line 101 of file dynamicpaint.c.

◆ CANVAS_REL_SIZE

#define CANVAS_REL_SIZE   5.0f

Definition at line 113 of file dynamicpaint.c.

◆ EFF_MOVEMENT_PER_FRAME

#define EFF_MOVEMENT_PER_FRAME   0.05f

Definition at line 110 of file dynamicpaint.c.

◆ HIT_PROXIMITY

#define HIT_PROXIMITY   2

Definition at line 104 of file dynamicpaint.c.

◆ HIT_VOLUME

#define HIT_VOLUME   1

Definition at line 103 of file dynamicpaint.c.

◆ JITTER_SAMPLES

#define JITTER_SAMPLES
Value:
{ \
0.0f, 0.0f, -0.2f, -0.4f, 0.2f, 0.4f, 0.4f, -0.2f, -0.4f, 0.3f, \
}

Definition at line 2178 of file dynamicpaint.c.

◆ MAX_WETNESS

#define MAX_WETNESS   5.0f

Definition at line 116 of file dynamicpaint.c.

◆ MIN_WETNESS

#define MIN_WETNESS   0.001f

Definition at line 115 of file dynamicpaint.c.

◆ NOT_FOUND

#define NOT_FOUND   -1

Definition at line 106 of file dynamicpaint.c.

◆ ON_MESH_EDGE

#define ON_MESH_EDGE   -2

Definition at line 107 of file dynamicpaint.c.

◆ OUT_OF_TEXTURE

#define OUT_OF_TEXTURE   -3

Definition at line 108 of file dynamicpaint.c.

◆ SUBFRAME_RECURSION

#define SUBFRAME_RECURSION   5

Definition at line 99 of file dynamicpaint.c.

◆ WAVE_TIME_FAC

#define WAVE_TIME_FAC   (1.0f / 24.0f)

Definition at line 112 of file dynamicpaint.c.

Typedef Documentation

◆ BakeAdjPoint

typedef struct BakeAdjPoint BakeAdjPoint

◆ Bounds2D

typedef struct Bounds2D Bounds2D

◆ Bounds3D

typedef struct Bounds3D Bounds3D

◆ DynamicPaintBrushVelocityData

◆ DynamicPaintCreateUVSurfaceData

◆ DynamicPaintDissolveDryData

◆ DynamicPaintEffectData

◆ DynamicPaintFindIslandBorderData

◆ DynamicPaintGenerateBakeData

◆ DynamicPaintModifierApplyData

◆ DynamicPaintOutputSurfaceImageData

◆ DynamicPaintPaintData

◆ DynamicPaintSetInitColorData

◆ ImgSeqFormatData

◆ PaintAdjData

typedef struct PaintAdjData PaintAdjData

◆ PaintBakeData

typedef struct PaintBakeData PaintBakeData

Temp surface data used to process a frame

◆ PaintBakeNormal

Surface data used while processing a frame

◆ PaintUVPoint

typedef struct PaintUVPoint PaintUVPoint

UV Image sequence format point

◆ Vec3f

typedef struct Vec3f Vec3f

◆ VolumeGrid

typedef struct VolumeGrid VolumeGrid

Function Documentation

◆ blendColors()

static void blendColors ( const float  t_color[3],
const float  t_alpha,
const float  s_color[3],
const float  s_alpha,
float  result[4] 
)
static

◆ boundInsert()

static void boundInsert ( Bounds3D b,
const float  point[3] 
)
static

◆ boundIntersectPoint()

static bool boundIntersectPoint ( Bounds3D b,
const float  point[3],
const float  radius 
)
static

Definition at line 574 of file dynamicpaint.c.

References usdtokens::b(), and point.

Referenced by dynamicPaint_paintParticles().

◆ boundsIntersect()

static bool boundsIntersect ( Bounds3D b1,
Bounds3D b2 
)
static

Definition at line 546 of file dynamicpaint.c.

References Bounds3D::max, Bounds3D::min, and Bounds3D::valid.

Referenced by meshBrush_boundsIntersect().

◆ boundsIntersectDist()

static bool boundsIntersectDist ( Bounds3D b1,
Bounds3D b2,
const float  dist 
)
static

◆ canvas_copyMesh()

static void canvas_copyMesh ( DynamicPaintCanvasSettings canvas,
Mesh mesh 
)
static

◆ dist_squared_to_looptri_uv_edges()

static float dist_squared_to_looptri_uv_edges ( const MLoopTri mlooptri,
const MLoopUV mloopuv,
int  tri_index,
const float  point[2] 
)
static

Definition at line 2389 of file dynamicpaint.c.

References BLI_assert, dist_squared_to_line_segment_v2(), and point.

Referenced by dynamic_paint_find_island_border().

◆ dynamic_paint_apply_surface_displace_cb()

static void dynamic_paint_apply_surface_displace_cb ( void *__restrict  userdata,
const int  i,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

Definition at line 1787 of file dynamicpaint.c.

References data, madd_v3_v3fl(), and surface.

Referenced by dynamicPaint_applySurfaceDisplace().

◆ dynamic_paint_apply_surface_vpaint_blend_cb()

static void dynamic_paint_apply_surface_vpaint_blend_cb ( void *__restrict  userdata,
const int  i,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

Definition at line 1829 of file dynamicpaint.c.

References blendColors(), color, and data.

Referenced by dynamicPaint_Modifier_apply().

◆ dynamic_paint_apply_surface_vpaint_cb()

static void dynamic_paint_apply_surface_vpaint_cb ( void *__restrict  userdata,
const int  p_index,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

◆ dynamic_paint_apply_surface_wave_cb()

static void dynamic_paint_apply_surface_wave_cb ( void *__restrict  userdata,
const int  i,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

Definition at line 1878 of file dynamicpaint.c.

References data, PaintWavePoint::height, and madd_v3_v3fl().

Referenced by dynamicPaint_Modifier_apply().

◆ dynamic_paint_border_cb()

static void dynamic_paint_border_cb ( void *__restrict  userdata,
const int  b_index,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

◆ dynamic_paint_brush_velocity_compute_cb()

static void dynamic_paint_brush_velocity_compute_cb ( void *__restrict  userdata,
const int  i,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

◆ dynamic_paint_create_uv_surface_direct_cb()

static void dynamic_paint_create_uv_surface_direct_cb ( void *__restrict  userdata,
const int  ty,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

◆ dynamic_paint_create_uv_surface_neighbor_cb()

static void dynamic_paint_create_uv_surface_neighbor_cb ( void *__restrict  userdata,
const int  ty,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

◆ dynamic_paint_effect_drip_cb()

static void dynamic_paint_effect_drip_cb ( void *__restrict  userdata,
const int  index,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

◆ dynamic_paint_effect_shrink_cb()

static void dynamic_paint_effect_shrink_cb ( void *__restrict  userdata,
const int  index,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

◆ dynamic_paint_effect_spread_cb()

static void dynamic_paint_effect_spread_cb ( void *__restrict  userdata,
const int  index,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

◆ dynamic_paint_find_island_border()

static void dynamic_paint_find_island_border ( const DynamicPaintCreateUVSurfaceData data,
DynamicPaintFindIslandBorderData bdata,
int  tri_index,
const float  pixel[2],
int  in_edge,
int  depth 
)
static

◆ dynamic_paint_find_neighbor_pixel()

static int dynamic_paint_find_neighbor_pixel ( const DynamicPaintCreateUVSurfaceData data,
const MeshElemMap vert_to_looptri_map,
const int  w,
const int  h,
const int  px,
const int  py,
const int  n_index 
)
static

◆ dynamic_paint_generate_bake_data_cb()

static void dynamic_paint_generate_bake_data_cb ( void *__restrict  userdata,
const int  index,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

◆ dynamic_paint_output_surface_image_displace_cb()

static void dynamic_paint_output_surface_image_displace_cb ( void *__restrict  userdata,
const int  index,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

◆ dynamic_paint_output_surface_image_paint_cb()

static void dynamic_paint_output_surface_image_paint_cb ( void *__restrict  userdata,
const int  index,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

◆ dynamic_paint_output_surface_image_wave_cb()

static void dynamic_paint_output_surface_image_wave_cb ( void *__restrict  userdata,
const int  index,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

◆ dynamic_paint_output_surface_image_wetmap_cb()

static void dynamic_paint_output_surface_image_wetmap_cb ( void *__restrict  userdata,
const int  index,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

Definition at line 3254 of file dynamicpaint.c.

References copy_v3_fl(), data, point, pos, ImBuf::rect_float, and surface.

Referenced by dynamicPaint_outputSurfaceImage().

◆ dynamic_paint_paint_mesh_cell_point_cb_ex()

static void dynamic_paint_paint_mesh_cell_point_cb_ex ( void *__restrict  userdata,
const int  id,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

Definition at line 3908 of file dynamicpaint.c.

References add_v3_fl(), DynamicPaintBrushSettings::b, PaintSurfaceData::bData, BKE_colorband_evaluate(), BLI_bvhtree_find_nearest(), BLI_bvhtree_ray_cast(), PaintBakeData::bNormal, PaintBakeData::brush_velocity, BVH_RAYCAST_DIST_MAX, CLAMP, BVHTreeNearest::co, MVert::co, DynamicPaintBrushSettings::collision, copy_v3_v3(), data, BVHTreeRayHit::dist, BVHTreeNearest::dist_sq, blender::math::dot(), dot_v3v3(), dynamicPaint_updatePointData(), ELEM, DynamicPaintBrushSettings::flags, float(), DynamicPaintBrushSettings::g, gaussianFactors, gaussianTotal, PaintBakeData::grid, HIT_PROXIMITY, HIT_VOLUME, id, BVHTreeNearest::index, BVHTreeRayHit::index, interp_v3_v3v3v3(), interp_weights_tri_v3(), PaintBakeNormal::invNorm, madd_v3_v3v3fl(), mesh_tris_nearest_point_dp(), mesh_tris_spherecast_dp(), MOD_DPAINT_COL_DIST, MOD_DPAINT_COL_VOLDIST, MOD_DPAINT_COL_VOLUME, MOD_DPAINT_DO_SMUDGE, MOD_DPAINT_INVERSE_PROX, MOD_DPAINT_NEGATE_VOLUME, MOD_DPAINT_PRFALL_CONSTANT, MOD_DPAINT_PRFALL_RAMP, MOD_DPAINT_PROX_PROJECT, MOD_DPAINT_RAMP_ALPHA, MOD_DPAINT_RAY_BRUSH_AVG, MOD_DPAINT_RAY_CANVAS, MOD_DPAINT_SURFACE_F_IMAGESEQ, MOD_DPAINT_SURFACE_T_DISPLACE, MOD_DPAINT_SURFACE_T_PAINT, MOD_DPAINT_SURFACE_T_WAVE, MOD_DPAINT_USES_VELOCITY, negate_v3(), BVHTreeRayHit::no, PaintBakeNormal::normal_scale, normal_tri_v3(), normalize_v3(), DynamicPaintBrushSettings::paint_ramp, DynamicPaintBrushSettings::proximity_falloff, DynamicPaintBrushSettings::r, DynamicPaintBrushSettings::ray_dir, PaintBakeData::realCoord, PaintBakeData::s_num, VolumeGrid::s_pos, PaintBakeData::s_pos, sqrtf, sub_v3_v3v3(), surface, VolumeGrid::t_index, BVHTreeFromMesh::tree, MLoopTri::tri, Vec3f::v, v, MLoop::v, v1, v2, and PaintBakeData::velocity.

Referenced by dynamicPaint_paintMesh().

◆ dynamic_paint_paint_particle_cell_point_cb_ex()

static void dynamic_paint_paint_particle_cell_point_cb_ex ( void *__restrict  userdata,
const int  id,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

◆ dynamic_paint_paint_single_point_cb_ex()

static void dynamic_paint_paint_single_point_cb_ex ( void *__restrict  userdata,
const int  index,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

◆ dynamic_paint_prepare_adjacency_cb()

static void dynamic_paint_prepare_adjacency_cb ( void *__restrict  userdata,
const int  index,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

◆ dynamic_paint_prepare_effect_cb()

static void dynamic_paint_prepare_effect_cb ( void *__restrict  userdata,
const int  index,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

◆ dynamic_paint_set_init_color_tex_to_imseq_cb()

static void dynamic_paint_set_init_color_tex_to_imseq_cb ( void *__restrict  userdata,
const int  i,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

◆ dynamic_paint_set_init_color_tex_to_vcol_cb()

static void dynamic_paint_set_init_color_tex_to_vcol_cb ( void *__restrict  userdata,
const int  i,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

◆ dynamic_paint_set_init_color_vcol_to_imseq_cb()

static void dynamic_paint_set_init_color_vcol_to_imseq_cb ( void *__restrict  userdata,
const int  i,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

◆ dynamic_paint_surface_needs_dry_dissolve()

static bool dynamic_paint_surface_needs_dry_dissolve ( DynamicPaintSurface surface)
static

◆ dynamic_paint_surface_pre_step_cb()

static void dynamic_paint_surface_pre_step_cb ( void *__restrict  userdata,
const int  index,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

◆ dynamic_paint_wave_step_cb()

static void dynamic_paint_wave_step_cb ( void *__restrict  userdata,
const int  index,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

◆ dynamicPaint_allocateSurfaceType()

static void dynamicPaint_allocateSurfaceType ( DynamicPaintSurface surface)
static

◆ dynamicPaint_applySurfaceDisplace()

static void dynamicPaint_applySurfaceDisplace ( DynamicPaintSurface surface,
Mesh result 
)
static

◆ dynamicPaint_brush_mesh_get()

static Mesh* dynamicPaint_brush_mesh_get ( DynamicPaintBrushSettings brush)
static

◆ dynamicPaint_brushMeshCalculateVelocity()

static void dynamicPaint_brushMeshCalculateVelocity ( Depsgraph depsgraph,
Scene scene,
Object ob,
DynamicPaintBrushSettings brush,
Vec3f **  brushVel,
float  timescale 
)
static

◆ dynamicPaint_brushObjectCalculateVelocity()

static void dynamicPaint_brushObjectCalculateVelocity ( Depsgraph depsgraph,
Scene scene,
Object ob,
Vec3f brushVel,
float  timescale 
)
static

◆ dynamicPaint_cacheUpdateFrames()

void dynamicPaint_cacheUpdateFrames ( struct DynamicPaintSurface surface)

Update cache frame range.

Definition at line 2051 of file dynamicpaint.c.

References surface.

◆ dynamicPaint_calculateFrame()

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

◆ dynamicPaint_canvas_mesh_get()

static Mesh* dynamicPaint_canvas_mesh_get ( DynamicPaintCanvasSettings canvas)
static

◆ dynamicPaint_checkSurfaceData()

static bool dynamicPaint_checkSurfaceData ( const Scene scene,
DynamicPaintSurface surface 
)
static

◆ dynamicPaint_clearSurface()

void dynamicPaint_clearSurface ( const Scene scene,
DynamicPaintSurface surface 
)

◆ dynamicPaint_createNewSurface()

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

◆ dynamicPaint_createType()

bool dynamicPaint_createType ( struct DynamicPaintModifierData pmd,
int  type,
struct Scene scene 
)

◆ dynamicPaint_createUVSurface()

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

Image sequence baking.

Definition at line 2792 of file dynamicpaint.c.

References ADJ_BORDER_PIXEL, PaintSurfaceData::adj_data, ADJ_ON_MESH_EDGE, ImgSeqFormatData::barycentricWeights, BKE_mesh_runtime_looptri_ensure(), BKE_mesh_runtime_looptri_len(), BKE_mesh_vert_looptri_map_create(), BLI_parallel_range_settings_defaults(), BLI_task_parallel_range(), PaintAdjData::border, CD_MLOOPUV, CLOG_INFO, PaintPoint::color, copy_v2_v2(), CustomData_get_layer_named(), CustomData_has_layer(), CustomData_validate_layer_name(), 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(), PaintAdjData::flags, float(), PaintSurfaceData::format_data, Mesh::ldata, LOG, max, MAX_CUSTOMDATA_LAYER_NAME, MEM_callocN, MEM_freeN, MEM_mallocN, mesh, min, minmax_v2v2_v2(), Mesh::mloop, MOD_DPAINT_ANTIALIAS, MOD_DPAINT_SURFACE_F_IMAGESEQ, Mesh::mvert, N_, PaintAdjData::n_index, PaintAdjData::n_num, PaintAdjData::n_target, PaintUVPoint::neighbor_pixel, next, NULL, ON_MESH_EDGE, OUT_OF_TEXTURE, scene, setError(), surface, PaintAdjData::total_border, PaintSurfaceData::total_points, Mesh::totloop, Mesh::totvert, PaintSurfaceData::type_data, TaskParallelSettings::use_threading, ImgSeqFormatData::uv_p, and w().

Referenced by dynamicPaint_bakeImageSequence().

◆ dynamicPaint_doBorderStep()

static void dynamicPaint_doBorderStep ( DynamicPaintSurface surface)
static

◆ dynamicPaint_doEffectStep()

static void dynamicPaint_doEffectStep ( DynamicPaintSurface surface,
float force,
PaintPoint prevPoint,
float  timescale,
float  steps 
)
static

◆ dynamicPaint_doSmudge()

static void dynamicPaint_doSmudge ( DynamicPaintSurface surface,
DynamicPaintBrushSettings brush,
float  timescale 
)
static

◆ dynamicPaint_doStep()

static int dynamicPaint_doStep ( Depsgraph depsgraph,
Scene scene,
Object ob,
DynamicPaintSurface surface,
float  timescale,
float  subframe 
)
static

Definition at line 6160 of file dynamicpaint.c.

References PaintSurfaceData::adj_data, PaintSurfaceData::bData, BKE_collision_objects_create(), BKE_collision_objects_free(), BKE_modifiers_findby_type(), BKE_object_modifier_update_subframe(), BKE_scene_ctime_get(), BLI_parallel_range_settings_defaults(), BLI_task_parallel_range(), PaintBakeData::bNeighs, DynamicPaintModifierData::brush, PaintBakeData::brush_velocity, RenderData::cfra, DynamicPaintBrushSettings::collision, DAG_EVAL_RENDER, data, DEG_get_mode(), depsgraph, dynamic_paint_surface_needs_dry_dissolve(), dynamic_paint_surface_pre_step_cb(), dynamicPaint_doBorderStep(), dynamicPaint_doEffectStep(), dynamicPaint_doSmudge(), dynamicPaint_doWaveStep(), dynamicPaint_initAdjacencyData(), dynamicPaint_paintMesh(), dynamicPaint_paintParticles(), dynamicPaint_paintSinglePoint(), dynamicPaint_prepareAdjacencyData(), dynamicPaint_prepareEffectStep(), ELEM, eModifierMode_Realtime, eModifierMode_Render, eModifierType_DynamicPaint, DynamicPaintBrushSettings::flags, Object::loc, MEM_callocN, MEM_freeN, MEM_mallocN, MOD_DPAINT_COL_POINT, MOD_DPAINT_DO_SMUDGE, MOD_DPAINT_SURFACE_T_PAINT, MOD_DPAINT_SURFACE_T_WAVE, MOD_DYNAMICPAINT_TYPE_BRUSH, ModifierData::mode, N_, NULL, ParticleSystem::part, PART_EMITTER, PART_FLUID, PART_FLUID_BUBBLE, PART_FLUID_FLIP, PART_FLUID_FOAM, PART_FLUID_FOAMBUBBLE, PART_FLUID_SPRAY, PART_FLUID_SPRAYBUBBLE, PART_FLUID_SPRAYFOAM, PART_FLUID_SPRAYFOAMBUBBLE, PART_FLUID_TRACER, DynamicPaintBrushSettings::psys, psys_check_enabled(), Scene::r, ret, scene, scene_setSubframe(), setError(), steps, RenderData::subframe, SUBFRAME_RECURSION, surface, PaintSurfaceData::total_points, DynamicPaintModifierData::type, ParticleSettings::type, and TaskParallelSettings::use_threading.

Referenced by dynamicPaint_calculateFrame().

◆ dynamicPaint_doWaveStep()

static void dynamicPaint_doWaveStep ( DynamicPaintSurface surface,
float  timescale 
)
static

◆ dynamicPaint_frameUpdate()

static void dynamicPaint_frameUpdate ( DynamicPaintModifierData pmd,
struct Depsgraph depsgraph,
Scene scene,
Object ob,
Mesh mesh 
)
static

◆ dynamicPaint_freeAdjData()

static void dynamicPaint_freeAdjData ( PaintSurfaceData data)
static

Definition at line 858 of file dynamicpaint.c.

References data, MEM_freeN, and NULL.

Referenced by dynamicPaint_freeSurfaceData(), and dynamicPaint_initAdjacencyData().

◆ dynamicPaint_freeBrush()

void dynamicPaint_freeBrush ( struct DynamicPaintModifierData pmd)

◆ dynamicPaint_freeCanvas()

void dynamicPaint_freeCanvas ( struct DynamicPaintModifierData pmd)

◆ dynamicPaint_freeSurface()

void dynamicPaint_freeSurface ( const DynamicPaintModifierData pmd,
DynamicPaintSurface surface 
)

◆ dynamicPaint_freeSurfaceData()

void dynamicPaint_freeSurfaceData ( DynamicPaintSurface surface)

◆ dynamicPaint_generateBakeData()

static bool dynamicPaint_generateBakeData ( DynamicPaintSurface surface,
Depsgraph depsgraph,
Object ob 
)
static

◆ dynamicPaint_initAdjacencyData()

static void dynamicPaint_initAdjacencyData ( DynamicPaintSurface surface,
const bool  force_init 
)
static

◆ dynamicPaint_mixPaintColors()

static void dynamicPaint_mixPaintColors ( const DynamicPaintSurface surface,
const int  index,
const int  paintFlags,
const float  paintColor[3],
const float  paintAlpha,
const float  paintWetness,
const float  timescale 
)
static

Mix color values to canvas point.

Parameters
surfaceCanvas surface
indexSurface point index
paintFlagspaint object flags
paintColor,paintAlpha,paintWetnessTo be mixed paint values
timescaleValue used to adjust time dependent operations when using substeps

Definition at line 3483 of file dynamicpaint.c.

References blendColors(), CLAMP, CLAMP_MAX, CLAMP_MIN, PaintPoint::color, copy_v3_v3(), DPAINT_PAINT_NEW, PaintPoint::e_color, max_ff(), MIN_WETNESS, mix, MOD_DPAINT_ABS_ALPHA, MOD_DPAINT_ERASE, PaintPoint::state, surface, and PaintPoint::wetness.

Referenced by dynamicPaint_updatePointData().

◆ dynamicPaint_mixWaveHeight()

static void dynamicPaint_mixWaveHeight ( PaintWavePoint wPoint,
const DynamicPaintBrushSettings brush,
float  isect_height 
)
static

◆ dynamicPaint_Modifier_apply()

static Mesh* dynamicPaint_Modifier_apply ( DynamicPaintModifierData pmd,
Object ob,
Mesh mesh 
)
static

◆ dynamicPaint_Modifier_copy()

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

Definition at line 1181 of file dynamicpaint.c.

References DynamicPaintCanvasSettings::active_sur, DynamicPaintBrushSettings::alpha, DynamicPaintBrushSettings::b, BKE_ptcache_free_list(), BLI_strncpy(), DynamicPaintModifierData::brush, DynamicPaintSurface::brush_group, DynamicPaintModifierData::canvas, DynamicPaintBrushSettings::collision, DynamicPaintSurface::color_dry_threshold, DynamicPaintSurface::color_spread_speed, copy_v4_v4(), DynamicPaintSurface::depth_clamp, DynamicPaintSurface::disp_factor, DynamicPaintSurface::disp_type, DynamicPaintSurface::diss_speed, DynamicPaintSurface::drip_acc, DynamicPaintSurface::drip_vel, DynamicPaintSurface::dry_speed, dynamicPaint_createNewSurface(), dynamicPaint_createType(), dynamicPaint_freeSurface(), DynamicPaintSurface::effect, DynamicPaintSurface::effect_ui, DynamicPaintSurface::effector_weights, eModifierFlag_SharedCaches, DynamicPaintSurface::end_frame, ListBase::first, ModifierData::flag, DynamicPaintSurface::flags, DynamicPaintBrushSettings::flags, DynamicPaintSurface::format, DynamicPaintBrushSettings::g, DynamicPaintSurface::image_fileformat, DynamicPaintSurface::image_output_path, DynamicPaintSurface::image_resolution, DynamicPaintSurface::influence_scale, DynamicPaintSurface::init_color, DynamicPaintSurface::init_color_type, DynamicPaintSurface::init_layername, DynamicPaintSurface::init_texture, LIB_ID_COPY_SET_COPIED_ON_WRITE, DynamicPaintBrushSettings::max_velocity, MEM_dupallocN, MEM_freeN, MOD_DYNAMICPAINT_TYPE_BRUSH, MOD_DYNAMICPAINT_TYPE_CANVAS, DynamicPaintModifierData::modifier, DynamicPaintSurface::name, NULL, DynamicPaintSurface::output_name, DynamicPaintSurface::output_name2, DynamicPaintBrushSettings::paint_distance, DynamicPaintBrushSettings::paint_ramp, DynamicPaintBrushSettings::particle_radius, DynamicPaintBrushSettings::particle_smooth, DynamicPaintCanvasSettings::pmd, DynamicPaintBrushSettings::pmd, DynamicPaintSurface::pointcache, DynamicPaintBrushSettings::proximity_falloff, DynamicPaintBrushSettings::psys, DynamicPaintSurface::ptcaches, DynamicPaintBrushSettings::r, DynamicPaintSurface::radius_scale, DynamicPaintBrushSettings::ray_dir, DynamicPaintSurface::shrink_speed, DynamicPaintBrushSettings::smudge_strength, DynamicPaintSurface::spread_speed, DynamicPaintSurface::start_frame, DynamicPaintSurface::substeps, surface, DynamicPaintCanvasSettings::surfaces, DynamicPaintSurface::type, DynamicPaintModifierData::type, DynamicPaintSurface::uvlayer_name, DynamicPaintBrushSettings::vel_ramp, DynamicPaintBrushSettings::wave_clamp, DynamicPaintSurface::wave_damping, DynamicPaintBrushSettings::wave_factor, DynamicPaintSurface::wave_smoothness, DynamicPaintSurface::wave_speed, DynamicPaintSurface::wave_spring, DynamicPaintSurface::wave_timescale, DynamicPaintBrushSettings::wave_type, and DynamicPaintBrushSettings::wetness.

Referenced by copyData().

◆ dynamicPaint_Modifier_do()

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

Modifier call. Processes dynamic paint modifier step.

Definition at line 2160 of file dynamicpaint.c.

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

Referenced by modifyMesh().

◆ dynamicPaint_Modifier_free()

void dynamicPaint_Modifier_free ( struct DynamicPaintModifierData pmd)

◆ dynamicPaint_Modifier_free_runtime()

void dynamicPaint_Modifier_free_runtime ( DynamicPaintRuntime runtime_data)

◆ dynamicPaint_Modifier_runtime_ensure()

static DynamicPaintRuntime* dynamicPaint_Modifier_runtime_ensure ( DynamicPaintModifierData pmd)
static

◆ dynamicPaint_outputLayerExists()

bool dynamicPaint_outputLayerExists ( struct DynamicPaintSurface surface,
Object ob,
int  output 
)

◆ dynamicPaint_outputSurfaceImage()

void dynamicPaint_outputSurfaceImage ( DynamicPaintSurface surface,
const char *  filepath,
short  output_layer 
)

◆ dynamicPaint_paintMesh()

static bool dynamicPaint_paintMesh ( Depsgraph depsgraph,
DynamicPaintSurface surface,
DynamicPaintBrushSettings brush,
Object brushOb,
Scene scene,
float  timescale 
)
static

◆ dynamicPaint_paintParticles()

static bool dynamicPaint_paintParticles ( DynamicPaintSurface surface,
ParticleSystem psys,
DynamicPaintBrushSettings brush,
float  timescale 
)
static

◆ dynamicPaint_paintSinglePoint()

static bool dynamicPaint_paintSinglePoint ( Depsgraph depsgraph,
DynamicPaintSurface surface,
float pointCoord,
DynamicPaintBrushSettings brush,
Object brushOb,
Scene scene,
float  timescale 
)
static

◆ dynamicPaint_pointHasNeighbor()

static bool dynamicPaint_pointHasNeighbor ( PaintAdjData ed,
int  index,
int  neighbor 
)
static

◆ dynamicPaint_prepareAdjacencyData()

static void dynamicPaint_prepareAdjacencyData ( DynamicPaintSurface surface,
const bool  force_init 
)
static

◆ dynamicPaint_prepareEffectStep()

static int dynamicPaint_prepareEffectStep ( struct Depsgraph depsgraph,
DynamicPaintSurface surface,
Scene scene,
Object ob,
float **  force,
float  timescale 
)
static

◆ dynamicPaint_resetSurface()

bool dynamicPaint_resetSurface ( const Scene scene,
DynamicPaintSurface surface 
)

◆ dynamicPaint_setInitialColor()

static void dynamicPaint_setInitialColor ( const Scene scene,
DynamicPaintSurface surface 
)
static

◆ dynamicPaint_surfaceHasMoved()

static bool dynamicPaint_surfaceHasMoved ( DynamicPaintSurface surface,
Object ob 
)
static

◆ dynamicPaint_surfaceNumOfPoints()

static int dynamicPaint_surfaceNumOfPoints ( DynamicPaintSurface surface)
static

◆ dynamicPaint_symmetrizeAdjData()

static bool dynamicPaint_symmetrizeAdjData ( PaintAdjData ed,
int  active_points 
)
static

◆ dynamicPaint_updatePointData()

static void dynamicPaint_updatePointData ( const DynamicPaintSurface surface,
const int  index,
const DynamicPaintBrushSettings brush,
float  paint[3],
float  influence,
float  depth,
float  vel_factor,
const float  timescale 
)
static

◆ dynamicPaintSurface_setUniqueName()

void dynamicPaintSurface_setUniqueName ( DynamicPaintSurface surface,
const char *  basename 
)

◆ dynamicPaintSurface_updateType()

void dynamicPaintSurface_updateType ( struct DynamicPaintSurface surface)

◆ free_bakeData()

static void free_bakeData ( PaintSurfaceData data)
static

◆ freeGrid()

static void freeGrid ( PaintSurfaceData data)
static

◆ get_activeSurface()

DynamicPaintSurface* get_activeSurface ( struct DynamicPaintCanvasSettings canvas)

Get currently active surface (in user interface).

Definition at line 317 of file dynamicpaint.c.

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

Referenced by dynamicpaint_bake_exec(), and output_toggle_exec().

◆ getSurfaceDimension()

static float getSurfaceDimension ( PaintSurfaceData sData)
static

◆ grid_bound_insert_cb_ex()

static void grid_bound_insert_cb_ex ( void *__restrict  userdata,
const int  i,
const TaskParallelTLS *__restrict  tls 
)
static

Definition at line 628 of file dynamicpaint.c.

References boundInsert(), PaintBakeData::realCoord, PaintBakeData::s_pos, and Vec3f::v.

Referenced by surfaceGenerateGrid().

◆ grid_bound_insert_reduce()

static void grid_bound_insert_reduce ( const void *__restrict   UNUSEDuserdata,
void *__restrict  chunk_join,
void *__restrict  chunk 
)
static

Definition at line 639 of file dynamicpaint.c.

References boundInsert(), Bounds3D::max, and Bounds3D::min.

Referenced by surfaceGenerateGrid().

◆ grid_cell_bounds_cb()

static void grid_cell_bounds_cb ( void *__restrict  userdata,
const int  x,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

◆ grid_cell_points_cb_ex()

static void grid_cell_points_cb_ex ( void *__restrict  userdata,
const int  i,
const TaskParallelTLS *__restrict  tls 
)
static

◆ grid_cell_points_reduce()

static void grid_cell_points_reduce ( const void *__restrict  userdata,
void *__restrict  chunk_join,
void *__restrict  chunk 
)
static

Definition at line 671 of file dynamicpaint.c.

References VolumeGrid::dim, and PaintBakeData::grid.

Referenced by surfaceGenerateGrid().

◆ mesh_tris_nearest_point_dp()

static void mesh_tris_nearest_point_dp ( void userdata,
int  index,
const float  co[3],
BVHTreeNearest nearest 
)
static

◆ mesh_tris_spherecast_dp()

static void mesh_tris_spherecast_dp ( void userdata,
int  index,
const BVHTreeRay ray,
BVHTreeRayHit hit 
)
static

◆ meshBrush_boundsIntersect()

static bool meshBrush_boundsIntersect ( Bounds3D b1,
Bounds3D b2,
DynamicPaintBrushSettings brush,
float  brush_radius 
)
static

◆ mixColors()

static float mixColors ( float  a_color[3],
float  a_weight,
const float  b_color[3],
float  b_weight,
float  ratio 
)
static

◆ scene_setSubframe()

static void scene_setSubframe ( Scene scene,
float  subframe 
)
static

Definition at line 508 of file dynamicpaint.c.

References RenderData::cfra, Scene::r, scene, and RenderData::subframe.

Referenced by dynamicPaint_doStep().

◆ setError()

static bool setError ( DynamicPaintCanvasSettings canvas,
const char *  string 
)
static

◆ surface_determineForceTargetPoints()

static void surface_determineForceTargetPoints ( const PaintSurfaceData sData,
const int  index,
const float  force[3],
float  closest_d[2],
int  closest_id[2] 
)
static

◆ surface_duplicateNameExists()

static bool surface_duplicateNameExists ( void arg,
const char *  name 
)
static

◆ surface_duplicateOutputExists()

static bool surface_duplicateOutputExists ( void arg,
const char *  name 
)
static

◆ surface_freeUnusedData()

static void surface_freeUnusedData ( DynamicPaintSurface surface)
static

Definition at line 919 of file dynamicpaint.c.

References free_bakeData(), MOD_DPAINT_ACTIVE, PTCACHE_BAKED, and surface.

Referenced by dynamicPaint_frameUpdate().

◆ surface_getBrushFlags()

static int surface_getBrushFlags ( DynamicPaintSurface surface,
Depsgraph depsgraph 
)
static

◆ surface_setUniqueOutputName()

static void surface_setUniqueOutputName ( DynamicPaintSurface surface,
char *  basename,
int  output 
)
static

◆ surface_totalSamples()

static int surface_totalSamples ( DynamicPaintSurface surface)
static

◆ surface_usesAdjData()

static bool surface_usesAdjData ( DynamicPaintSurface surface)
static

◆ surface_usesAdjDistance()

static bool surface_usesAdjDistance ( DynamicPaintSurface surface)
static

◆ surfaceGenerateGrid()

static void surfaceGenerateGrid ( struct DynamicPaintSurface surface)
static

◆ value_dissolve()

BLI_INLINE void value_dissolve ( float r_value,
const float  time,
const float  scale,
const bool  is_log 
)

Definition at line 119 of file dynamicpaint.c.

References MIN_WETNESS, powf, and time.

Referenced by dynamic_paint_surface_pre_step_cb().

Variable Documentation

◆ gaussianFactors

const float gaussianFactors[5]
static
Initial value:
= {
0.996849f,
0.596145f,
0.596145f,
0.596145f,
0.524141f,
}

Definition at line 81 of file dynamicpaint.c.

Referenced by dynamic_paint_paint_mesh_cell_point_cb_ex().

◆ gaussianTotal

const float gaussianTotal = 3.309425f
static

Definition at line 88 of file dynamicpaint.c.

Referenced by dynamic_paint_paint_mesh_cell_point_cb_ex().

◆ LOG

CLG_LogRef LOG = {"bke.dynamicpaint"}
static

◆ neighStraightX

int neighStraightX[8] = {1, 0, -1, 0, 1, -1, -1, 1}
static

Definition at line 95 of file dynamicpaint.c.

Referenced by dynamic_paint_create_uv_surface_neighbor_cb().

◆ neighStraightY

int neighStraightY[8] = {0, 1, 0, -1, 1, 1, -1, -1}
static

Definition at line 96 of file dynamicpaint.c.

Referenced by dynamic_paint_create_uv_surface_neighbor_cb().

◆ neighX

int neighX[8] = {1, 1, 0, -1, -1, -1, 0, 1}
static

Definition at line 91 of file dynamicpaint.c.

Referenced by dynamic_paint_find_neighbor_pixel().

◆ neighY

int neighY[8] = {0, 1, 1, 1, 0, -1, -1, -1}
static

Definition at line 92 of file dynamicpaint.c.

Referenced by dynamic_paint_find_neighbor_pixel().