Blender
V3.3
|
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_hash.h"
#include "BLI_math.h"
#include "BLI_math_color_blend.h"
#include "BLI_task.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "BKE_brush.h"
#include "BKE_colorband.h"
#include "BKE_colortools.h"
#include "BKE_context.h"
#include "BKE_mesh.h"
#include "BKE_mesh_mapping.h"
#include "BKE_object.h"
#include "BKE_paint.h"
#include "BKE_pbvh.h"
#include "BKE_scene.h"
#include "DEG_depsgraph.h"
#include "IMB_colormanagement.h"
#include "WM_api.h"
#include "WM_message.h"
#include "WM_toolsystem.h"
#include "WM_types.h"
#include "ED_object.h"
#include "ED_screen.h"
#include "ED_sculpt.h"
#include "paint_intern.h"
#include "sculpt_intern.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "UI_interface.h"
#include "IMB_imbuf.h"
#include "bmesh.h"
#include <math.h>
#include <stdlib.h>
Go to the source code of this file.
Classes | |
struct | SampleWetPaintTLSData |
Typedefs | |
typedef struct SampleWetPaintTLSData | SampleWetPaintTLSData |
Functions | |
static void | do_color_smooth_task_cb_exec (void *__restrict userdata, const int n, const TaskParallelTLS *__restrict tls) |
static void | do_paint_brush_task_cb_ex (void *__restrict userdata, const int n, const TaskParallelTLS *__restrict tls) |
static void | do_sample_wet_paint_task_cb (void *__restrict userdata, const int n, const TaskParallelTLS *__restrict tls) |
static void | sample_wet_paint_reduce (const void *__restrict UNUSED(userdata), void *__restrict chunk_join, void *__restrict chunk) |
void | SCULPT_do_paint_brush (PaintModeSettings *paint_mode_settings, Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode) |
static void | do_smear_brush_task_cb_exec (void *__restrict userdata, const int n, const TaskParallelTLS *__restrict tls) |
static void | do_smear_store_prev_colors_task_cb_exec (void *__restrict userdata, const int n, const TaskParallelTLS *__restrict UNUSED(tls)) |
void | SCULPT_do_smear_brush (Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode) |
typedef struct SampleWetPaintTLSData SampleWetPaintTLSData |
|
static |
Definition at line 57 of file sculpt_paint_color.c.
References BKE_pbvh_vertex_iter_begin, BKE_pbvh_vertex_iter_end, blend_color_interpolate_float(), BLI_task_parallel_thread_id(), StrokeCache::bstrength, SculptSession::cache, PBVHVertexIter::co, col, data, SculptBrushTest::dist, fade(), PBVHVertexIter::fno, PBVHVertexIter::index, PBVHVertexIter::mask, PBVHVertexIter::no, SculptSession::pbvh, PBVH_ITER_UNIQUE, SCULPT_brush_strength_factor(), SCULPT_brush_test_init_with_falloff_shape(), SCULPT_neighbor_color_average(), SCULPT_vertex_color_get(), SCULPT_vertex_color_set(), sqrtf, and blender::threading::enumerable_thread_specific_utils::thread_id.
Referenced by SCULPT_do_paint_brush(), and SCULPT_do_smear_brush().
|
static |
Definition at line 98 of file sculpt_paint_color.c.
References Brush::alpha, BKE_brush_color_get(), BKE_brush_secondary_color_get(), BKE_colorband_evaluate(), BKE_pbvh_node_color_buffer_get(), BKE_pbvh_vertex_iter_begin, BKE_pbvh_vertex_iter_end, Brush::blend, blend_color_interpolate_float(), blend_color_mix_float(), BLI_hash_int_01(), BLI_task_parallel_thread_id(), BRUSH_GRADIENT_PRESSURE, BRUSH_GRADIENT_SPACING_CLAMP, BRUSH_GRADIENT_SPACING_REPEAT, BRUSH_USE_GRADIENT, StrokeCache::bstrength, SculptSession::cache, CLAMP4, PBVHVertexIter::co, SculptOrigVertData::col, col, PBVHColorBufferNode::color, copy_v3_v3(), data, StrokeCache::density, usdtokens::density(), StrokeCache::density_seed, SculptBrushTest::dist, fabsf, fade(), Brush::flag, float(), StrokeCache::flow, PBVHVertexIter::fno, Brush::gradient, Brush::gradient_spacing, Brush::gradient_stroke_mode, PBVHVertexIter::i, IMB_blend_color_float(), IMB_colormanagement_srgb_to_scene_linear_v3(), PBVHVertexIter::index, StrokeCache::invert, PBVHVertexIter::mask, mul_v4_v4fl(), PBVHVertexIter::no, noise(), StrokeCache::paint_brush, SculptSession::pbvh, PBVH_ITER_UNIQUE, StrokeCache::pressure, StrokeCache::radius, SculptSession::scene, SCULPT_brush_strength_factor(), SCULPT_brush_test_cube(), SCULPT_brush_test_init_with_falloff_shape(), SCULPT_orig_vert_data_init(), SCULPT_orig_vert_data_update(), SCULPT_UNDO_COLOR, SCULPT_vertex_color_get(), SCULPT_vertex_color_set(), sqrtf, StrokeCache::stroke_distance, blender::threading::enumerable_thread_specific_utils::thread_id, Brush::tip_roundness, and StrokeCache::wet_mix.
Referenced by SCULPT_do_paint_brush().
|
static |
Definition at line 215 of file sculpt_paint_color.c.
References add_v4_v4(), BKE_pbvh_vertex_iter_begin, BKE_pbvh_vertex_iter_end, PBVHVertexIter::co, col, SampleWetPaintTLSData::color, data, PBVHVertexIter::index, SculptSession::pbvh, PBVH_ITER_UNIQUE, SculptBrushTest::radius, SculptBrushTest::radius_squared, SCULPT_brush_test_init_with_falloff_shape(), SCULPT_vertex_color_get(), and SampleWetPaintTLSData::tot_samples.
Referenced by SCULPT_do_paint_brush().
|
static |
Definition at line 380 of file sculpt_paint_color.c.
References BKE_pbvh_vertex_iter_begin, BKE_pbvh_vertex_iter_end, blend_color_interpolate_float(), blend_color_mix_float(), BLI_task_parallel_thread_id(), BRUSH_ANCHORED, BRUSH_SMEAR_DEFORM_DRAG, BRUSH_SMEAR_DEFORM_EXPAND, BRUSH_SMEAR_DEFORM_PINCH, StrokeCache::bstrength, SculptSession::cache, PBVHVertexIter::co, col, copy_v3_v3(), copy_v4_v4(), data, SculptBrushTest::dist, dot_v3v3(), fabsf, fade(), Brush::flag, PBVHVertexIter::fno, StrokeCache::grab_delta_symmetry, PBVHVertexIter::index, SculptVertexNeighborIter::index, StrokeCache::last_location, len, len_v3(), len_v3v3(), StrokeCache::location, madd_v3_v3fl(), madd_v4_v4fl(), PBVHVertexIter::mask, mul_v3_v3fl(), mul_v4_fl(), PBVHVertexIter::no, normalize_v3_v3(), SculptSession::pbvh, PBVH_ITER_UNIQUE, StrokeCache::prev_colors, SCULPT_brush_strength_factor(), SCULPT_brush_test_init_with_falloff_shape(), SCULPT_vertex_co_get(), SCULPT_vertex_color_get(), SCULPT_vertex_color_set(), SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN, SCULPT_VERTEX_NEIGHBORS_ITER_END, SCULPT_vertex_normal_get(), Brush::smear_deform_type, sqrtf, sub_v3_v3v3(), blender::threading::enumerable_thread_specific_utils::thread_id, and w().
Referenced by SCULPT_do_smear_brush().
|
static |
Definition at line 525 of file sculpt_paint_color.c.
References BKE_pbvh_vertex_iter_begin, BKE_pbvh_vertex_iter_end, SculptSession::cache, data, PBVHVertexIter::index, SculptSession::pbvh, PBVH_ITER_UNIQUE, StrokeCache::prev_colors, and SCULPT_vertex_color_get().
Referenced by SCULPT_do_smear_brush().
|
static |
Definition at line 245 of file sculpt_paint_color.c.
References add_v4_v4(), SampleWetPaintTLSData::color, and SampleWetPaintTLSData::tot_samples.
Referenced by SCULPT_do_paint_brush().
void SCULPT_do_paint_brush | ( | PaintModeSettings * | paint_mode_settings, |
Sculpt * | sd, | ||
Object * | ob, | ||
PBVHNode ** | nodes, | ||
int | totnode | ||
) |
Definition at line 256 of file sculpt_paint_color.c.
References StrokeCache::alt_smooth, BKE_curvemapping_init(), BKE_paint_brush(), BKE_pbvh_parallel_range_settings(), blend_color_interpolate_float(), BLI_hash_int_01(), BLI_task_parallel_range(), SculptSession::cache, CLAMP4, SampleWetPaintTLSData::color, copy_v3_v3(), copy_v4_v4(), cross_v3_v3v3(), Brush::curve, data, StrokeCache::density_seed, do_color_smooth_task_cb_exec(), do_paint_brush_task_cb_ex(), do_sample_wet_paint_task_cb(), StrokeCache::first_time, float(), TaskParallelSettings::func_reduce, StrokeCache::grab_delta_symmetry, invert_m4_m4(), is_finite_v4(), is_zero_m4(), StrokeCache::location, mul_m4_m4m4(), mul_v3_fl(), mul_v4_fl(), normalize_m4(), Sculpt::paint, StrokeCache::paint_brush, StrokeCache::radius, sample_wet_paint_reduce(), scale_m4_fl(), Object::sculpt, SCULPT_calc_area_normal(), SCULPT_do_paint_brush_image(), SCULPT_has_colors(), SCULPT_stroke_is_first_brush_step(), SCULPT_stroke_is_first_brush_step_of_symmetry_pass(), SCULPT_use_image_paint_brush(), SculptThreadedTaskData::sd, Brush::tip_roundness, Brush::tip_scale_x, SampleWetPaintTLSData::tot_samples, TaskParallelSettings::userdata_chunk, TaskParallelSettings::userdata_chunk_size, StrokeCache::wet_mix, StrokeCache::wet_mix_prev_color, StrokeCache::wet_persistence, and zero_v4().
Referenced by do_brush_action().
Definition at line 539 of file sculpt_paint_color.c.
References StrokeCache::alt_smooth, BKE_curvemapping_init(), BKE_paint_brush(), BKE_pbvh_parallel_range_settings(), BLI_task_parallel_range(), StrokeCache::bstrength, SculptSession::cache, Brush::curve, data, do_color_smooth_task_cb_exec(), do_smear_brush_task_cb_exec(), do_smear_store_prev_colors_task_cb_exec(), MEM_callocN, Sculpt::paint, StrokeCache::prev_colors, Object::sculpt, SCULPT_has_colors(), SCULPT_vertex_color_get(), and SCULPT_vertex_count_get().
Referenced by do_brush_action().