|
Blender V5.0
|
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 |
| #define DPAINT_PAINT_DRY 0 |
Definition at line 133 of file BKE_dynamicpaint.h.
Referenced by dynamic_paint_surface_pre_step_cb().
| #define DPAINT_PAINT_NEW 2 |
Definition at line 135 of file BKE_dynamicpaint.h.
Referenced by dynamicPaint_mixPaintColors().
| #define DPAINT_PAINT_NONE -1 |
Definition at line 132 of file BKE_dynamicpaint.h.
| #define DPAINT_PAINT_WET 1 |
Definition at line 134 of file BKE_dynamicpaint.h.
Referenced by dynamic_paint_surface_pre_step_cb().
| #define DPAINT_WAVE_ISECT_CHANGED -1 |
Definition at line 138 of file BKE_dynamicpaint.h.
Referenced by dynamicPaint_mixWaveHeight().
| #define DPAINT_WAVE_NONE 0 |
Definition at line 139 of file BKE_dynamicpaint.h.
Referenced by dynamic_paint_wave_step_cb().
| #define DPAINT_WAVE_OBSTACLE 1 |
Definition at line 140 of file BKE_dynamicpaint.h.
Referenced by dynamicPaint_mixWaveHeight().
| #define DPAINT_WAVE_REFLECT_ONLY 2 |
Definition at line 141 of file BKE_dynamicpaint.h.
Referenced by dynamicPaint_mixWaveHeight().
| typedef struct PaintPoint PaintPoint |
| typedef struct PaintSurfaceData PaintSurfaceData |
| typedef struct PaintWavePoint PaintWavePoint |
| void dynamicPaint_cacheUpdateFrames | ( | struct DynamicPaintSurface * | surface | ) |
Update cache frame range.
Definition at line 2081 of file dynamicpaint.cc.
References DynamicPaintSurface::end_frame, PointCache::endframe, DynamicPaintSurface::pointcache, DynamicPaintSurface::start_frame, and PointCache::startframe.
| int dynamicPaint_calculateFrame | ( | struct DynamicPaintSurface * | surface, |
| struct Depsgraph * | depsgraph, | ||
| struct Scene * | scene, | ||
| struct Object * | cObject, | ||
| int | frame ) |
Calculate a single frame and included sub-frames for surface.
Definition at line 6421 of file dynamicpaint.cc.
References DynamicPaintSurface::canvas, depsgraph, dynamicPaint_applySurfaceDisplace(), dynamicPaint_canvas_mesh_get(), dynamicPaint_doStep(), dynamicPaint_generateBakeData(), DynamicPaintSurface::flags, float, MOD_DPAINT_DISP_INCREMENTAL, DynamicPaintSurface::start_frame, and DynamicPaintSurface::substeps.
Referenced by dynamicPaint_bakeImageSequence(), and dynamicPaint_frameUpdate().
| void dynamicPaint_clearSurface | ( | const struct Scene * | scene, |
| struct DynamicPaintSurface * | surface ) |
Clears surface data back to zero.
Referenced by BKE_ptcache_id_reset().
| 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().
| bool dynamicPaint_createType | ( | struct DynamicPaintModifierData * | pmd, |
| int | type, | ||
| struct Scene * | scene ) |
Initialize modifier data.
Definition at line 1121 of file dynamicpaint.cc.
References CBData::a, CBData::b, BKE_colorband_add(), DynamicPaintModifierData::brush, DynamicPaintModifierData::canvas, dynamicPaint_createNewSurface(), dynamicPaint_freeBrush(), dynamicPaint_freeCanvas(), CBData::g, MEM_callocN(), MOD_DPAINT_ABS_ALPHA, MOD_DPAINT_COL_VOLUME, MOD_DPAINT_PRFALL_SMOOTH, MOD_DPAINT_RAMP_ALPHA, MOD_DPAINT_WAVEB_CHANGE, MOD_DYNAMICPAINT_TYPE_BRUSH, MOD_DYNAMICPAINT_TYPE_CANVAS, DynamicPaintBrushSettings::paint_ramp, DynamicPaintCanvasSettings::pmd, CBData::pos, CBData::r, and ColorBand::tot.
Referenced by dynamicPaint_Modifier_copy(), and type_toggle_exec().
| 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().
| void dynamicPaint_freeBrush | ( | struct DynamicPaintModifierData * | pmd | ) |
Definition at line 877 of file dynamicpaint.cc.
References DynamicPaintModifierData::brush, MEM_freeN(), DynamicPaintBrushSettings::paint_ramp, and DynamicPaintBrushSettings::vel_ramp.
Referenced by dynamicPaint_createType(), dynamicPaint_Modifier_free(), and type_toggle_exec().
| void dynamicPaint_freeCanvas | ( | struct DynamicPaintModifierData * | pmd | ) |
Free canvas data.
Definition at line 1014 of file dynamicpaint.cc.
References DynamicPaintModifierData::canvas, dynamicPaint_freeSurface(), ListBase::first, MEM_freeN(), DynamicPaintSurface::next, and DynamicPaintCanvasSettings::surfaces.
Referenced by dynamicPaint_createType(), dynamicPaint_Modifier_free(), and type_toggle_exec().
| void dynamicPaint_freeSurface | ( | const struct DynamicPaintModifierData * | pmd, |
| struct DynamicPaintSurface * | surface ) |
References depsgraph, and output.
Referenced by surface_slot_remove_exec().
| void dynamicPaint_freeSurfaceData | ( | struct DynamicPaintSurface * | surface | ) |
Definition at line 967 of file dynamicpaint.cc.
References ImgSeqFormatData::barycentricWeights, data, DynamicPaintSurface::data, dynamicPaint_freeAdjData(), DynamicPaintSurface::format, free_bakeData(), MEM_freeN(), MOD_DPAINT_SURFACE_F_IMAGESEQ, and ImgSeqFormatData::uv_p.
Referenced by dpaint_bake_endjob(), dynamicPaint_createUVSurface(), dynamicPaint_freeSurface(), and dynamicPaint_resetSurface().
| void dynamicPaint_Modifier_copy | ( | const struct DynamicPaintModifierData * | pmd, |
| struct DynamicPaintModifierData * | tpmd, | ||
| int | flag ) |
References flag.
Referenced by copy_data().
| 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().
| void dynamicPaint_Modifier_free | ( | struct DynamicPaintModifierData * | pmd | ) |
Free whole dynamic-paint modifier.
Definition at line 1032 of file dynamicpaint.cc.
References dynamicPaint_freeBrush(), dynamicPaint_freeCanvas(), dynamicPaint_Modifier_free_runtime(), DynamicPaintModifierData::modifier, and ModifierData::runtime.
Referenced by free_data().
| void dynamicPaint_Modifier_free_runtime | ( | struct DynamicPaintRuntime * | runtime | ) |
Definition at line 272 of file dynamicpaint.cc.
References BKE_id_free(), DynamicPaintRuntime::brush_mesh, DynamicPaintRuntime::brush_mutex, DynamicPaintRuntime::canvas_mesh, and lock.
Referenced by dynamicPaint_Modifier_free(), and free_runtime_data().
| bool dynamicPaint_outputLayerExists | ( | struct DynamicPaintSurface * | surface, |
| struct Object * | ob, | ||
| int | output ) |
Definition at line 336 of file dynamicpaint.cc.
References BKE_object_defgroup_name_index(), blender::bke::ColorByte, blender::bke::Corner, Object::data, DynamicPaintSurface::format, blender::bke::AttributeAccessor::lookup_meta_data(), MOD_DPAINT_SURFACE_F_VERTEX, MOD_DPAINT_SURFACE_T_PAINT, MOD_DPAINT_SURFACE_T_WEIGHT, name, output, DynamicPaintSurface::output_name, DynamicPaintSurface::output_name2, and DynamicPaintSurface::type.
Referenced by dynamicPaint_Modifier_apply(), and output_toggle_exec().
| void dynamicPaint_outputSurfaceImage | ( | struct DynamicPaintSurface * | surface, |
| const char * | filepath, | ||
| short | output_layer ) |
Definition at line 3317 of file dynamicpaint.cc.
References BKE_image_path_ext_from_imtype_ensure(), BKE_main_blendfile_path_from_global(), BLI_assert, BLI_file_ensure_parent_dir_exists(), BLI_parallel_range_settings_defaults(), BLI_path_abs(), BLI_task_parallel_range(), DynamicPaintSurface::canvas, data, DynamicPaintSurface::data, dynamic_paint_output_surface_image_displace_cb(), dynamic_paint_output_surface_image_paint_cb(), dynamic_paint_output_surface_image_wave_cb(), dynamic_paint_output_surface_image_wetmap_cb(), FILE_MAX, ImbFormatOptions::flag, ImBuf::foptions, ImBuf::ftype, IB_float_data, DynamicPaintSurface::image_fileformat, DynamicPaintSurface::image_resolution, IMB_allocImBuf(), IMB_freeImBuf(), IMB_FTYPE_OPENEXR, IMB_FTYPE_PNG, IMB_save_image(), MOD_DPAINT_IMGFORMAT_OPENEXR, MOD_DPAINT_SURFACE_T_DISPLACE, MOD_DPAINT_SURFACE_T_PAINT, MOD_DPAINT_SURFACE_T_WAVE, N_, ImbFormatOptions::quality, R_IMF_EXR_CODEC_ZIP, R_IMF_IMTYPE_OPENEXR, R_IMF_IMTYPE_PNG, setError(), STRNCPY(), PaintSurfaceData::total_points, DynamicPaintSurface::type, PaintSurfaceData::type_data, and TaskParallelSettings::use_threading.
Referenced by dynamicPaint_bakeImageSequence().
| bool dynamicPaint_resetSurface | ( | const struct Scene * | scene, |
| struct DynamicPaintSurface * | surface ) |
Completely (re)initializes surface (only for point cache types).
| void dynamicPaintSurface_setUniqueName | ( | struct DynamicPaintSurface * | surface, |
| const char * | basename ) |
Definition at line 418 of file dynamicpaint.cc.
References BLI_uniquename_cb(), DynamicPaintSurface::name, name, STRNCPY_UTF8, and surface_duplicateNameExists().
Referenced by dynamicPaint_createNewSurface().
| void dynamicPaintSurface_updateType | ( | struct DynamicPaintSurface * | surface | ) |
Change surface data to defaults on new type.
Definition at line 432 of file dynamicpaint.cc.
References DynamicPaintSurface::depth_clamp, DynamicPaintSurface::flags, DynamicPaintSurface::format, MOD_DPAINT_ANTIALIAS, MOD_DPAINT_SURFACE_F_IMAGESEQ, MOD_DPAINT_SURFACE_T_DISPLACE, MOD_DPAINT_SURFACE_T_PAINT, MOD_DPAINT_SURFACE_T_WAVE, MOD_DPAINT_SURFACE_T_WEIGHT, DynamicPaintSurface::output_name, DynamicPaintSurface::output_name2, SNPRINTF, STREQ, surface_setUniqueOutputName(), and DynamicPaintSurface::type.
Referenced by dynamicPaint_createNewSurface().
| 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().