129 snap->old_zoom = zoom;
153 Brush *br = data->br;
156 MTex *mtex = data->mtex;
157 uchar *buffer = data->buffer;
158 const bool col = data->col;
161 const int size = data->size;
162 const float rotation = data->rotation;
163 const float radius = data->radius;
165 bool convert_to_linear =
false;
174 convert_to_linear =
true;
180 for (
int i = 0; i <
size; i++) {
183 int index = j * size + i;
194 x = (x - 0.5f) * 2.0f;
195 y = (y - 0.5f) * 2.0f;
203 if (mtex->
tex && (rotation > 0.001f || rotation < -0.001f)) {
204 const float angle =
atan2f(y, x) + rotation;
215 if (convert_to_linear) {
223 buffer[index * 4] = rgba[0] * 255;
224 buffer[index * 4 + 1] = rgba[1] * 255;
225 buffer[index * 4 + 2] = rgba[2] * 255;
226 buffer[index * 4 + 3] = rgba[3] * 255;
232 CLAMP(avg, 0.0f, 1.0f);
233 buffer[index] = 255 -
uchar(255 * avg);
238 buffer[index * 4] = 0;
239 buffer[index * 4 + 1] = 0;
240 buffer[index * 4 + 2] = 0;
241 buffer[index * 4 + 3] = 0;
257 uchar *buffer =
nullptr;
269 init = (target->overlay_texture !=
nullptr);
283 for (s >>= 1; s > 0; s >>= 1) {
294 size = target->old_size;
301 if (target->old_size != size || target->old_col !=
col) {
302 if (target->overlay_texture) {
304 target->overlay_texture =
nullptr;
308 target->old_size =
size;
309 target->old_col =
col;
329 data.buffer = buffer;
333 data.rotation = rotation;
334 data.radius = radius;
348 if (!target->overlay_texture) {
352 "paint_cursor_overlay", size, size, 1,
format, usage,
nullptr);
369 size = target->old_size;
382 Brush *br = data->br;
384 uchar *buffer = data->buffer;
386 const int size = data->
size;
388 for (
int i = 0; i <
size; i++) {
391 const int index = j * size + i;
392 const float x = ((
float(i) /
size) - 0.5f) * 2.0f;
393 const float y = ((
float(j) /
size) - 0.5f) * 2.0f;
394 const float len =
sqrtf(x * x + y * y);
401 buffer[index] =
uchar(255 * avg);
414 uchar *buffer =
nullptr;
431 for (s >>= 1; s > 0; s >>= 1) {
461 data.buffer = buffer;
471 "cursor_snap_overaly", size, size, 1,
GPU_R8, usage,
nullptr);
497 float view[3], nonortho[3], ortho[3], offset[3], p1[2], p2[2];
503 if (
fabsf(view[0]) < 0.1f) {
504 nonortho[0] = view[0] + 1.0f;
505 nonortho[1] = view[1];
506 nonortho[2] = view[2];
508 else if (
fabsf(view[1]) < 0.1f) {
509 nonortho[0] = view[0];
510 nonortho[1] = view[1] + 1.0f;
511 nonortho[2] = view[2];
514 nonortho[0] = view[0];
515 nonortho[1] = view[1];
516 nonortho[2] = view[2] + 1.0f;
608 quad.xmin = center[0] - radius;
609 quad.ymin = center[1] - radius;
610 quad.xmax = center[0] + radius;
611 quad.ymax = center[1] + radius;
654 float final_color[4] = {1.0f, 1.0f, 1.0f, 1.0f};
656 copy_v3_v3(final_color,
U.sculpt_paint_overlay_col);
658 mul_v4_fl(final_color, overlay_alpha * 0.01f);
724 quad.xmin = x - radius;
725 quad.ymin = y - radius;
726 quad.xmax = x + radius;
727 quad.ymax = y + radius;
747 float final_color[4] = {
UNPACK3(
U.sculpt_paint_overlay_col), 1.0f};
754 {GPU_SAMPLER_FILTERING_LINEAR,
755 GPU_SAMPLER_EXTEND_MODE_CLAMP_TO_BORDER,
756 GPU_SAMPLER_EXTEND_MODE_CLAMP_TO_BORDER});
792 bool alpha_overlay_active =
false;
811 ups, brush, vc, x, y, zoom, mode,
false,
false);
830 return alpha_overlay_active;
834 const float sel_col[4],
835 const float pivot_col[4],
844 float w = width / 2.0f;
845 const float tri[3][2] = {
847 {co[0] -
w, co[1] -
w},
848 {co[0] +
w, co[1] -
w},
868 const float sel_col[4],
869 const float handle_col[4],
878 float w = width / 2.0f;
879 float minx = co[0] -
w;
880 float miny = co[1] -
w;
881 float maxx = co[0] +
w;
882 float maxy = co[1] +
w;
905 if (bez->
f1 || bez->
f2) {
916 if (bez->
f3 || bez->
f2) {
945 float selec_col[4], handle_col[4], pivot_col[4];
950 for (
int i = 0; i < pc->
tot_points - 1; i++, cp++) {
962 for (j = 0; j < 2; j++) {
1012 const float location[3])
1014 float unprojected_radius, projected_radius;
1024 projected_radius = 8;
1046 const float true_location[3],
1047 const float obmat[4][4],
1050 float translation_vertex_cursor[3], location[3];
1055 if (translation_vertex_cursor[2] <= 1.0f) {
1057 gpuattr, translation_vertex_cursor[0], translation_vertex_cursor[1], size, 10);
1063 const float true_location[3],
1071 mesh =
static_cast<const Mesh *
>(ob.
data);
1074 float orgLoc[3], location[3];
1082 for (
int dim = 0; dim < 3; dim++) {
1084 start[dim] = (bounds.
min[dim] - orgLoc[dim] - radius) / step[dim];
1085 end[dim] = (bounds.
max[dim] - orgLoc[dim] + radius) / step[dim];
1088 start[dim] = end[dim] = 0;
1092 for (cur[0] = start[0]; cur[0] <= end[0]; cur[0]++) {
1093 for (cur[1] = start[1]; cur[1] <= end[1]; cur[1]++) {
1094 for (cur[2] = start[2]; cur[2] <= end[2]; cur[2]++) {
1095 if (!cur[0] && !cur[1] && !cur[2]) {
1100 for (
int dim = 0; dim < 3; dim++) {
1101 location[dim] = cur[dim] * step[dim] + orgLoc[dim];
1112 const float true_location[3],
1119 float symm_rot_mat[4][4];
1121 for (
int i = 0; i <= symm; i++) {
1122 if (i == 0 || (symm & i && (symm != 5 || i != 3) && (symm != 6 || !
ELEM(i, 3, 5)))) {
1132 for (
char raxis = 0; raxis < 3; raxis++) {
1137 rotate_m4(symm_rot_mat, raxis +
'X', angle);
1193 const float line_width,
1194 const float outline_col[3],
1197 float cursor_trans[4][4];
1300 pcontext->
region = region;
1307 if (pcontext->
paint ==
nullptr) {
1311 if (pcontext->
brush ==
nullptr) {
1351 pcontext->
ss = active_object ? active_object->
sculpt :
nullptr;
1359 if (!is_brush_tool) {
1407 const float mval_fl[2] = {
1493 float viewport_size[4];
1495 immUniform2f(
"viewport_size", viewport_size[2], viewport_size[3]);
1504 const int nsegments =
max_ii(8, radius / 2);
1528 const int x = pcontext->
x;
1529 const int y = pcontext->
y;
1533 if (grease_pencil->
runtime->is_drawing_stroke) {
1539 grease_pencil->
runtime->temp_use_eraser)
1593 const bool use_vertex_color_stroke = use_vertex_color &&
1602 const float scale = 1.0f / 255.0f;
1617 const float3 darkcolor = color * 0.40f;
1624 switch (pcontext->
mode) {
1676 float cursor_trans[4][4], cursor_rot[4][4];
1677 const float z_axis[4] = {0.0f, 0.0f, 1.0f, 0.0f};
1726 pcontext->
vc.
obact->object_to_world().ptr(),
1742 pcontext->
vc.
obact->object_to_world().ptr(),
1797 active_vertex_co = positions[std::get<int>(ss.
active_vert())];
1852 position = positions[vert];
1867 pcontext->
pos, pcontext->
region, position, active_object.object_to_world().ptr(), 2);
1923 const float white[3] = {1.0f, 1.0f, 1.0f};
1924 const float zero_v[3] = {0.0f};
1929 pcontext->
pos, brush, zero_v, zero_v, pcontext->
radius, 1.0f, white, 0.25f);
2010 const float red[3] = {1.0f, 0.2f, 0.2f};
float BKE_brush_unprojected_radius_get(const Scene *scene, const Brush *brush)
int BKE_brush_size_get(const Scene *scene, const Brush *brush)
void BKE_brush_unprojected_radius_set(Scene *scene, Brush *brush, float unprojected_radius)
void BKE_brush_size_set(Scene *scene, Brush *brush, int size)
bool BKE_brush_use_size_pressure(const Brush *brush)
bool BKE_brush_sculpt_has_secondary_color(const Brush *brush)
const float * BKE_brush_color_get(const Scene *scene, const Paint *paint, const Brush *brush)
bool BKE_brush_use_locked_size(const Scene *scene, const Brush *brush)
float BKE_brush_curve_strength_clamped(const Brush *br, float p, float len)
wmWindow * CTX_wm_window(const bContext *C)
Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
Object * CTX_data_active_object(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
ToolSettings * CTX_data_tool_settings(const bContext *C)
ARegion * CTX_wm_region(const bContext *C)
wmWindowManager * CTX_wm_manager(const bContext *C)
View3D * CTX_wm_view3d(const bContext *C)
void BKE_curve_forward_diff_bezier(float q0, float q1, float q2, float q3, float *p, int it, int stride)
Low-level operations for grease pencil.
Material * BKE_grease_pencil_object_material_from_brush_get(Object *ob, Brush *brush)
void BKE_image_pool_free(ImagePool *pool)
ImBuf * BKE_image_pool_acquire_ibuf(Image *ima, ImageUser *iuser, ImagePool *pool)
void BKE_image_pool_release_ibuf(Image *ima, ImBuf *ibuf, ImagePool *pool)
ImagePool * BKE_image_pool_new(void)
General operations, lookup, etc. for blender objects.
Mesh * BKE_object_get_evaluated_mesh_no_subsurf(const Object *object_eval)
ePaintOverlayControlFlags BKE_paint_get_overlay_flags()
ePaintOverlayControlFlags
@ PAINT_OVERLAY_INVALID_CURVE
@ PAINT_OVERLAY_INVALID_TEXTURE_SECONDARY
@ PAINT_OVERLAY_OVERRIDE_CURSOR
@ PAINT_OVERLAY_INVALID_TEXTURE_PRIMARY
@ PAINT_OVERLAY_OVERRIDE_SECONDARY
@ PAINT_OVERLAY_OVERRIDE_PRIMARY
void BKE_paint_reset_overlay_invalid(ePaintOverlayControlFlags flag)
void BKE_sculpt_update_object_for_edit(Depsgraph *depsgraph, Object *ob_orig, bool is_paint_tool)
Paint * BKE_paint_get_active_from_context(const bContext *C)
Brush * BKE_paint_brush(Paint *paint)
bool paint_calculate_rake_rotation(UnifiedPaintSettings &ups, const Brush &brush, const float mouse_pos[2], PaintMode paint_mode, bool stroke_has_started)
PaintMode BKE_paintmode_get_active_from_context(const bContext *C)
void BKE_paint_invalidate_overlay_all()
#define BLI_assert_unreachable()
MINLINE float max_ff(float a, float b)
MINLINE float clamp_f(float value, float min, float max)
MINLINE int max_ii(int a, int b)
void linearrgb_to_srgb_v3_v3(float srgb[3], const float linear[3])
void unit_m4(float m[4][4])
void translate_m4(float mat[4][4], float Tx, float Ty, float Tz)
void mul_m4_v3(const float M[4][4], float r[3])
void copy_m4_m4(float m1[4][4], const float m2[4][4])
void rotate_m4(float mat[4][4], char axis, float angle)
void rotation_between_vecs_to_quat(float q[4], const float v1[3], const float v2[3])
void quat_to_mat4(float m[4][4], const float q[4])
MINLINE void mul_v4_fl(float r[4], float f)
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v2_fl2(float v[2], float x, float y)
MINLINE void clamp_v4(float vec[4], float min, float max)
MINLINE float len_v2v2(const float v1[2], const float v2[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void copy_v3_v3_int(int r[3], const int a[3])
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void copy_v3_fl(float r[3], float f)
MINLINE float normalize_v3(float n[3])
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
bool BLI_rcti_isect_pt(const struct rcti *rect, int x, int y)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
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)
BLI_INLINE void BLI_parallel_range_settings_defaults(TaskParallelSettings *settings)
@ GPAINT_BRUSH_TYPE_ERASE
@ SCULPT_BRUSH_TYPE_BOUNDARY
@ SCULPT_BRUSH_TYPE_CLOTH
@ SCULPT_BRUSH_TYPE_MULTIPLANE_SCRAPE
@ SCULPT_BRUSH_TYPE_LAYER
@ BRUSH_GRAB_ACTIVE_VERTEX
@ IMAGE_PAINT_BRUSH_TYPE_FILL
@ IMAGE_PAINT_BRUSH_TYPE_DRAW
@ PAINT_FALLOFF_SHAPE_SPHERE
@ PAINT_FALLOFF_SHAPE_TUBE
@ BRUSH_OVERLAY_SECONDARY
@ BRUSH_CLOTH_FORCE_FALLOFF_RADIAL
@ BRUSH_CLOTH_FORCE_FALLOFF_PLANE
@ BRUSH_CLOTH_SIMULATION_AREA_LOCAL
@ BRUSH_CLOTH_SIMULATION_AREA_GLOBAL
Object is a sort of wrapper for general info.
@ GPPAINT_FLAG_USE_VERTEXCOLOR
void ED_view3d_global_to_vector(const RegionView3D *rv3d, const float coord[3], float r_out[3])
ViewContext ED_view3d_viewcontext_init(bContext *C, Depsgraph *depsgraph)
void ED_view3d_draw_setup_view(const wmWindowManager *wm, wmWindow *win, Depsgraph *depsgraph, Scene *scene, ARegion *region, View3D *v3d, const float viewmat[4][4], const float winmat[4][4], const rcti *rect)
void ED_view3d_project_v3(const ARegion *region, const float world[3], float r_region_co[3])
eV3DProjStatus ED_view3d_project_float_global(const ARegion *region, const float co[3], float r_co[2], eV3DProjTest flag)
void GPU_matrix_translate_2fv(const float vec[2])
void GPU_matrix_scale_2f(float x, float y)
void GPU_matrix_push_projection()
#define GPU_matrix_mul(x)
void GPU_matrix_scale_1f(float factor)
void GPU_matrix_rotate_2d(float deg)
void GPU_matrix_pop_projection()
void GPU_matrix_translate_2f(float x, float y)
@ GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR
@ GPU_SHADER_3D_UNIFORM_COLOR
@ GPU_SHADER_3D_IMAGE_COLOR
@ GPU_BLEND_ALPHA_PREMULT
void GPU_blend(eGPUBlend blend)
void GPU_line_width(float width)
eGPUBlend GPU_blend_get()
void GPU_line_smooth(bool enable)
eGPUDepthTest GPU_depth_test_get()
void GPU_color_mask(bool r, bool g, bool b, bool a)
void GPU_depth_test(eGPUDepthTest test)
void GPU_viewport_size_get_f(float coords[4])
GPUTexture * GPU_texture_create_2d(const char *name, int width, int height, int mip_len, eGPUTextureFormat format, eGPUTextureUsage usage, const float *data)
void GPU_texture_free(GPUTexture *texture)
void GPU_texture_unbind(GPUTexture *texture)
@ GPU_TEXTURE_USAGE_SHADER_READ
@ GPU_TEXTURE_USAGE_ATTACHMENT
@ GPU_SAMPLER_EXTEND_MODE_REPEAT
@ GPU_SAMPLER_EXTEND_MODE_CLAMP_TO_BORDER
@ GPU_SAMPLER_FILTERING_LINEAR
void GPU_texture_update(GPUTexture *texture, eGPUDataFormat data_format, const void *data)
void GPU_texture_swizzle_set(GPUTexture *texture, const char swizzle[4])
void IMB_colormanagement_colorspace_to_scene_linear_v3(float pixel[3], ColorSpace *colorspace)
Contains defines and structs used throughout the imbuf module.
Read Guarded memory(de)allocation.
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Brightness Control the brightness and contrast of the input color Vector Map input vector components with curves Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert Invert a producing a negative Combine Generate a color from its red
void ntreeTexEndExecTree(struct bNodeTreeExec *exec)
struct bNodeTreeExec * ntreeTexBeginExecTree(struct bNodeTree *ntree)
void UI_GetThemeColorType4fv(int colorid, int spacetype, float col[4])
ATTR_WARN_UNUSED_RESULT BMesh * bm
BLI_INLINE BMVert * BM_vert_at_index(BMesh *bm, const int index)
ATTR_WARN_UNUSED_RESULT const BMVert * v
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
float3 project(float2 co) const
const Depsgraph * depsgraph
draw_view in_light_buf[] float
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
RAYTRACE_GROUP_SIZE additional_info("eevee_shared", "eevee_gbuffer_data", "eevee_global_ubo", "eevee_sampling_data", "eevee_utility_texture", "eevee_hiz_data", "draw_view") .specialization_constant(Type RAYTRACE_GROUP_SIZE in_sh_0_tx in_sh_2_tx screen_normal_tx GPU_RGBA8
blender::gpu::Batch * quad
void *(* MEM_mallocN)(size_t len, const char *str)
void MEM_freeN(void *vmemh)
pbvh::Tree & pbvh_ensure(Depsgraph &depsgraph, Object &object)
pbvh::Tree * pbvh_get(Object &object)
Span< float3 > vert_positions_eval(const Depsgraph &depsgraph, const Object &object_orig)
void pivot_line_preview_draw(const uint gpuattr, SculptSession &ss)
std::unique_ptr< SculptBoundaryPreview > preview_data_init(const Depsgraph &depsgraph, Object &object, const Brush *brush, const float radius)
void edges_preview_draw(const uint gpuattr, SculptSession &ss, const float outline_col[3], const float outline_alpha)
void plane_falloff_preview_draw(const uint gpuattr, SculptSession &ss, const float outline_col[3], float outline_alpha)
void simulation_limits_draw(const uint gpuattr, const Brush &brush, const float location[3], const float normal[3], const float rds, const float line_width, const float outline_col[3], const float alpha)
std::unique_ptr< SculptPoseIKChainPreview > preview_ik_chain_init(const Depsgraph &depsgraph, Object &ob, SculptSession &ss, const Brush &brush, const float3 &initial_location, const float radius)
static void paint_cursor_preview_boundary_data_update(PaintCursorContext *pcontext)
static void paint_cursor_update_unprojected_radius(UnifiedPaintSettings &ups, Brush &brush, ViewContext &vc, const float location[3])
static void load_tex_cursor_task_cb(void *__restrict userdata, const int j, const TaskParallelTLS *__restrict)
static bool paint_use_2d_cursor(PaintMode mode)
static void paint_cursor_pose_brush_segments_draw(PaintCursorContext *pcontext)
static bool paint_draw_tex_overlay(UnifiedPaintSettings *ups, Brush *brush, ViewContext *vc, int x, int y, float zoom, const PaintMode mode, bool col, bool primary)
static void SCULPT_layer_brush_height_preview_draw(const uint gpuattr, const Brush &brush, const float rds, const float line_width, const float outline_col[3], const float alpha)
static void load_tex_task_cb_ex(void *__restrict userdata, const int j, const TaskParallelTLS *__restrict tls)
static void grease_pencil_eraser_draw(PaintCursorContext *pcontext)
static void paint_draw_cursor(bContext *C, int x, int y, void *)
static void paint_cursor_pose_brush_origins_draw(PaintCursorContext *pcontext)
static int same_tex_snap(TexSnapshot *snap, MTex *mtex, ViewContext *vc, bool col, float zoom)
static void sculpt_geometry_preview_lines_draw(const Depsgraph &depsgraph, const uint gpuattr, const Brush &brush, const Object &object)
static void paint_draw_legacy_3D_view_brush_cursor(PaintCursorContext *pcontext)
static void make_tex_snap(TexSnapshot *snap, ViewContext *vc, float zoom)
static void paint_draw_2D_view_brush_cursor_default(PaintCursorContext *pcontext)
static void paint_cursor_update_rake_rotation(PaintCursorContext *pcontext)
static void cursor_draw_point_screen_space(const uint gpuattr, const ARegion *region, const float true_location[3], const float obmat[4][4], const int size)
float3 symmetry_flip(const float3 &src, const ePaintSymmetryFlags symm)
static void grease_pencil_brush_cursor_draw(PaintCursorContext *pcontext)
static void paint_cursor_restore_drawing_state()
static void paint_draw_3D_view_inactive_brush_cursor(PaintCursorContext *pcontext)
static void cursor_draw_tiling_preview(const uint gpuattr, const ARegion *region, const float true_location[3], const Sculpt &sd, const Object &ob, const float radius)
BLI_INLINE void draw_bezier_handle_lines(uint pos, const float sel_col[4], BezTriple *bez)
static void paint_cursor_draw_3d_view_brush_cursor_inactive(PaintCursorContext *pcontext)
BLI_INLINE void draw_tri_point(uint pos, const float sel_col[4], const float pivot_col[4], float *co, float width, bool selected)
BLI_INLINE void draw_rect_point(uint pos, const float sel_col[4], const float handle_col[4], const float *co, float width, bool selected)
static void paint_cursor_setup_3D_drawing(PaintCursorContext *pcontext)
static void paint_draw_2D_view_brush_cursor(PaintCursorContext *pcontext)
static bool paint_draw_alpha_overlay(UnifiedPaintSettings *ups, Brush *brush, ViewContext *vc, int x, int y, float zoom, PaintMode mode)
static void paint_cursor_preview_boundary_data_pivot_draw(PaintCursorContext *pcontext)
static void paint_cursor_cursor_draw_3d_view_brush_cursor_active(PaintCursorContext *pcontext)
static void paint_cursor_update_object_space_radius(PaintCursorContext *pcontext)
static void paint_cursor_sculpt_session_update_and_init(PaintCursorContext *pcontext)
static void paint_update_mouse_cursor(PaintCursorContext *pcontext)
static bool paint_cursor_is_3d_view_navigating(PaintCursorContext *pcontext)
static int load_tex(Brush *br, ViewContext *vc, float zoom, bool col, bool primary)
static void cursor_draw_point_with_symmetry(const uint gpuattr, const ARegion *region, const float true_location[3], const Sculpt &sd, const Object &ob, const float radius)
static void paint_cursor_check_and_draw_alpha_overlays(PaintCursorContext *pcontext)
static int load_tex_cursor(Brush *br, ViewContext *vc, float zoom)
static void paint_draw_curve_cursor(Brush *brush, ViewContext *vc)
static bool paint_cursor_context_init(bContext *C, const int x, const int y, PaintCursorContext *pcontext)
static void paint_cursor_update_pixel_radius(PaintCursorContext *pcontext)
static int project_brush_radius(ViewContext *vc, float radius, const float location[3])
static void paint_cursor_draw_main_inactive_cursor(PaintCursorContext *pcontext)
void multiplane_scrape_preview_draw(const uint gpuattr, const Brush &brush, const SculptSession &ss, const float outline_col[3], const float outline_alpha)
static void paint_cursor_drawing_setup_cursor_space(PaintCursorContext *pcontext)
static void paint_cursor_setup_2D_drawing(PaintCursorContext *pcontext)
bool paint_brush_tool_poll(bContext *C)
static void paint_cursor_draw_3D_view_brush_cursor(PaintCursorContext *pcontext)
static void paint_cursor_update_anchored_location(PaintCursorContext *pcontext)
static bool paint_draw_cursor_overlay(UnifiedPaintSettings *ups, Brush *brush, ViewContext *vc, int x, int y, float zoom)
void geometry_preview_lines_update(Depsgraph &depsgraph, Object &object, SculptSession &ss, float radius)
static bool paint_cursor_is_brush_cursor_enabled(PaintCursorContext *pcontext)
Span< float3 > vert_positions_for_grab_active_get(const Depsgraph &depsgraph, const Object &object)
VecBase< float, 4 > float4
VecBase< float, 2 > float2
VecBase< float, 3 > float3
vector snap(vector a, vector b)
static ePaintOverlayControlFlags overlay_flags
void paint_cursor_delete_textures()
static CursorSnapshot cursor_snap
static TexSnapshot primary_snap
static TexSnapshot secondary_snap
void ED_paint_cursor_start(Paint *paint, bool(*poll)(bContext *C))
bool get_imapaint_zoom(bContext *C, float *zoomx, float *zoomy)
float paint_calc_object_space_radius(const ViewContext &vc, const blender::float3 ¢er, float pixel_radius)
#define PAINT_CURVE_NUM_SEGMENTS
bool paint_get_tex_pixel(const MTex *mtex, float u, float v, ImagePool *pool, int thread, float *r_intensity, float r_rgba[4])
bool SCULPT_stroke_is_first_brush_step_of_symmetry_pass(const blender::ed::sculpt_paint::StrokeCache &cache)
ePaintSymmetryFlags SCULPT_mesh_symmetry_xyz_get(const Object &object)
bool SCULPT_cursor_geometry_info_update(bContext *C, SculptCursorGeometryInfo *out, const float mval[2], bool use_sampled_normal)
void SCULPT_vertex_random_access_ensure(Object &object)
int texture_overlay_alpha
float stencil_dimension[2]
struct CurveMapping * curve
float texture_sample_bias
float mask_stencil_pos[2]
struct BrushGpencilSettings * gpencil_settings
float mask_stencil_dimension[2]
int cloth_simulation_area_type
struct PaintCurve * paint_curve
int cloth_force_falloff_type
GPUTexture * overlay_texture
GreasePencilRuntimeHandle * runtime
ImBufFloatBuffer float_buffer
ImBufByteBuffer byte_buffer
struct SculptSession * sculpt
unsigned char paint_cursor_col[4]
struct ToolSettings * toolsettings
blender::ed::sculpt_paint::StrokeCache * cache
std::unique_ptr< SculptBoundaryPreview > boundary_preview
blender::Array< int > preview_verts
ActiveVert active_vert() const
blender::float3 active_vert_position(const Depsgraph &depsgraph, const Object &object) const
std::unique_ptr< SculptPoseIKChainPreview > pose_ik_chain_preview
blender::ed::sculpt_paint::expand::Cache * expand_cache
int active_vert_index() const
bool deform_modifiers_active
blender::Array< blender::float3 > positions
GPUTexture * overlay_texture
struct bNodeTree * nodetree
float anchored_initial_mouse[2]
float size_pressure_value
bNodeTreeRuntimeHandle * runtime
VecBase< T, 3 > xyz() const
UnifiedPaintSettings * ups
float scene_space_location[3]
PaintCursorDrawingType cursor_type
int prev_active_vert_index
void WM_cursor_set(wmWindow *win, int curs)
wmPaintCursor * WM_paint_cursor_activate(short space_type, short region_type, bool(*poll)(bContext *C), wmPaintCursorDraw draw, void *customdata)
void wmViewport(const rcti *winrct)
void wmWindowViewport(const wmWindow *win)