Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/sculpt_paint_color.c
| Show All 38 Lines | |||||
| #include "BKE_mesh_mapping.h" | #include "BKE_mesh_mapping.h" | ||||
| #include "BKE_object.h" | #include "BKE_object.h" | ||||
| #include "BKE_paint.h" | #include "BKE_paint.h" | ||||
| #include "BKE_pbvh.h" | #include "BKE_pbvh.h" | ||||
| #include "BKE_scene.h" | #include "BKE_scene.h" | ||||
| #include "DEG_depsgraph.h" | #include "DEG_depsgraph.h" | ||||
| #include "IMB_colormanagement.h" | |||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| #include "WM_message.h" | #include "WM_message.h" | ||||
| #include "WM_toolsystem.h" | #include "WM_toolsystem.h" | ||||
| #include "WM_types.h" | #include "WM_types.h" | ||||
| #include "ED_object.h" | #include "ED_object.h" | ||||
| #include "ED_screen.h" | #include "ED_screen.h" | ||||
| #include "ED_sculpt.h" | #include "ED_sculpt.h" | ||||
| ▲ Show 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | static void do_paint_brush_task_cb_ex(void *__restrict userdata, | ||||
| color_buffer = BKE_pbvh_node_color_buffer_get(data->nodes[n]); | color_buffer = BKE_pbvh_node_color_buffer_get(data->nodes[n]); | ||||
| SculptBrushTest test; | SculptBrushTest test; | ||||
| SculptBrushTestFn sculpt_brush_test_sq_fn = SCULPT_brush_test_init_with_falloff_shape( | SculptBrushTestFn sculpt_brush_test_sq_fn = SCULPT_brush_test_init_with_falloff_shape( | ||||
| ss, &test, data->brush->falloff_shape); | ss, &test, data->brush->falloff_shape); | ||||
| const int thread_id = BLI_task_parallel_thread_id(tls); | const int thread_id = BLI_task_parallel_thread_id(tls); | ||||
| float brush_color[4] = {0.0f, 0.0f, 0.0f, 1.0f}; | float brush_color[4] = {0.0f, 0.0f, 0.0f, 1.0f}; | ||||
| copy_v3_v3(brush_color, BKE_brush_color_get(ss->scene, brush)); | copy_v3_v3(brush_color, BKE_brush_color_get(ss->scene, brush)); | ||||
| IMB_colormanagement_srgb_to_scene_linear_v3(brush_color); | |||||
sergey: float brush_color[4];
srgb_to_linearrgb_v3_v3(brush_color, BKE_brush_color_get(ss->scene… | |||||
| BKE_pbvh_vertex_iter_begin(ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE) | BKE_pbvh_vertex_iter_begin(ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE) | ||||
| { | { | ||||
| SCULPT_orig_vert_data_update(&orig_data, &vd); | SCULPT_orig_vert_data_update(&orig_data, &vd); | ||||
| bool affect_vertex = false; | bool affect_vertex = false; | ||||
| float distance_to_stroke_location = 0.0f; | float distance_to_stroke_location = 0.0f; | ||||
| if (brush->tip_roundness < 1.0f) { | if (brush->tip_roundness < 1.0f) { | ||||
| affect_vertex = SCULPT_brush_test_cube(&test, vd.co, data->mat, brush->tip_roundness); | affect_vertex = SCULPT_brush_test_cube(&test, vd.co, data->mat, brush->tip_roundness); | ||||
| ▲ Show 20 Lines • Show All 331 Lines • Show Last 20 Lines | |||||
Or you can even do:
float brush_color[4] = {0.0f, 0.0f, 0.0f, 1.0f}; srgb_to_linearrgb_v3_v3(brush_color, BKE_brush_color_get(ss->scene, brush));