70 ss, &test,
data->brush->falloff_shape);
74 if (!sculpt_brush_test_sq_fn(&test, vd.
co)) {
87 float smooth_color[4];
117 ss, &test,
data->brush->falloff_shape);
120 float brush_color[4] = {0.0f, 0.0f, 0.0f, 1.0f};
149 bool affect_vertex =
false;
150 float distance_to_stroke_location = 0.0f;
156 affect_vertex = sculpt_brush_test_sq_fn(&test, vd.
co);
157 distance_to_stroke_location =
sqrtf(test.
dist);
160 if (!affect_vertex) {
167 distance_to_stroke_location,
186 float paint_color[4];
187 float wet_mix_color[4];
188 float buffer_color[4];
226 ss, &test,
data->brush->falloff_shape);
228 test.
radius *=
data->brush->wet_paint_radius_factor;
232 if (!sculpt_brush_test_sq_fn(&test, vd.
co)) {
246 void *__restrict chunk_join,
247 void *__restrict chunk)
328 float wet_color[4] = {0.0f};
351 CLAMP4(wet_color, 0.0f, 1.0f);
371 .wet_mix_sampled_color = wet_color,
393 ss, &test,
data->brush->falloff_shape);
396 float brush_delta[3];
406 if (!sculpt_brush_test_sq_fn(&test, vd.
co)) {
419 float current_disp[3];
420 float current_disp_norm[3];
421 float interp_color[4];
443 mul_v3_v3fl(current_disp, current_disp_norm, bstrength);
445 float accum[4] = {0.0f, 0.0f, 0.0f, 0.0f};
467 float vertex_disp[3];
468 float vertex_disp_norm[3];
473 float w = (1.0f +
fabsf(
len_v3(vertex_disp) / bstrength - 1.0f));
494 if (
dot_v3v3(current_disp_norm, vertex_disp_norm) >= 0.0f) {
499 float color_interp = -
dot_v3v3(current_disp_norm, vertex_disp_norm);
502 w *= color_interp * color_interp;
552 for (
int i = 0; i < totvert; i++) {
typedef float(TangentPoint)[2]
const float * BKE_brush_secondary_color_get(const struct Scene *scene, const struct Brush *brush)
const float * BKE_brush_color_get(const struct Scene *scene, const struct Brush *brush)
bool BKE_colorband_evaluate(const struct ColorBand *coba, float in, float out[4])
General operations, lookup, etc. for blender objects.
struct Brush * BKE_paint_brush(struct Paint *paint)
A BVH for high poly meshes.
#define BKE_pbvh_vertex_iter_begin(pbvh, node, vi, mode)
#define BKE_pbvh_vertex_iter_end
void BKE_pbvh_parallel_range_settings(struct TaskParallelSettings *settings, bool use_threading, int totnode)
PBVHColorBufferNode * BKE_pbvh_node_color_buffer_get(PBVHNode *node)
BLI_INLINE float BLI_hash_int_01(unsigned int k)
MINLINE void blend_color_mix_float(float dst[4], const float src1[4], const float src2[4])
MINLINE void blend_color_interpolate_float(float dst[4], const float src1[4], const float src2[4], float t)
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
bool invert_m4_m4(float R[4][4], const float A[4][4])
void scale_m4_fl(float R[4][4], float scale)
bool is_zero_m4(const float mat[4][4])
void normalize_m4(float R[4][4]) ATTR_NONNULL()
MINLINE void mul_v4_fl(float r[4], float f)
MINLINE void add_v4_v4(float r[4], const float a[4])
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f)
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void mul_v4_v4fl(float r[4], const float a[4], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void zero_v4(float r[4])
MINLINE float normalize_v3_v3(float r[3], const float a[3])
bool is_finite_v4(const float a[4]) ATTR_WARN_UNUSED_RESULT
MINLINE void madd_v4_v4fl(float r[4], const float a[4], float f)
MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f)
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
void BLI_task_parallel_range(int start, int stop, void *userdata, TaskParallelRangeFunc func, const TaskParallelSettings *settings)
int BLI_task_parallel_thread_id(const TaskParallelTLS *tls)
#define CLAMP4(vec, b, c)
@ BRUSH_SMEAR_DEFORM_PINCH
@ BRUSH_SMEAR_DEFORM_EXPAND
@ BRUSH_SMEAR_DEFORM_DRAG
@ BRUSH_GRADIENT_SPACING_CLAMP
@ BRUSH_GRADIENT_PRESSURE
@ BRUSH_GRADIENT_SPACING_REPEAT
BLI_INLINE void IMB_colormanagement_srgb_to_scene_linear_v3(float scene_linear[3], const float srgb[3])
void IMB_blend_color_float(float dst[4], const float src1[4], const float src2[4], IMB_BlendMode mode)
Read Guarded memory(de)allocation.
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
void *(* MEM_callocN)(size_t len, const char *str)
thread_local int thread_id
static const pxr::TfToken density("density", pxr::TfToken::Immortal)
static float noise(int n)
CCL_NAMESPACE_BEGIN ccl_device float fade(float t)
const float * SCULPT_vertex_co_get(SculptSession *ss, int index)
int SCULPT_vertex_count_get(SculptSession *ss)
void SCULPT_orig_vert_data_update(SculptOrigVertData *orig_data, PBVHVertexIter *iter)
void SCULPT_orig_vert_data_init(SculptOrigVertData *data, Object *ob, PBVHNode *node, SculptUndoType type)
SculptBrushTestFn SCULPT_brush_test_init_with_falloff_shape(SculptSession *ss, SculptBrushTest *test, char falloff_shape)
float SCULPT_brush_strength_factor(SculptSession *ss, const Brush *br, const float brush_point[3], const float len, const float vno[3], const float fno[3], const float mask, const int vertex_index, const int thread_id)
bool SCULPT_brush_test_cube(SculptBrushTest *test, const float co[3], const float local[4][4], const float roundness)
void SCULPT_vertex_color_set(SculptSession *ss, int index, const float color[4])
void SCULPT_vertex_color_get(const SculptSession *ss, int index, float r_color[4])
void SCULPT_vertex_normal_get(SculptSession *ss, int index, float no[3])
bool SCULPT_stroke_is_first_brush_step_of_symmetry_pass(StrokeCache *cache)
void SCULPT_calc_area_normal(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode, float r_area_no[3])
bool SCULPT_stroke_is_first_brush_step(StrokeCache *cache)
bool SCULPT_has_colors(const SculptSession *ss)
#define SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN(ss, v_index, neighbor_iterator)
bool SCULPT_use_image_paint_brush(struct PaintModeSettings *settings, Object *ob) ATTR_NONNULL()
bool(* SculptBrushTestFn)(SculptBrushTest *test, const float co[3])
#define SCULPT_VERTEX_NEIGHBORS_ITER_END(neighbor_iterator)
void SCULPT_neighbor_color_average(SculptSession *ss, float result[4], int index)
void SCULPT_do_paint_brush_image(struct PaintModeSettings *paint_mode_settings, Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode) ATTR_NONNULL()
void SCULPT_do_paint_brush(PaintModeSettings *paint_mode_settings, Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
void SCULPT_do_smear_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
static void do_color_smooth_task_cb_exec(void *__restrict userdata, const int n, const TaskParallelTLS *__restrict tls)
static void do_smear_brush_task_cb_exec(void *__restrict userdata, const int n, const TaskParallelTLS *__restrict tls)
struct SampleWetPaintTLSData SampleWetPaintTLSData
static void sample_wet_paint_reduce(const void *__restrict UNUSED(userdata), void *__restrict chunk_join, void *__restrict chunk)
static void do_smear_store_prev_colors_task_cb_exec(void *__restrict userdata, const int n, const TaskParallelTLS *__restrict UNUSED(tls))
static void do_sample_wet_paint_task_cb(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)
struct ColorBand * gradient
struct CurveMapping * curve
char gradient_stroke_mode
struct SculptSession * sculpt
struct StrokeCache * cache
float wet_mix_prev_color[4]
struct StrokeCache::@514 paint_brush
float grab_delta_symmetry[3]
TaskParallelReduceFunc func_reduce
size_t userdata_chunk_size