Blender
V3.3
|
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_dial_2d.h"
#include "BLI_ghash.h"
#include "BLI_gsqueue.h"
#include "BLI_hash.h"
#include "BLI_math.h"
#include "BLI_math_color.h"
#include "BLI_math_color_blend.h"
#include "BLI_task.h"
#include "BLI_utildefines.h"
#include "BLT_translation.h"
#include "PIL_time.h"
#include "DNA_brush_types.h"
#include "DNA_customdata_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_node_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BKE_attribute.h"
#include "BKE_brush.h"
#include "BKE_ccg.h"
#include "BKE_colortools.h"
#include "BKE_context.h"
#include "BKE_image.h"
#include "BKE_kelvinlet.h"
#include "BKE_key.h"
#include "BKE_lib_id.h"
#include "BKE_main.h"
#include "BKE_mesh.h"
#include "BKE_mesh_mapping.h"
#include "BKE_mesh_mirror.h"
#include "BKE_modifier.h"
#include "BKE_multires.h"
#include "BKE_node.h"
#include "BKE_object.h"
#include "BKE_paint.h"
#include "BKE_particle.h"
#include "BKE_pbvh.h"
#include "BKE_pointcache.h"
#include "BKE_report.h"
#include "BKE_scene.h"
#include "BKE_screen.h"
#include "BKE_subdiv_ccg.h"
#include "BKE_subsurf.h"
#include "NOD_texture.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_paint.h"
#include "ED_screen.h"
#include "ED_sculpt.h"
#include "ED_view3d.h"
#include "paint_intern.h"
#include "sculpt_intern.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "bmesh.h"
#include "bmesh_tools.h"
#include <math.h>
#include <stdlib.h>
#include <string.h>
Go to the source code of this file.
Classes | |
struct | NearestVertexTLSData |
struct | AreaNormalCenterTLSData |
struct | SculptRaycastData |
struct | SculptFindNearestToRayData |
struct | NearestVertexFakeNeighborTLSData |
struct | SculptTopologyIDFloodFillData |
Macros | |
#define | PIXEL_INPUT_THRESHHOLD 5 |
Generic Brush Utilities | |
#define | SCULPT_TILT_SENSITIVITY 0.7f |
static float | brush_strength (const Sculpt *sd, const StrokeCache *cache, const float feather, const UnifiedPaintSettings *ups, const PaintModeSettings *UNUSED(paint_mode_settings)) |
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_search_sphere_cb (PBVHNode *node, void *data_v) |
bool | SCULPT_search_circle_cb (PBVHNode *node, void *data_v) |
void | SCULPT_clip (Sculpt *sd, SculptSession *ss, float co[3], const float val[3]) |
static PBVHNode ** | sculpt_pbvh_gather_cursor_update (Object *ob, Sculpt *sd, bool use_original, int *r_totnode) |
static PBVHNode ** | sculpt_pbvh_gather_generic (Object *ob, Sculpt *sd, const Brush *brush, bool use_original, float radius_scale, int *r_totnode) |
static void | calc_sculpt_normal (Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode, float r_area_no[3]) |
static void | update_sculpt_normal (Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode) |
static void | calc_local_y (ViewContext *vc, const float center[3], float y[3]) |
static void | calc_brush_local_mat (const Brush *brush, Object *ob, float local_mat[4][4]) |
void | SCULPT_tilt_apply_to_normal (float r_normal[3], StrokeCache *cache, const float tilt_strength) |
void | SCULPT_tilt_effective_normal_get (const SculptSession *ss, const Brush *brush, float r_no[3]) |
static void | update_brush_local_mat (Sculpt *sd, Object *ob) |
Sculpt Init/Update | |
enum | StrokeFlags { CLIP_X = 1 , CLIP_Y = 2 , CLIP_Z = 4 } |
typedef enum StrokeFlags | StrokeFlags |
void | SCULPT_orig_vert_data_unode_init (SculptOrigVertData *data, Object *ob, SculptUndoNode *unode) |
void | SCULPT_orig_vert_data_init (SculptOrigVertData *data, Object *ob, PBVHNode *node, SculptUndoType type) |
void | SCULPT_orig_vert_data_update (SculptOrigVertData *orig_data, PBVHVertexIter *iter) |
static void | sculpt_rake_data_update (struct SculptRakeData *srd, const float co[3]) |
Calculate Normal and Center | |
Calculate geometry surrounding the brush center. (optionally using original coordinates). Functions are:
| |
typedef struct AreaNormalCenterTLSData | AreaNormalCenterTLSData |
static void | calc_area_normal_and_center_task_cb (void *__restrict userdata, const int n, const TaskParallelTLS *__restrict tls) |
static void | calc_area_normal_and_center_reduce (const void *__restrict UNUSED(userdata), void *__restrict chunk_join, void *__restrict chunk) |
void | SCULPT_calc_area_center (Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode, float r_area_co[3]) |
void | SCULPT_calc_area_normal (Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode, float r_area_no[3]) |
bool | SCULPT_pbvh_calc_area_normal (const Brush *brush, Object *ob, PBVHNode **nodes, int totnode, bool use_threading, float r_area_no[3]) |
void | SCULPT_calc_area_normal_and_center (Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode, float r_area_no[3], float r_area_co[3]) |
#define PIXEL_INPUT_THRESHHOLD 5 |
typedef struct AreaNormalCenterTLSData AreaNormalCenterTLSData |
typedef void(* BrushActionFunc) (Sculpt *sd, Object *ob, Brush *brush, UnifiedPaintSettings *ups, PaintModeSettings *paint_mode_settings) |
typedef struct NearestVertexFakeNeighborTLSData NearestVertexFakeNeighborTLSData |
typedef struct NearestVertexTLSData NearestVertexTLSData |
typedef struct SculptTopologyIDFloodFillData SculptTopologyIDFloodFillData |
typedef enum StrokeFlags StrokeFlags |
anonymous enum |
enum StrokeFlags |
|
static |
Return modified brush strength. Includes the direction of the brush, positive values pull vertices, negative values push. Uses tablet pressure and a special multiplier found experimentally to scale the strength factor.
Definition at line 2219 of file sculpt.c.
References BKE_brush_alpha_get(), BKE_brush_use_alpha_pressure(), BKE_paint_brush(), BLI_assert_msg, BRUSH_CLOTH_DEFORM_EXPAND, BRUSH_CLOTH_DEFORM_GRAB, BRUSH_CLOTH_DEFORM_SNAKE_HOOK, BRUSH_DIR_IN, BRUSH_INVERT_TO_SCRAPE_FILL, BRUSH_MASK_DRAW, BRUSH_MASK_SMOOTH, Brush::cloth_deform_type, Brush::flag, invert(), StrokeCache::invert, Brush::mask_tool, UnifiedPaintSettings::overlap_factor, Sculpt::paint, StrokeCache::pen_flip, pow4f(), powf, StrokeCache::pressure, scene, ViewContext::scene, Brush::sculpt_tool, SCULPT_TOOL_BLOB, SCULPT_TOOL_BOUNDARY, SCULPT_TOOL_CLAY, SCULPT_TOOL_CLAY_STRIPS, SCULPT_TOOL_CLAY_THUMB, SCULPT_TOOL_CLOTH, SCULPT_TOOL_CREASE, SCULPT_TOOL_DISPLACEMENT_ERASER, SCULPT_TOOL_DISPLACEMENT_SMEAR, SCULPT_TOOL_DRAW, SCULPT_TOOL_DRAW_FACE_SETS, SCULPT_TOOL_DRAW_SHARP, SCULPT_TOOL_ELASTIC_DEFORM, SCULPT_TOOL_FILL, SCULPT_TOOL_FLATTEN, SCULPT_TOOL_GRAB, SCULPT_TOOL_INFLATE, SCULPT_TOOL_LAYER, SCULPT_TOOL_MASK, SCULPT_TOOL_MULTIPLANE_SCRAPE, SCULPT_TOOL_NUDGE, SCULPT_TOOL_PAINT, SCULPT_TOOL_PINCH, SCULPT_TOOL_POSE, SCULPT_TOOL_ROTATE, SCULPT_TOOL_SCRAPE, SCULPT_TOOL_SLIDE_RELAX, SCULPT_TOOL_SMEAR, SCULPT_TOOL_SMOOTH, SCULPT_TOOL_SNAKE_HOOK, SCULPT_TOOL_THUMB, and StrokeCache::vc.
Referenced by do_symmetrical_brush_actions(), do_vpaint_brush_blur_loops(), do_vpaint_brush_blur_verts(), do_vpaint_brush_smear(), do_wpaint_brush_blur_task_cb_ex(), do_wpaint_brush_draw_task_cb_ex(), do_wpaint_brush_smear_task_cb_ex(), blender::ed::sculpt_paint::paint::image::PaintingKernel< ImageBuffer >::paint(), and vpaint_do_draw().
|
static |
Definition at line 2034 of file sculpt.c.
References add_v2_v2_int(), add_v3_v3(), AreaNormalCenterTLSData::area_cos, AreaNormalCenterTLSData::area_nos, AreaNormalCenterTLSData::count_co, and AreaNormalCenterTLSData::count_no.
Referenced by SCULPT_calc_area_center(), SCULPT_calc_area_normal_and_center(), and SCULPT_pbvh_calc_area_normal().
|
static |
Definition at line 1845 of file sculpt.c.
References add_v3_v3(), add_v3_v3v3(), AreaNormalCenterTLSData::area_cos, AreaNormalCenterTLSData::area_nos, BKE_pbvh_node_get_bm_orco_data(), BKE_pbvh_vertex_iter_begin, BKE_pbvh_vertex_iter_end, SculptUndoNode::bm_entry, SculptSession::bm_log, BM_log_original_vert_data(), PBVHVertexIter::bm_vert, BRUSH_AREA_RADIUS_PRESSURE, SculptSession::cache, clamp_f(), closest_on_tri_to_point_v3(), PBVHVertexIter::co, SculptUndoNode::co, copy_v3_v3(), AreaNormalCenterTLSData::count_co, AreaNormalCenterTLSData::count_no, SculptSession::cursor_view_normal, data, SculptBrushTest::dist, dot_v3v3(), ELEM, float(), PBVHVertexIter::fno, PBVHVertexIter::i, SculptBrushTest::location, mul_v3_fl(), PBVHVertexIter::no, SculptUndoNode::no, normal_tri_v3(), NULL, OB_MODE_SCULPT, StrokeCache::original, SculptSession::pbvh, PBVH_ITER_UNIQUE, StrokeCache::pressure, SculptBrushTest::radius, SculptBrushTest::radius_squared, SCULPT_brush_test_init_with_falloff_shape(), SCULPT_TOOL_FILL, SCULPT_TOOL_SCRAPE, SCULPT_UNDO_COORDS, SCULPT_undo_push_node(), sqrtf, sub_v3_v3v3(), UNPACK3, and StrokeCache::view_normal.
Referenced by SCULPT_calc_area_center(), SCULPT_calc_area_normal_and_center(), and SCULPT_pbvh_calc_area_normal().
Definition at line 2707 of file sculpt.c.
References angle(), SculptSession::cache, calc_local_y(), copy_v3_v3(), cross_v3_v3v3(), Object::imat, invert_m4_m4(), StrokeCache::location, Brush::mtex, mul_m4_m4m4(), normalize_m4(), Object::obmat, StrokeCache::radius, MTex::rot, rotate_v3_v3v3fl(), scale_m4_fl(), Object::sculpt, StrokeCache::sculpt_normal, StrokeCache::special_rotation, v, and StrokeCache::vc.
Referenced by update_brush_local_mat().
|
static |
Definition at line 2691 of file sculpt.c.
References add_v3_v3(), center, ED_view3d_calc_zfac(), ED_view3d_win_to_delta(), Object::imat, Object::loc, mul_m4_v3(), mul_v3_m4v3(), normalize_v3(), ViewContext::obact, ViewContext::region, ViewContext::rv3d, and y.
Referenced by calc_brush_local_mat().
|
static |
Definition at line 1762 of file sculpt.c.
References angle(), axis_angle_to_mat3_single(), flip_v3_v3(), len_squared_v3v3(), mul_m3_v3(), StrokeCache::radius, StrokeCache::radius_squared, sqrtf, and StrokeCache::true_location.
Referenced by calc_radial_symmetry_feather(), and calc_symmetry_feather().
|
static |
Definition at line 1783 of file sculpt.c.
References angle(), calc_overlap(), M_PI, and Sculpt::radial_symm.
Referenced by calc_symmetry_feather().
|
static |
Definition at line 2632 of file sculpt.c.
References ARRAY_SET_ITEMS, BKE_paint_brush(), SculptSession::cache, copy_v3_v3(), Sculpt::paint, Object::sculpt, SCULPT_calc_area_normal(), SCULPT_DISP_DIR_AREA, SCULPT_DISP_DIR_VIEW, SCULPT_DISP_DIR_X, SCULPT_DISP_DIR_Y, SCULPT_DISP_DIR_Z, Brush::sculpt_plane, and StrokeCache::true_view_normal.
Referenced by update_sculpt_normal().
|
static |
Definition at line 1798 of file sculpt.c.
References calc_overlap(), calc_radial_symmetry_feather(), Sculpt::paint, PAINT_SYMMETRY_FEATHER, SCULPT_is_symmetry_iteration_valid(), StrokeCache::symmetry, and Paint::symmetry_flags.
Referenced by do_symmetrical_brush_actions().
|
static |
Definition at line 3245 of file sculpt.c.
References add_v3_v3(), StrokeCache::alt_smooth, StrokeCache::automasking, Brush::autosmooth_factor, UnifiedPaintSettings::average_stroke_accum, UnifiedPaintSettings::average_stroke_counter, BKE_pbvh_ensure_node_loops(), BKE_pbvh_parallel_range_settings(), BKE_pbvh_search_gather(), BKE_pbvh_type(), BLI_assert, BLI_task_parallel_range(), BRUSH_ANCHORED, BRUSH_DEFORM_TARGET_CLOTH_SIM, BRUSH_DIR_IN, BRUSH_INVERSE_SMOOTH_PRESSURE, BRUSH_INVERT_TO_SCRAPE_FILL, MTex::brush_map_mode, BRUSH_ORIGINAL_NORMAL, BRUSH_SMOOTH_DEFORM_LAPLACIAN, BRUSH_SMOOTH_DEFORM_SURFACE, SculptSession::cache, StrokeCache::cloth_sim, copy_v3_v3(), Brush::deform_target, do_brush_action_task_cb(), do_gravity(), ELEM, Brush::falloff_shape, Brush::flag, Sculpt::gravity_factor, invert(), StrokeCache::invert, UnifiedPaintSettings::last_stroke_valid, StrokeCache::location, M_SQRT2, MEM_callocN, MEM_SAFE_FREE, Brush::mtex, MTEX_MAP_MODE_AREA, mul_m4_v3(), NULL, Object::obmat, StrokeCache::original, StrokeCache::paint_face_set, PAINT_FALLOFF_SHAPE_SPHERE, SculptSession::pbvh, PBVH_BMESH, PBVH_FACES, StrokeCache::pen_flip, StrokeCache::pressure, Object::sculpt, SCULPT_active_face_set_get(), SCULPT_automasking_cache_init(), SCULPT_bmesh_topology_rake(), sculpt_brush_needs_normal(), sculpt_brush_use_topology_rake(), SCULPT_cloth_brush_affected_nodes_gather(), SCULPT_cloth_brush_do_simulation_step(), SCULPT_cloth_brush_ensure_nodes_constraints(), SCULPT_cloth_brush_simulation_create(), SCULPT_cloth_brush_simulation_init(), SCULPT_cloth_brush_store_simulation_state(), SCULPT_cloth_sim_activate_nodes(), SCULPT_do_boundary_brush(), SCULPT_do_clay_brush(), SCULPT_do_clay_strips_brush(), SCULPT_do_clay_thumb_brush(), SCULPT_do_cloth_brush(), SCULPT_do_crease_brush(), SCULPT_do_displacement_eraser_brush(), SCULPT_do_displacement_smear_brush(), SCULPT_do_draw_brush(), SCULPT_do_draw_face_sets_brush(), SCULPT_do_draw_sharp_brush(), SCULPT_do_elastic_deform_brush(), SCULPT_do_fill_brush(), SCULPT_do_flatten_brush(), SCULPT_do_grab_brush(), SCULPT_do_inflate_brush(), SCULPT_do_layer_brush(), SCULPT_do_mask_brush(), SCULPT_do_multiplane_scrape_brush(), SCULPT_do_nudge_brush(), SCULPT_do_paint_brush(), SCULPT_do_pinch_brush(), SCULPT_do_pose_brush(), SCULPT_do_rotate_brush(), SCULPT_do_scrape_brush(), SCULPT_do_slide_relax_brush(), SCULPT_do_smear_brush(), SCULPT_do_smooth_brush(), SCULPT_do_snake_hook_brush(), SCULPT_do_surface_smooth_brush(), SCULPT_do_thumb_brush(), SCULPT_face_set_next_available_get(), SCULPT_has_loop_colors(), SCULPT_is_automasking_enabled(), sculpt_needs_pbvh_pixels(), sculpt_pbvh_gather_generic(), sculpt_pbvh_update_pixels(), SCULPT_pose_brush_init(), SCULPT_smooth(), SCULPT_stroke_is_first_brush_step(), SCULPT_stroke_is_main_symmetry_pass(), Brush::sculpt_tool, SCULPT_TOOL_BLOB, SCULPT_TOOL_BOUNDARY, SCULPT_TOOL_CLAY, SCULPT_TOOL_CLAY_STRIPS, SCULPT_TOOL_CLAY_THUMB, SCULPT_TOOL_CLOTH, SCULPT_TOOL_CREASE, SCULPT_TOOL_DISPLACEMENT_ERASER, SCULPT_TOOL_DISPLACEMENT_SMEAR, SCULPT_TOOL_DRAW, SCULPT_TOOL_DRAW_FACE_SETS, SCULPT_TOOL_DRAW_SHARP, SCULPT_TOOL_ELASTIC_DEFORM, SCULPT_TOOL_FILL, SCULPT_TOOL_FLATTEN, SCULPT_TOOL_GRAB, sculpt_tool_has_cube_tip(), SCULPT_TOOL_INFLATE, SCULPT_tool_is_paint(), SCULPT_TOOL_LAYER, SCULPT_TOOL_MASK, SCULPT_TOOL_MULTIPLANE_SCRAPE, SCULPT_tool_needs_all_pbvh_nodes(), sculpt_tool_needs_original(), SCULPT_TOOL_NUDGE, SCULPT_TOOL_PAINT, SCULPT_TOOL_PINCH, SCULPT_TOOL_POSE, SCULPT_TOOL_ROTATE, SCULPT_TOOL_SCRAPE, SCULPT_TOOL_SLIDE_RELAX, SCULPT_TOOL_SMEAR, SCULPT_TOOL_SMOOTH, SCULPT_TOOL_SNAKE_HOOK, SCULPT_TOOL_THUMB, SCULPT_UNDO_FACE_SETS, SCULPT_undo_push_node(), SCULPT_vertex_count_get(), SculptThreadedTaskData::sd, Brush::smooth_deform_type, StrokeCache::supports_gravity, StrokeCache::surface_smooth_laplacian_disp, Brush::topology_rake_factor, StrokeCache::true_location, type, update_brush_local_mat(), and update_sculpt_normal().
Referenced by sculpt_stroke_update_step().
|
static |
Definition at line 3210 of file sculpt.c.
References StrokeCache::alt_smooth, BKE_pbvh_node_mark_redraw(), BKE_pbvh_node_mark_update(), BKE_pbvh_node_mark_update_color(), BKE_pbvh_node_mark_update_mask(), SculptSession::cache, data, SCULPT_TOOL_DRAW_FACE_SETS, SCULPT_tool_is_paint(), SCULPT_TOOL_MASK, SCULPT_UNDO_COLOR, SCULPT_UNDO_COORDS, SCULPT_UNDO_MASK, SCULPT_undo_push_node(), and StrokeCache::supports_gravity.
Referenced by do_brush_action().
|
static |
Definition at line 5718 of file sculpt.c.
References BKE_pbvh_vertex_iter_begin, BKE_pbvh_vertex_iter_end, PBVHVertexIter::co, NearestVertexFakeNeighborTLSData::current_topology_id, data, blender::math::distance_squared(), SculptFakeNeighbors::fake_neighbor_index, FAKE_NEIGHBOR_NONE, SculptSession::fake_neighbors, PBVHVertexIter::index, len_squared_v3v3(), NearestVertexFakeNeighborTLSData::nearest_vertex_distance_squared, NearestVertexFakeNeighborTLSData::nearest_vertex_index, SculptSession::pbvh, PBVH_ITER_UNIQUE, and SCULPT_vertex_get_connected_component().
Referenced by SCULPT_fake_neighbor_search().
|
static |
Definition at line 3063 of file sculpt.c.
References BKE_paint_brush(), BKE_pbvh_parallel_range_settings(), BLI_task_parallel_range(), SculptSession::cache, data, do_gravity_task_cb_ex(), StrokeCache::gravity_direction, mul_v3_fl(), mul_v3_v3fl(), mul_v3_v3v3(), offset, Sculpt::paint, StrokeCache::radius_squared, StrokeCache::scale, and Object::sculpt.
Referenced by blo_do_versions_250(), and do_brush_action().
|
static |
Definition at line 3021 of file sculpt.c.
References BKE_pbvh_node_add_proxy(), BKE_pbvh_vert_tag_update_normal(), BKE_pbvh_vertex_iter_begin, BKE_pbvh_vertex_iter_end, BLI_task_parallel_thread_id(), PBVHProxyNode::co, PBVHVertexIter::co, data, SculptBrushTest::dist, fade(), float(), PBVHVertexIter::fno, PBVHVertexIter::i, PBVHVertexIter::index, PBVHVertexIter::mask, mul_v3_v3fl(), PBVHVertexIter::mvert, PBVHVertexIter::no, offset, SculptSession::pbvh, PBVH_ITER_UNIQUE, SCULPT_brush_strength_factor(), SCULPT_brush_test_init_with_falloff_shape(), sqrtf, and blender::threading::enumerable_thread_specific_utils::thread_id.
Referenced by do_gravity().
|
static |
Definition at line 947 of file sculpt.c.
References BKE_pbvh_vertex_iter_begin, BKE_pbvh_vertex_iter_end, PBVHVertexIter::co, data, blender::math::distance_squared(), PBVHVertexIter::index, len_squared_v3v3(), NearestVertexTLSData::nearest_vertex_distance_squared, NearestVertexTLSData::nearest_vertex_index, SculptSession::pbvh, and PBVH_ITER_UNIQUE.
Referenced by SCULPT_nearest_vertex_get().
|
static |
Definition at line 3888 of file sculpt.c.
References angle(), SculptSession::cache, do_tiled(), M_PI, Sculpt::radial_symm, StrokeCache::radial_symmetry_pass, Object::sculpt, and SCULPT_cache_calc_brushdata_symm().
Referenced by do_symmetrical_brush_actions().
|
static |
Definition at line 3923 of file sculpt.c.
References BKE_paint_brush(), brush_strength(), StrokeCache::bstrength, SculptSession::cache, calc_symmetry_feather(), do_radial_symmetry(), do_tiled(), StrokeCache::mirror_symmetry_pass, Sculpt::paint, StrokeCache::radial_symmetry_pass, Object::sculpt, SCULPT_cache_calc_brushdata_symm(), SCULPT_is_symmetry_iteration_valid(), SCULPT_mesh_symmetry_xyz_get(), and StrokeCache::symmetry.
Referenced by sculpt_stroke_update_step().
|
static |
Definition at line 3824 of file sculpt.c.
References BKE_object_boundbox_get(), SculptSession::cache, copy_v3_v3(), copy_v3_v3_int(), StrokeCache::initial_location, StrokeCache::location, Sculpt::paint, PAINT_TILE_X, StrokeCache::plane_offset, StrokeCache::radius, Object::sculpt, Paint::symmetry_flags, Paint::tile_offset, StrokeCache::tile_pass, and BoundBox::vec.
Referenced by do_radial_symmetry(), and do_symmetrical_brush_actions().
Definition at line 1508 of file sculpt.c.
References BKE_pbvh_update_bounds(), SculptSession::cache, StrokeCache::current_r, paint_calc_redraw_planes(), SculptSession::pbvh, PBVH_UpdateRedraw, StrokeCache::previous_r, Object::sculpt, and sculpt_extend_redraw_rect_previous().
|
static |
Definition at line 5742 of file sculpt.c.
References NearestVertexFakeNeighborTLSData::nearest_vertex_distance_squared, and NearestVertexFakeNeighborTLSData::nearest_vertex_index.
Referenced by SCULPT_fake_neighbor_search().
|
static |
Definition at line 1713 of file sculpt.c.
References BRUSH_FRONTFACE, blender::math::dot(), dot_v3v3(), and Brush::flag.
Referenced by SCULPT_brush_strength_factor().
|
static |
Definition at line 967 of file sculpt.c.
References NearestVertexTLSData::nearest_vertex_distance_squared, and NearestVertexTLSData::nearest_vertex_index.
Referenced by SCULPT_nearest_vertex_get().
|
static |
Definition at line 5297 of file sculpt.c.
References C, and SCULPT_stroke_get_location().
Referenced by sculpt_brush_stroke_invoke(), and sculpt_stroke_test_start().
Disable multi-threading when dynamic-topology is enabled. Otherwise, new entries might be inserted by SCULPT_undo_push_node() into the GHash used internally by BM_log_original_vert_co() by a different thread. See T33787.
Definition at line 1435 of file sculpt.c.
References BKE_paint_brush(), BKE_pbvh_node_color_buffer_free(), BKE_pbvh_parallel_range_settings(), BKE_pbvh_search_gather(), BLI_task_parallel_range(), SculptSession::bm, data, MEM_SAFE_FREE, NULL, Sculpt::paint, paint_mesh_restore_co_task_cb(), SculptSession::pbvh, and Object::sculpt.
Referenced by sculpt_brush_stroke_cancel(), and sculpt_restore_mesh().
|
static |
Definition at line 1357 of file sculpt.c.
References BKE_pbvh_node_mark_update(), BKE_pbvh_node_mark_update_color(), BKE_pbvh_node_mark_update_mask(), BKE_pbvh_vert_tag_update_normal(), BKE_pbvh_vertex_iter_begin, BKE_pbvh_vertex_iter_end, SculptSession::bm, PBVHVertexIter::co, SculptOrigVertData::co, SculptOrigVertData::col, copy_v3_v3(), data, PBVHVertexIter::fno, PBVHVertexIter::index, PBVHVertexIter::mask, SculptOrigVertData::mask, PBVHVertexIter::mvert, PBVHVertexIter::no, SculptOrigVertData::no, SculptSession::pbvh, PBVH_ITER_UNIQUE, SCULPT_orig_vert_data_unode_init(), SCULPT_orig_vert_data_update(), SCULPT_TOOL_MASK, SCULPT_TOOL_PAINT, SCULPT_TOOL_SMEAR, SCULPT_UNDO_COLOR, SCULPT_UNDO_COORDS, SCULPT_undo_get_node(), SCULPT_UNDO_MASK, SCULPT_undo_push_node(), SCULPT_vertex_color_set(), SculptUndoNode::type, type, and SculptOrigVertData::unode.
Referenced by paint_mesh_restore_co().
int SCULPT_active_face_set_get | ( | SculptSession * | ss | ) |
Definition at line 325 of file sculpt.c.
References SculptSession::active_face_index, SculptSession::active_grid_index, BKE_pbvh_type(), BKE_subdiv_ccg_grid_to_face_index(), SculptSession::face_sets, SculptSession::pbvh, PBVH_BMESH, PBVH_FACES, PBVH_GRIDS, SCULPT_FACE_SET_NONE, and SculptSession::subdiv_ccg.
Referenced by do_brush_action(), ED_sculpt_face_sets_active_update_and_get(), pose_ik_chain_init_face_sets_fk(), SCULPT_automasking_cache_settings_update(), sculpt_cloth_filter_invoke(), sculpt_expand_set_initial_components_for_mouse(), sculpt_face_set_edit_invoke(), sculpt_face_sets_automasking_init(), and sculpt_face_sets_change_visibility_exec().
const float* SCULPT_active_vertex_co_get | ( | SculptSession * | ss | ) |
Definition at line 279 of file sculpt.c.
References SCULPT_active_vertex_get(), and SCULPT_vertex_co_get().
Referenced by paint_cursor_draw_3d_view_brush_cursor_inactive(), pose_ik_chain_init_face_sets(), sample_detail_voxel(), sculpt_cloth_filter_invoke(), SCULPT_cursor_geometry_info_update(), SCULPT_do_boundary_brush(), sculpt_face_sets_change_visibility_exec(), SCULPT_floodfill_add_active(), SCULPT_geometry_preview_lines_update(), sculpt_mask_expand_invoke(), sculpt_set_pivot_position_exec(), and SCULPT_topology_automasking_init().
int SCULPT_active_vertex_get | ( | SculptSession * | ss | ) |
Definition at line 271 of file sculpt.c.
References SculptSession::active_vertex_index, BKE_pbvh_type(), ELEM, SculptSession::pbvh, PBVH_BMESH, PBVH_FACES, and PBVH_GRIDS.
Referenced by dyntopo_detail_size_sample_from_surface(), paint_cursor_draw_3d_view_brush_cursor_inactive(), pose_ik_chain_init_face_sets(), pose_ik_chain_init_face_sets_fk(), sample_detail_voxel(), SCULPT_active_vertex_co_get(), SCULPT_active_vertex_normal_get(), SCULPT_do_boundary_brush(), sculpt_expand_set_initial_components_for_mouse(), sculpt_expand_target_vertex_update_and_get(), sculpt_expand_task_cb(), SCULPT_floodfill_add_active(), SCULPT_geometry_preview_lines_update(), sculpt_mask_by_color_invoke(), sculpt_mask_expand_invoke(), sculpt_mask_expand_modal(), sculpt_sample_color_invoke(), and sculpt_update_brush_delta().
void SCULPT_active_vertex_normal_get | ( | SculptSession * | ss, |
float | normal[3] | ||
) |
Definition at line 284 of file sculpt.c.
References normal, SCULPT_active_vertex_get(), and SCULPT_vertex_normal_get().
Referenced by sculpt_mask_expand_invoke().
Definition at line 5848 of file sculpt.c.
References BKE_mesh_from_object(), BLI_BITMAP_NEW, BLI_BITMAP_SET, SculptVertexInfo::boundary, e, MLoop::e, l, MPoly::loopstart, Mesh::medge, MEM_calloc_arrayN, MEM_freeN, Mesh::mloop, Mesh::mpoly, Mesh::totedge, MPoly::totloop, Mesh::totpoly, Mesh::totvert, and SculptSession::vertex_info.
Referenced by SCULPT_automasking_cache_init(), SCULPT_boundary_data_init(), SCULPT_do_draw_face_sets_brush(), SCULPT_do_slide_relax_brush(), SCULPT_enhance_details_brush(), sculpt_expand_ensure_sculptsession_data(), sculpt_face_set_edit_fair_face_set(), sculpt_mesh_filter_invoke(), and SCULPT_smooth().
float* SCULPT_brush_deform_target_vertex_co_get | ( | SculptSession * | ss, |
int | deform_target, | ||
PBVHVertexIter * | iter | ||
) |
Returns the pointer to the coordinates that should be edited from a brush tool iterator depending on the given deformation target.
Definition at line 304 of file sculpt.c.
References BRUSH_DEFORM_TARGET_CLOTH_SIM, BRUSH_DEFORM_TARGET_GEOMETRY, SculptSession::cache, StrokeCache::cloth_sim, PBVHVertexIter::co, SculptClothSimulation::deformation_pos, and PBVHVertexIter::index.
Referenced by do_boundary_brush_bend_task_cb_ex(), do_boundary_brush_grab_task_cb_ex(), do_boundary_brush_inflate_task_cb_ex(), do_boundary_brush_slide_task_cb_ex(), do_boundary_brush_smooth_task_cb_ex(), do_boundary_brush_twist_task_cb_ex(), and do_pose_brush_task_cb_ex().
|
static |
Definition at line 4328 of file sculpt.c.
References max_ff(), pow3f(), powf, StrokeCache::pressure, SCULPT_clay_thumb_get_stabilized_pressure(), Brush::sculpt_tool, SCULPT_TOOL_CLAY, SCULPT_TOOL_CLAY_STRIPS, and SCULPT_TOOL_CLAY_THUMB.
Referenced by sculpt_update_cache_variants().
Definition at line 5444 of file sculpt.c.
References BKE_paint_brush(), bNodeTree::execdata, Brush::mtex, Tex::nodetree, ntreeTexEndExecTree(), Sculpt::paint, and MTex::tex.
Referenced by sculpt_brush_stroke_cancel(), and sculpt_stroke_done().
const float* SCULPT_brush_frontface_normal_from_falloff_shape | ( | SculptSession * | ss, |
char | falloff_shape | ||
) |
Definition at line 1703 of file sculpt.c.
References SculptSession::cache, PAINT_FALLOFF_SHAPE_SPHERE, StrokeCache::sculpt_normal_symm, and StrokeCache::view_normal.
Referenced by do_vpaint_brush_blur_loops(), do_vpaint_brush_blur_verts(), do_vpaint_brush_smear(), do_wpaint_brush_blur_task_cb_ex(), do_wpaint_brush_calc_average_weight_cb_ex(), do_wpaint_brush_draw_task_cb_ex(), do_wpaint_brush_smear_task_cb_ex(), and vpaint_do_draw().
|
static |
Definition at line 5046 of file sculpt.c.
References BKE_image_pool_new(), BKE_paint_brush(), Brush::mtex, Tex::nodetree, ntreeTexBeginExecTree(), NULL, Sculpt::paint, MTex::tex, and SculptSession::tex_pool.
Referenced by sculpt_brush_stroke_init().
|
static |
Test whether the StrokeCache.sculpt_normal needs update in do_brush_action
Definition at line 1233 of file sculpt.c.
References MTex::brush_map_mode, SculptSession::cache, ELEM, Brush::mtex, MTEX_MAP_MODE_AREA, StrokeCache::normal_weight, sculpt_brush_use_topology_rake(), Brush::sculpt_tool, SCULPT_TOOL_BLOB, SCULPT_TOOL_CLOTH, SCULPT_TOOL_CREASE, SCULPT_TOOL_DRAW, SCULPT_TOOL_DRAW_SHARP, SCULPT_TOOL_ELASTIC_DEFORM, SCULPT_TOOL_HAS_NORMAL_WEIGHT, SCULPT_TOOL_LAYER, SCULPT_TOOL_NUDGE, SCULPT_TOOL_ROTATE, and SCULPT_TOOL_THUMB.
Referenced by do_brush_action().
Definition at line 1254 of file sculpt.c.
References Brush::rake_factor, Brush::sculpt_tool, and SCULPT_TOOL_HAS_RAKE.
Referenced by sculpt_update_brush_delta().
float SCULPT_brush_plane_offset_get | ( | Sculpt * | sd, |
SculptSession * | ss | ||
) |
Definition at line 3002 of file sculpt.c.
References BKE_paint_brush(), BRUSH_OFFSET_PRESSURE, SculptSession::cache, Brush::flag, Sculpt::paint, Brush::plane_offset, and StrokeCache::pressure.
Referenced by SCULPT_do_clay_brush(), SCULPT_do_clay_strips_brush(), SCULPT_do_clay_thumb_brush(), SCULPT_do_fill_brush(), SCULPT_do_flatten_brush(), SCULPT_do_multiplane_scrape_brush(), and SCULPT_do_scrape_brush().
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 | ||
) |
Definition at line 2370 of file sculpt.c.
References StrokeCache::automasking, BKE_brush_curve_strength(), BKE_brush_sample_tex_3d(), StrokeCache::brush_local_mat, MTex::brush_map_mode, SculptSession::cache, ED_view3d_project_float_v2_m4(), flip_v3_v3(), frontface(), StrokeCache::hardness, len, mask(), StrokeCache::mirror_symmetry_pass, Brush::mtex, MTEX_MAP_MODE_3D, MTEX_MAP_MODE_AREA, mul_m4_v3(), MTex::ofs, StrokeCache::paint_brush, paint_get_tex_pixel(), StrokeCache::plane_offset, point, StrokeCache::projection_mat, StrokeCache::radial_symmetry_pass, StrokeCache::radius, ViewContext::region, usdtokens::rgba(), scene, ViewContext::scene, SCULPT_automasking_factor_get(), MTex::size, sub_v3_v3v3(), StrokeCache::symm_rot_mat_inv, MTex::tex, SculptSession::tex_pool, Brush::texture_sample_bias, blender::threading::enumerable_thread_specific_utils::thread_id, StrokeCache::vc, StrokeCache::view_normal, x, and y.
Referenced by calc_multiplane_scrape_surface_task_cb(), do_clay_brush_task_cb_ex(), do_clay_strips_brush_task_cb_ex(), do_clay_thumb_brush_task_cb_ex(), do_cloth_brush_apply_forces_task_cb_ex(), do_color_smooth_task_cb_exec(), do_crease_brush_task_cb_ex(), do_displacement_eraser_brush_task_cb_ex(), do_displacement_smear_brush_task_cb_ex(), do_draw_brush_task_cb_ex(), do_draw_face_sets_brush_task_cb_ex(), do_draw_sharp_brush_task_cb_ex(), do_enhance_details_brush_task_cb_ex(), do_fill_brush_task_cb_ex(), do_flatten_brush_task_cb_ex(), do_grab_brush_task_cb_ex(), do_gravity_task_cb_ex(), do_inflate_brush_task_cb_ex(), do_layer_brush_task_cb_ex(), do_mask_brush_draw_task_cb_ex(), do_multiplane_scrape_brush_task_cb_ex(), do_nudge_brush_task_cb_ex(), do_paint_brush_task_cb_ex(), do_pinch_brush_task_cb_ex(), do_relax_face_sets_brush_task_cb_ex(), do_rotate_brush_task_cb_ex(), do_scrape_brush_task_cb_ex(), do_smear_brush_task_cb_exec(), do_smooth_brush_task_cb_ex(), do_snake_hook_brush_task_cb_ex(), do_thumb_brush_task_cb_ex(), do_topology_rake_bmesh_task_cb_ex(), do_topology_relax_task_cb_ex(), do_topology_slide_task_cb_ex(), blender::ed::sculpt_paint::paint::image::PaintingKernel< ImageBuffer >::paint(), SCULPT_do_surface_smooth_brush_displace_task_cb_ex(), and SCULPT_do_surface_smooth_brush_laplacian_task_cb_ex().
|
static |
Definition at line 5596 of file sculpt.c.
References BKE_paint_brush(), PaintStroke::brush, C, SculptSession::cache, CTX_data_active_object(), CTX_data_tool_settings(), wmOperator::customdata, NULL, Sculpt::paint, paint_mesh_restore_co(), paint_stroke_cancel(), Object::sculpt, ToolSettings::sculpt, sculpt_brush_exit_tex(), SCULPT_cache_free(), and SCULPT_stroke_is_dynamic_topology().
Referenced by SCULPT_OT_brush_stroke().
|
static |
Definition at line 5577 of file sculpt.c.
References C, wmOperator::customdata, NULL, OPERATOR_FINISHED, paint_stroke_exec(), paint_stroke_new(), sculpt_brush_stroke_init(), sculpt_stroke_done(), SCULPT_stroke_get_location(), sculpt_stroke_test_start(), and sculpt_stroke_update_step().
Referenced by SCULPT_OT_brush_stroke().
|
static |
Definition at line 5062 of file sculpt.c.
References BKE_paint_brush(), BKE_sculpt_color_layer_create_if_needed(), BKE_sculpt_update_object_for_edit(), BRUSH_DEFORM_TARGET_CLOTH_SIM, C, CTX_data_active_object(), CTX_data_ensure_evaluated_depsgraph(), CTX_data_tool_settings(), Brush::deform_target, depsgraph, ED_paint_tool_update_sticky_shading_color(), Sculpt::paint, ToolSettings::paint_mode, wmOperator::ptr, RNA_enum_get(), Object::sculpt, ToolSettings::sculpt, sculpt_brush_init_tex(), sculpt_needs_connectivity_info(), Brush::sculpt_tool, SCULPT_TOOL_CLOTH, SCULPT_tool_is_paint(), SCULPT_TOOL_MASK, SCULPT_use_image_paint_brush(), and view3d_operator_needs_opengl().
Referenced by sculpt_brush_stroke_exec(), and sculpt_brush_stroke_invoke().
|
static |
Definition at line 5515 of file sculpt.c.
References BKE_paint_brush(), BLI_assert, PaintStroke::brush, C, CTX_data_active_object(), CTX_data_tool_settings(), wmOperator::customdata, wmOperatorType::modal, wmEvent::mval, NULL, OB_HIDE_VIEWPORT, OPERATOR_CANCELLED, OPERATOR_FINISHED, OPERATOR_PASS_THROUGH, OPERATOR_RETVAL_CHECK, OPERATOR_RUNNING_MODAL, over_mesh(), Sculpt::paint, paint_stroke_free(), paint_stroke_new(), wmOperator::ptr, wmOperator::reports, RNA_boolean_get(), Object::sculpt, ToolSettings::sculpt, sculpt_brush_stroke_init(), SCULPT_handles_colors_report(), sculpt_stroke_done(), SCULPT_stroke_get_location(), sculpt_stroke_test_start(), sculpt_stroke_update_step(), Brush::sculpt_tool, SCULPT_tool_is_paint(), wmOperator::type, wmEvent::type, UNPACK2, Object::visibility_flag, and WM_event_add_modal_handler().
Referenced by SCULPT_OT_brush_stroke().
|
static |
Definition at line 5619 of file sculpt.c.
References C, wmOperator::customdata, and paint_stroke_modal().
Referenced by SCULPT_OT_brush_stroke().
bool SCULPT_brush_test_circle_sq | ( | SculptBrushTest * | test, |
const float | co[3] | ||
) |
Definition at line 1621 of file sculpt.c.
References closest_to_plane_normalized_v3(), SculptBrushTest::dist, len_squared_v3v3(), SculptBrushTest::location, SculptBrushTest::plane_view, SculptBrushTest::radius_squared, and sculpt_brush_test_clipping().
Referenced by SCULPT_brush_test_init_with_falloff_shape().
BLI_INLINE bool sculpt_brush_test_clipping | ( | const SculptBrushTest * | test, |
const float | co[3] | ||
) |
Definition at line 1569 of file sculpt.c.
References SculptBrushTest::clip_rv3d, ED_view3d_clipping_test(), flip_v3_v3(), SculptBrushTest::mirror_symmetry_pass, mul_m4_v3(), SculptBrushTest::radial_symmetry_pass, and SculptBrushTest::symm_rot_mat_inv.
Referenced by SCULPT_brush_test_circle_sq(), SCULPT_brush_test_cube(), SCULPT_brush_test_sphere(), SCULPT_brush_test_sphere_fast(), and SCULPT_brush_test_sphere_sq().
bool SCULPT_brush_test_cube | ( | SculptBrushTest * | test, |
const float | co[3], | ||
const float | local[4][4], | ||
const float | roundness | ||
) |
Definition at line 1639 of file sculpt.c.
References copy_v3_fl(), SculptBrushTest::dist, fabsf, len_v2v2(), max_ff(), min_ff(), mul_v3_m4v3(), and sculpt_brush_test_clipping().
Referenced by do_clay_strips_brush_task_cb_ex(), and do_paint_brush_task_cb_ex().
void SCULPT_brush_test_init | ( | struct SculptSession * | ss, |
SculptBrushTest * | test | ||
) |
Initialize a point-in-brush test
Definition at line 1532 of file sculpt.c.
References SculptSession::cache, SculptBrushTest::clip_rv3d, copy_m4_m4(), copy_v3_v3(), SculptSession::cursor_location, SculptSession::cursor_radius, SculptBrushTest::dist, SculptBrushTest::location, StrokeCache::location, SculptBrushTest::mirror_symmetry_pass, StrokeCache::mirror_symmetry_pass, NULL, SculptBrushTest::plane_tool, SculptBrushTest::plane_view, SculptBrushTest::radial_symmetry_pass, StrokeCache::radial_symmetry_pass, SculptBrushTest::radius, SculptBrushTest::radius_squared, StrokeCache::radius_squared, SculptSession::rv3d, ViewContext::rv3d, RV3D_CLIPPING_ENABLED, sqrtf, SculptBrushTest::symm_rot_mat_inv, StrokeCache::symm_rot_mat_inv, unit_m4(), SculptSession::v3d, ViewContext::v3d, StrokeCache::vc, and zero_v4().
Referenced by do_clay_strips_brush_task_cb_ex(), blender::ed::sculpt_paint::paint::image::init_triangle_brush_test(), and SCULPT_brush_test_init_with_falloff_shape().
SculptBrushTestFn SCULPT_brush_test_init_with_falloff_shape | ( | SculptSession * | ss, |
SculptBrushTest * | test, | ||
char | falloff_shape | ||
) |
Initialize a point-in-brush test with a given falloff shape.
falloff_shape | PAINT_FALLOFF_SHAPE_SPHERE or PAINT_FALLOFF_SHAPE_TUBE. |
Definition at line 1686 of file sculpt.c.
References SculptSession::cache, SculptBrushTest::location, PAINT_FALLOFF_SHAPE_SPHERE, plane_from_point_normal_v3(), SculptBrushTest::plane_view, SCULPT_brush_test_circle_sq(), SCULPT_brush_test_init(), SCULPT_brush_test_sphere_sq(), and StrokeCache::view_normal.
Referenced by calc_area_normal_and_center_task_cb(), calc_clay_surface_task_cb(), calc_multiplane_scrape_surface_task_cb(), calculate_average_color(), do_clay_brush_task_cb_ex(), do_clay_thumb_brush_task_cb_ex(), do_cloth_brush_apply_forces_task_cb_ex(), do_color_smooth_task_cb_exec(), do_crease_brush_task_cb_ex(), do_displacement_eraser_brush_task_cb_ex(), do_displacement_smear_brush_task_cb_ex(), do_draw_brush_task_cb_ex(), do_draw_face_sets_brush_task_cb_ex(), do_draw_sharp_brush_task_cb_ex(), do_enhance_details_brush_task_cb_ex(), do_fill_brush_task_cb_ex(), do_flatten_brush_task_cb_ex(), do_grab_brush_task_cb_ex(), do_gravity_task_cb_ex(), do_inflate_brush_task_cb_ex(), do_layer_brush_task_cb_ex(), do_mask_brush_draw_task_cb_ex(), do_multiplane_scrape_brush_task_cb_ex(), do_nudge_brush_task_cb_ex(), do_paint_brush_task_cb_ex(), do_pinch_brush_task_cb_ex(), do_relax_face_sets_brush_task_cb_ex(), do_rotate_brush_task_cb_ex(), do_sample_wet_paint_task_cb(), do_scrape_brush_task_cb_ex(), do_smear_brush_task_cb_exec(), do_smooth_brush_task_cb_ex(), do_snake_hook_brush_task_cb_ex(), do_thumb_brush_task_cb_ex(), do_topology_rake_bmesh_task_cb_ex(), do_topology_relax_task_cb_ex(), do_topology_slide_task_cb_ex(), do_vpaint_brush_blur_loops(), do_vpaint_brush_blur_verts(), do_vpaint_brush_smear(), do_wpaint_brush_blur_task_cb_ex(), do_wpaint_brush_calc_average_weight_cb_ex(), do_wpaint_brush_draw_task_cb_ex(), do_wpaint_brush_smear_task_cb_ex(), SCULPT_do_surface_smooth_brush_displace_task_cb_ex(), SCULPT_do_surface_smooth_brush_laplacian_task_cb_ex(), and vpaint_do_draw().
bool SCULPT_brush_test_sphere | ( | SculptBrushTest * | test, |
const float | co[3] | ||
) |
Definition at line 1583 of file sculpt.c.
References SculptBrushTest::dist, len_squared_v3v3(), SculptBrushTest::location, SculptBrushTest::radius_squared, sculpt_brush_test_clipping(), and sqrtf.
bool SCULPT_brush_test_sphere_fast | ( | const SculptBrushTest * | test, |
const float | co[3] | ||
) |
Definition at line 1613 of file sculpt.c.
References len_squared_v3v3(), SculptBrushTest::location, SculptBrushTest::radius_squared, and sculpt_brush_test_clipping().
bool SCULPT_brush_test_sphere_sq | ( | SculptBrushTest * | test, |
const float | co[3] | ||
) |
Definition at line 1599 of file sculpt.c.
References SculptBrushTest::dist, len_squared_v3v3(), SculptBrushTest::location, SculptBrushTest::radius_squared, and sculpt_brush_test_clipping().
Referenced by SCULPT_brush_test_init_with_falloff_shape().
|
static |
Definition at line 1224 of file sculpt.c.
References SculptSession::bm, NULL, Brush::sculpt_tool, SCULPT_TOOL_HAS_TOPOLOGY_RAKE, and Brush::topology_rake_factor.
Referenced by do_brush_action(), sculpt_brush_needs_normal(), and sculpt_update_brush_delta().
void SCULPT_cache_calc_brushdata_symm | ( | StrokeCache * | cache, |
char | symm, | ||
char | axis, | ||
float | angle | ||
) |
Flip all the edit-data across the axis/axes specified by symm. Used to calculate multiple modifications to the mesh when symmetry is enabled.
Definition at line 3767 of file sculpt.c.
References angle(), flip_qt_qt(), flip_v3_v3(), CCL_NAMESPACE_BEGIN::frac(), StrokeCache::grab_delta, StrokeCache::grab_delta_symmetry, StrokeCache::gravity_direction, StrokeCache::initial_location, StrokeCache::initial_normal, StrokeCache::is_rake_rotation_valid, StrokeCache::last_location, StrokeCache::location, mul_m4_v3(), mul_v3_fl(), Sculpt::paint, PAINT_SYMMETRY_FEATHER, StrokeCache::plane_offset, StrokeCache::rake_rotation, StrokeCache::rake_rotation_symmetry, rotate_m4(), StrokeCache::supports_gravity, StrokeCache::symm_rot_mat, StrokeCache::symm_rot_mat_inv, Paint::symmetry_flags, StrokeCache::true_gravity_direction, StrokeCache::true_initial_location, StrokeCache::true_initial_normal, StrokeCache::true_last_location, StrokeCache::true_location, StrokeCache::true_view_normal, unit_m4(), StrokeCache::view_normal, and zero_v3().
Referenced by do_radial_symmetry(), do_symmetrical_brush_actions(), vpaint_do_paint(), vpaint_do_symmetrical_brush_actions(), wpaint_do_paint(), and wpaint_do_symmetrical_brush_actions().
void SCULPT_cache_free | ( | StrokeCache * | cache | ) |
Definition at line 4055 of file sculpt.c.
References StrokeCache::boundaries, StrokeCache::cloth_sim, StrokeCache::detail_directions, StrokeCache::dial, StrokeCache::layer_displacement_factor, StrokeCache::limit_surface_co, MEM_freeN, MEM_SAFE_FREE, PAINT_SYMM_AREAS, StrokeCache::pose_ik_chain, StrokeCache::prev_colors, StrokeCache::prev_colors_vpaint, StrokeCache::prev_displacement, SCULPT_boundary_data_free(), SCULPT_cloth_simulation_free(), SCULPT_pose_ik_chain_free(), and StrokeCache::surface_smooth_laplacian_disp.
Referenced by ed_vwpaintmode_enter_generic(), ed_vwpaintmode_exit_generic(), sculpt_brush_stroke_cancel(), sculpt_stroke_done(), vpaint_cancel(), vpaint_stroke_done(), wpaint_cancel(), and wpaint_stroke_done().
void SCULPT_calc_area_center | ( | Sculpt * | sd, |
Object * | ob, | ||
PBVHNode ** | nodes, | ||
int | totnode, | ||
float | r_area_co[3] | ||
) |
Definition at line 2054 of file sculpt.c.
References AreaNormalCenterTLSData::area_cos, ARRAY_SIZE, BKE_paint_brush(), BKE_pbvh_parallel_range_settings(), BLI_task_parallel_range(), SculptSession::bm, SculptSession::cache, calc_area_normal_and_center_reduce(), calc_area_normal_and_center_task_cb(), copy_v3_v3(), AreaNormalCenterTLSData::count_co, data, TaskParallelSettings::func_reduce, StrokeCache::location, mul_v3_v3fl(), NULL, Sculpt::paint, Object::sculpt, SCULPT_stroke_is_dynamic_topology(), TaskParallelSettings::userdata_chunk, TaskParallelSettings::userdata_chunk_size, and zero_v3().
Referenced by calc_sculpt_plane(), and SCULPT_calc_brush_plane().
void SCULPT_calc_area_normal | ( | Sculpt * | sd, |
Object * | ob, | ||
PBVHNode ** | nodes, | ||
int | totnode, | ||
float | r_area_no[3] | ||
) |
Definition at line 2103 of file sculpt.c.
References BKE_paint_brush(), Sculpt::paint, and SCULPT_pbvh_calc_area_normal().
Referenced by calc_sculpt_normal(), SCULPT_do_clay_strips_brush(), SCULPT_do_clay_thumb_brush(), SCULPT_do_multiplane_scrape_brush(), and SCULPT_do_paint_brush().
void SCULPT_calc_area_normal_and_center | ( | Sculpt * | sd, |
Object * | ob, | ||
PBVHNode ** | nodes, | ||
int | totnode, | ||
float | r_area_no[3], | ||
float | r_area_co[3] | ||
) |
This calculates flatten center and area normal together, amortizing the memory bandwidth and loop overhead to calculate both at the same time.
Definition at line 2151 of file sculpt.c.
References AreaNormalCenterTLSData::area_cos, AreaNormalCenterTLSData::area_nos, ARRAY_SIZE, BKE_paint_brush(), BKE_pbvh_parallel_range_settings(), BLI_task_parallel_range(), SculptSession::bm, SculptSession::cache, calc_area_normal_and_center_reduce(), calc_area_normal_and_center_task_cb(), copy_v3_v3(), AreaNormalCenterTLSData::count_co, data, TaskParallelSettings::func_reduce, StrokeCache::location, mul_v3_v3fl(), normalize_v3_v3(), NULL, Sculpt::paint, Object::sculpt, SCULPT_stroke_is_dynamic_topology(), TaskParallelSettings::userdata_chunk, TaskParallelSettings::userdata_chunk_size, and zero_v3().
Referenced by calc_sculpt_plane(), and SCULPT_calc_brush_plane().
void SCULPT_calc_brush_plane | ( | Sculpt * | sd, |
Object * | ob, | ||
PBVHNode ** | nodes, | ||
int | totnode, | ||
float | r_area_no[3], | ||
float | r_area_co[3] | ||
) |
Definition at line 2901 of file sculpt.c.
References add_v3_v3(), ARRAY_SET_ITEMS, BKE_paint_brush(), BRUSH_ORIGINAL_NORMAL, BRUSH_ORIGINAL_PLANE, SculptSession::cache, copy_v3_v3(), Brush::falloff_shape, Brush::flag, flip_v3(), StrokeCache::last_center, StrokeCache::mirror_symmetry_pass, mul_m4_v3(), normalize_v3(), Sculpt::paint, PAINT_FALLOFF_SHAPE_TUBE, StrokeCache::plane_offset, project_plane_v3_v3v3(), Object::sculpt, SCULPT_calc_area_center(), SCULPT_calc_area_normal_and_center(), SCULPT_DISP_DIR_AREA, SCULPT_DISP_DIR_VIEW, SCULPT_DISP_DIR_X, SCULPT_DISP_DIR_Y, SCULPT_DISP_DIR_Z, StrokeCache::sculpt_normal, Brush::sculpt_plane, SCULPT_stroke_is_first_brush_step_of_symmetry_pass(), SCULPT_stroke_is_main_symmetry_pass(), StrokeCache::symm_rot_mat, StrokeCache::true_view_normal, StrokeCache::view_normal, and zero_v3().
Referenced by cloth_brush_apply_brush_foces(), SCULPT_do_clay_brush(), SCULPT_do_clay_strips_brush(), SCULPT_do_clay_thumb_brush(), SCULPT_do_fill_brush(), SCULPT_do_flatten_brush(), SCULPT_do_multiplane_scrape_brush(), and SCULPT_do_scrape_brush().
|
static |
Definition at line 859 of file sculpt.c.
References BLI_assert, BLI_BITMAP_TEST, SculptVertexInfo::boundary, and SculptSession::vertex_info.
Referenced by SCULPT_vertex_is_boundary().
|
static |
Checks if the face sets of the adjacent faces to the edge between v1 and v2 in the base mesh are equal.
Definition at line 634 of file sculpt.c.
References blender::math::abs(), MeshElemMap::count, SculptSession::face_sets, MeshElemMap::indices, l, MPoly::loopstart, SculptSession::mloop, SculptSession::mpoly, SculptSession::pmap, MPoly::totloop, MLoop::v, v1, and v2.
Referenced by SCULPT_vertex_has_unique_face_set().
|
static |
Definition at line 613 of file sculpt.c.
References blender::math::abs(), MeshElemMap::count, SculptSession::face_sets, MeshElemMap::indices, and SculptSession::pmap.
Referenced by SCULPT_vertex_has_unique_face_set().
Definition at line 923 of file sculpt.c.
Referenced by do_boundary_brush_bend_task_cb_ex(), do_boundary_brush_grab_task_cb_ex(), do_boundary_brush_inflate_task_cb_ex(), do_boundary_brush_slide_task_cb_ex(), do_boundary_brush_smooth_task_cb_ex(), do_boundary_brush_twist_task_cb_ex(), pose_brush_grow_factor_task_cb_ex(), pose_face_sets_floodfill_cb(), pose_topology_floodfill_cb(), sculpt_expand_reposition_pivot(), sculpt_mask_expand_modal(), and sculpt_set_pivot_position_exec().
void SCULPT_clip | ( | Sculpt * | sd, |
SculptSession * | ss, | ||
float | co[3], | ||
const float | val[3] | ||
) |
Handles clipping against a mirror modifier and SCULPT_LOCK_X/Y/Z axis flags.
Definition at line 2540 of file sculpt.c.
References SculptSession::cache, StrokeCache::clip_mirror_mtx, StrokeCache::clip_tolerance, CLIP_X, fabsf, StrokeCache::flag, Sculpt::flags, invert_m4_m4(), mul_m4_v3(), mul_v3_m4v3(), and SCULPT_LOCK_X.
Referenced by do_enhance_details_brush_task_cb_ex(), do_layer_brush_task_cb_ex(), do_smooth_brush_task_cb_ex(), do_topology_rake_bmesh_task_cb_ex(), and sculpt_combine_proxies_task_cb().
Definition at line 3609 of file sculpt.c.
References BKE_paint_brush(), BKE_pbvh_gather_proxies(), BKE_pbvh_parallel_range_settings(), BLI_task_parallel_range(), SculptSession::cache, data, ELEM, MEM_SAFE_FREE, Sculpt::paint, SculptSession::pbvh, Object::sculpt, sculpt_combine_proxies_task_cb(), Brush::sculpt_tool, SCULPT_TOOL_BOUNDARY, SCULPT_TOOL_ELASTIC_DEFORM, SCULPT_TOOL_GRAB, sculpt_tool_is_proxy_used(), SCULPT_TOOL_POSE, SCULPT_TOOL_ROTATE, SCULPT_TOOL_THUMB, and StrokeCache::supports_gravity.
Referenced by sculpt_stroke_update_step().
|
static |
Definition at line 3558 of file sculpt.c.
References add_v3_v3(), BKE_pbvh_node_free_proxies(), BKE_pbvh_node_get_proxies(), BKE_pbvh_vertex_iter_begin, BKE_pbvh_vertex_iter_end, SculptSession::bm, SculptSession::bm_log, BM_log_original_vert_co(), PBVHVertexIter::bm_vert, PBVHVertexIter::co, SculptUndoNode::co, copy_v3_v3(), data, SculptSession::deform_modifiers_active, float(), PBVHVertexIter::i, NULL, SculptSession::pbvh, PBVH_ITER_UNIQUE, SCULPT_clip(), sculpt_flush_pbvhvert_deform(), SCULPT_UNDO_COORDS, and SCULPT_undo_push_node().
Referenced by sculpt_combine_proxies(), and SCULPT_combine_transform_proxies().
Definition at line 3646 of file sculpt.c.
References BKE_pbvh_gather_proxies(), BKE_pbvh_parallel_range_settings(), BLI_task_parallel_range(), data, MEM_SAFE_FREE, SculptSession::pbvh, Object::sculpt, and sculpt_combine_proxies_task_cb().
Referenced by sculpt_transform_radius_elastic().
Definition at line 5815 of file sculpt.c.
References SculptVertexInfo::connected_component, data, MEM_malloc_arrayN, blender::threading::enumerable_thread_specific_utils::next_id, Object::sculpt, SCULPT_connected_components_floodfill_cb(), SCULPT_floodfill_add_initial(), SCULPT_floodfill_execute(), SCULPT_floodfill_free(), SCULPT_floodfill_init(), SCULPT_TOPOLOGY_ID_NONE, SCULPT_vertex_count_get(), and SculptSession::vertex_info.
Referenced by sculpt_expand_ensure_sculptsession_data(), SCULPT_fake_neighbors_ensure(), and sculpt_mask_init_exec().
|
static |
Definition at line 5806 of file sculpt.c.
References SculptVertexInfo::connected_component, data, and SculptSession::vertex_info.
Referenced by SCULPT_connected_components_ensure().
bool SCULPT_cursor_geometry_info_update | ( | bContext * | C, |
SculptCursorGeometryInfo * | out, | ||
const float | mouse[2], | ||
bool | use_sampled_normal | ||
) |
Gets the normal, location and active vertex location of the geometry under the cursor. This also updates the active vertex and cursor related data of the SculptSession using the mouse position
Definition at line 4835 of file sculpt.c.
References SculptRaycastData::active_face_grid_index, SculptSession::active_face_index, SculptSession::active_grid_index, SculptSession::active_vertex_index, SculptRaycastData::active_vertex_index, add_v3_v3(), BKE_brush_size_get(), BKE_brush_unprojected_radius_get(), BKE_brush_use_locked_size(), BKE_paint_brush(), BKE_paint_get_active_from_context(), BKE_pbvh_raycast(), BKE_pbvh_type(), C, copy_m3_m4(), copy_v3_v3(), CTX_data_depsgraph_pointer(), CTX_data_scene(), SculptSession::cursor_location, SculptSession::cursor_normal, SculptSession::cursor_radius, SculptSession::cursor_sampled_normal, SculptSession::cursor_view_normal, depsgraph, SculptRaycastData::depth, ED_view3d_viewcontext_init(), SculptRaycastData::face_normal, SculptRaycastData::hit, Object::imat, invert_m4_m4(), SculptRaycastData::isect_precalc, isect_ray_tri_watertight_v3_precalc(), MEM_SAFE_FREE, mul_m3_v3(), mul_v3_fl(), normalize_v3_v3(), ViewContext::obact, Object::obmat, SculptRaycastData::original, usdtokens::out(), paint_calc_object_space_radius(), SculptSession::pbvh, PBVH_BMESH, PBVH_FACES, PBVH_GRIDS, SculptSession::rv3d, ViewContext::rv3d, scene, Object::sculpt, ToolSettings::sculpt, SCULPT_active_vertex_co_get(), SCULPT_pbvh_calc_area_normal(), sculpt_pbvh_gather_cursor_update(), sculpt_raycast_cb(), SCULPT_raycast_init(), SCULPT_stroke_modifiers_check(), SCULPT_vertex_random_access_ensure(), Scene::toolsettings, SculptSession::v3d, ViewContext::v3d, RegionView3D::viewinv, and zero_v3().
Referenced by ED_sculpt_face_sets_active_update_and_get(), paint_cursor_sculpt_session_update_and_init(), sample_detail_voxel(), sculpt_cloth_filter_invoke(), sculpt_color_filter_invoke(), sculpt_expand_target_vertex_update_and_get(), sculpt_face_set_edit_invoke(), sculpt_face_sets_change_visibility_invoke(), sculpt_mask_by_color_invoke(), sculpt_mask_expand_invoke(), sculpt_mask_expand_modal(), sculpt_mesh_filter_invoke(), sculpt_stroke_test_start(), sculpt_trim_gesture_box_invoke(), and sculpt_trim_gesture_lasso_invoke().
Definition at line 1468 of file sculpt.c.
References BLI_rcti_is_empty(), BLI_rcti_union(), SculptSession::cache, StrokeCache::previous_r, and Object::sculpt.
Referenced by ED_sculpt_redraw_planes_get(), and SCULPT_flush_update_step().
int SCULPT_face_set_next_available_get | ( | SculptSession * | ss | ) |
Definition at line 693 of file sculpt.c.
References blender::math::abs(), BKE_pbvh_type(), SculptSession::face_sets, SculptSession::pbvh, PBVH_BMESH, PBVH_FACES, PBVH_GRIDS, and SculptSession::totfaces.
Referenced by do_brush_action(), sculpt_face_set_create_exec(), sculpt_init_session(), and sculpt_mask_expand_invoke().
void SCULPT_face_set_visibility_set | ( | SculptSession * | ss, |
int | face_set, | ||
bool | visible | ||
) |
Definition at line 376 of file sculpt.c.
References blender::math::abs(), BKE_pbvh_type(), SculptSession::face_sets, SculptSession::pbvh, PBVH_BMESH, PBVH_FACES, PBVH_GRIDS, and SculptSession::totfaces.
Referenced by sculpt_face_sets_change_visibility_exec().
void SCULPT_face_sets_visibility_all_set | ( | SculptSession * | ss, |
bool | visible | ||
) |
Definition at line 412 of file sculpt.c.
References blender::math::abs(), BKE_pbvh_type(), SculptSession::face_sets, SculptSession::pbvh, PBVH_BMESH, PBVH_FACES, PBVH_GRIDS, SCULPT_FACE_SET_NONE, and SculptSession::totfaces.
Referenced by sculpt_face_sets_change_visibility_exec().
void SCULPT_face_sets_visibility_invert | ( | SculptSession * | ss | ) |
Definition at line 398 of file sculpt.c.
References BKE_pbvh_type(), SculptSession::face_sets, SculptSession::pbvh, PBVH_BMESH, PBVH_FACES, PBVH_GRIDS, and SculptSession::totfaces.
Referenced by sculpt_face_sets_change_visibility_exec().
|
static |
Definition at line 5699 of file sculpt.c.
References SculptFakeNeighbors::fake_neighbor_index, FAKE_NEIGHBOR_NONE, and SculptSession::fake_neighbors.
Referenced by SCULPT_fake_neighbors_ensure().
|
static |
Definition at line 5687 of file sculpt.c.
References SculptFakeNeighbors::current_max_distance, SculptFakeNeighbors::fake_neighbor_index, FAKE_NEIGHBOR_NONE, SculptSession::fake_neighbors, MEM_malloc_arrayN, and SCULPT_vertex_count_get().
Referenced by SCULPT_fake_neighbors_ensure().
|
static |
Definition at line 5758 of file sculpt.c.
References BKE_pbvh_parallel_range_settings(), BKE_pbvh_search_gather(), BLI_task_parallel_range(), copy_v3_v3(), NearestVertexFakeNeighborTLSData::current_topology_id, data, do_fake_neighbor_search_task_cb(), fake_neighbor_search_reduce(), TaskParallelSettings::func_reduce, MEM_SAFE_FREE, NearestVertexFakeNeighborTLSData::nearest_vertex_distance_squared, NearestVertexFakeNeighborTLSData::nearest_vertex_index, SculptThreadedTaskData::nearest_vertex_search_co, NULL, SculptSession::pbvh, Object::sculpt, SCULPT_search_sphere_cb(), SCULPT_vertex_co_get(), SCULPT_vertex_get_connected_component(), SculptThreadedTaskData::sd, TaskParallelSettings::userdata_chunk, and TaskParallelSettings::userdata_chunk_size.
Referenced by SCULPT_fake_neighbors_ensure().
Definition at line 5916 of file sculpt.c.
References BLI_assert, SculptFakeNeighbors::fake_neighbor_index, SculptSession::fake_neighbors, NULL, Object::sculpt, and SculptFakeNeighbors::use_fake_neighbors.
Referenced by SCULPT_pose_ik_chain_init().
Definition at line 5909 of file sculpt.c.
References BLI_assert, SculptFakeNeighbors::fake_neighbor_index, SculptSession::fake_neighbors, NULL, Object::sculpt, and SculptFakeNeighbors::use_fake_neighbors.
Referenced by SCULPT_pose_ik_chain_init().
Definition at line 5879 of file sculpt.c.
References SculptFakeNeighbors::current_max_distance, SculptFakeNeighbors::fake_neighbor_index, FAKE_NEIGHBOR_NONE, SculptSession::fake_neighbors, Object::sculpt, SCULPT_connected_components_ensure(), SCULPT_fake_neighbor_add(), SCULPT_fake_neighbor_init(), SCULPT_fake_neighbor_search(), and SCULPT_vertex_count_get().
Referenced by SCULPT_pose_ik_chain_init().
Definition at line 5923 of file sculpt.c.
References Object::sculpt, and sculpt_pose_fake_neighbors_free().
Referenced by SCULPT_flush_update_done().
Definition at line 4764 of file sculpt.c.
References BKE_pbvh_node_find_nearest_to_ray(), BKE_pbvh_node_get_tmin(), BKE_pbvh_type(), SculptSession::cache, SculptUndoNode::co, SculptFindNearestToRayData::depth, SculptFindNearestToRayData::dist_sq_to_ray, float(), SculptFindNearestToRayData::hit, node, NULL, SculptFindNearestToRayData::original, SculptSession::pbvh, PBVH_BMESH, SculptFindNearestToRayData::ray_normal, SculptFindNearestToRayData::ray_start, SCULPT_UNDO_COORDS, SCULPT_undo_get_node(), and SculptFindNearestToRayData::ss.
Referenced by SCULPT_stroke_get_location().
Noise texture gives different values for the same input coord; this can tear a multi-resolution mesh during sculpting so do a stitch in this case.
Definition at line 3912 of file sculpt.c.
References SculptSession::active, BKE_paint_brush(), Brush::mtex, SculptSession::multires, multires_stitch_grids(), Sculpt::paint, Object::sculpt, MTex::tex, TEX_NOISE, and Tex::type.
Referenced by sculpt_stroke_update_step().
void SCULPT_flip_quat_by_symm_area | ( | float | quat[4], |
const ePaintSymmetryFlags | symm, | ||
const ePaintSymmetryAreas | symmarea, | ||
const float | pivot[3] | ||
) |
Definition at line 2882 of file sculpt.c.
References flip_qt().
Referenced by SCULPT_do_pose_brush(), and sculpt_transform_matrices_init().
void SCULPT_flip_v3_by_symm_area | ( | float | v[3], |
const ePaintSymmetryFlags | symm, | ||
const ePaintSymmetryAreas | symmarea, | ||
const float | pivot[3] | ||
) |
Definition at line 2863 of file sculpt.c.
Referenced by SCULPT_do_pose_brush(), sculpt_pose_align_pivot_local_space(), and sculpt_transform_matrices_init().
void SCULPT_floodfill_add_active | ( | Sculpt * | sd, |
Object * | ob, | ||
SculptSession * | ss, | ||
SculptFloodFill * | flood, | ||
float | radius | ||
) |
Definition at line 1118 of file sculpt.c.
References flip_v3_v3(), SCULPT_active_vertex_co_get(), SCULPT_active_vertex_get(), SCULPT_floodfill_add_initial(), SCULPT_is_symmetry_iteration_valid(), SCULPT_mesh_symmetry_xyz_get(), SCULPT_nearest_vertex_get(), and v.
Referenced by pose_ik_chain_init_face_sets_fk(), sculpt_mask_expand_invoke(), SCULPT_pose_calc_pose_data(), and SCULPT_topology_automasking_init().
void SCULPT_floodfill_add_and_skip_initial | ( | SculptFloodFill * | flood, |
int | index | ||
) |
Definition at line 1086 of file sculpt.c.
References BLI_BITMAP_ENABLE, BLI_gsqueue_push(), SculptFloodFill::queue, and SculptFloodFill::visited_vertices.
Referenced by sculpt_expand_topology_from_state_boundary().
void SCULPT_floodfill_add_initial | ( | SculptFloodFill * | flood, |
int | index | ||
) |
Definition at line 1081 of file sculpt.c.
References BLI_gsqueue_push(), and SculptFloodFill::queue.
Referenced by pose_ik_chain_init_face_sets_fk(), sculpt_boundary_get_closest_boundary_vertex(), sculpt_boundary_indices_init(), SCULPT_connected_components_ensure(), SCULPT_floodfill_add_active(), SCULPT_floodfill_add_initial_with_symmetry(), and sculpt_mask_by_color_contiguous().
void SCULPT_floodfill_add_initial_with_symmetry | ( | Sculpt * | sd, |
Object * | ob, | ||
SculptSession * | ss, | ||
SculptFloodFill * | flood, | ||
int | index, | ||
float | radius | ||
) |
Definition at line 1092 of file sculpt.c.
References flip_v3_v3(), SCULPT_floodfill_add_initial(), SCULPT_is_symmetry_iteration_valid(), SCULPT_mesh_symmetry_xyz_get(), SCULPT_nearest_vertex_get(), SCULPT_vertex_co_get(), and v.
Referenced by pose_ik_chain_init_face_sets(), sculpt_expand_normal_falloff_create(), and sculpt_expand_topology_falloff_create().
void SCULPT_floodfill_execute | ( | SculptSession * | ss, |
SculptFloodFill * | flood, | ||
bool(*)(SculptSession *ss, int from_v, int to_v, bool is_duplicate, void *userdata) | func, | ||
void * | userdata | ||
) |
Definition at line 1143 of file sculpt.c.
References BLI_BITMAP_ENABLE, BLI_BITMAP_TEST, BLI_gsqueue_is_empty(), BLI_gsqueue_pop(), BLI_gsqueue_push(), SculptVertexNeighborIter::index, SculptVertexNeighborIter::is_duplicate, SculptFloodFill::queue, SCULPT_VERTEX_DUPLICATES_AND_NEIGHBORS_ITER_BEGIN, SCULPT_VERTEX_NEIGHBORS_ITER_END, SCULPT_vertex_visible_get(), and SculptFloodFill::visited_vertices.
Referenced by pose_ik_chain_init_face_sets(), pose_ik_chain_init_face_sets_fk(), sculpt_boundary_get_closest_boundary_vertex(), sculpt_boundary_indices_init(), SCULPT_connected_components_ensure(), sculpt_expand_normal_falloff_create(), sculpt_expand_topology_falloff_create(), sculpt_expand_topology_from_state_boundary(), sculpt_mask_by_color_contiguous(), sculpt_mask_expand_invoke(), SCULPT_pose_calc_pose_data(), and SCULPT_topology_automasking_init().
void SCULPT_floodfill_free | ( | SculptFloodFill * | flood | ) |
Definition at line 1174 of file sculpt.c.
References BLI_gsqueue_free(), MEM_SAFE_FREE, NULL, SculptFloodFill::queue, and SculptFloodFill::visited_vertices.
Referenced by pose_ik_chain_init_face_sets(), pose_ik_chain_init_face_sets_fk(), sculpt_boundary_get_closest_boundary_vertex(), sculpt_boundary_indices_init(), SCULPT_connected_components_ensure(), sculpt_expand_normal_falloff_create(), sculpt_expand_topology_falloff_create(), sculpt_expand_topology_from_state_boundary(), sculpt_mask_by_color_contiguous(), sculpt_mask_expand_invoke(), SCULPT_pose_calc_pose_data(), and SCULPT_topology_automasking_init().
void SCULPT_floodfill_init | ( | SculptSession * | ss, |
SculptFloodFill * | flood | ||
) |
Definition at line 1072 of file sculpt.c.
References BLI_BITMAP_NEW, BLI_gsqueue_new(), SculptFloodFill::queue, SCULPT_vertex_count_get(), SCULPT_vertex_random_access_ensure(), and SculptFloodFill::visited_vertices.
Referenced by pose_ik_chain_init_face_sets(), pose_ik_chain_init_face_sets_fk(), sculpt_boundary_get_closest_boundary_vertex(), sculpt_boundary_indices_init(), SCULPT_connected_components_ensure(), sculpt_expand_normal_falloff_create(), sculpt_expand_topology_falloff_create(), sculpt_expand_topology_from_state_boundary(), sculpt_mask_by_color_contiguous(), sculpt_mask_expand_invoke(), SCULPT_pose_calc_pose_data(), and SCULPT_topology_automasking_init().
|
static |
Definition at line 3539 of file sculpt.c.
References add_v3_v3v3(), PBVHVertexIter::co, MVert::co, copy_v3_v3(), Object::data, SculptSession::deform_cos, SculptSession::deform_imats, PBVHVertexIter::i, mul_m3_v3(), Mesh::mvert, SculptSession::orig_cos, Object::sculpt, SculptSession::shapekey_active, sub_v3_v3v3(), and PBVHVertexIter::vert_indices.
Referenced by sculpt_combine_proxies_task_cb(), and SCULPT_flush_stroke_deform_task_cb().
Flush displacement from deformed PBVH to original layer.
Definition at line 3719 of file sculpt.c.
References BKE_paint_brush(), BKE_pbvh_parallel_range_settings(), BKE_pbvh_search_gather(), BLI_task_parallel_range(), data, Object::data, SculptSession::deform_modifiers_active, MEM_freeN, MEM_mallocN, MEM_SAFE_FREE, NULL, SculptSession::orig_cos, Sculpt::paint, SculptSession::pbvh, Object::sculpt, SCULPT_flush_stroke_deform_task_cb(), sculpt_update_keyblock(), SCULPT_vertcos_to_key(), SculptSession::shapekey_active, and Mesh::totvert.
Referenced by ED_sculpt_update_modal_transform(), sculpt_cloth_filter_modal(), sculpt_face_set_edit_modify_coordinates(), sculpt_gesture_project_end(), sculpt_mesh_filter_modal(), and sculpt_stroke_update_step().
|
static |
Definition at line 3695 of file sculpt.c.
References BKE_pbvh_vertex_iter_begin, BKE_pbvh_vertex_iter_end, copy_v3_v3(), data, float(), PBVHVertexIter::i, SculptSession::orig_cos, SculptSession::pbvh, PBVH_ITER_UNIQUE, sculpt_flush_pbvhvert_deform(), and PBVHVertexIter::vert_indices.
Referenced by SCULPT_flush_stroke_deform().
void SCULPT_flush_update_done | ( | const bContext * | C, |
Object * | ob, | ||
SculptUpdateType | update_flags | ||
) |
Definition at line 5212 of file sculpt.c.
References blender::compositor::area(), bScreen::areabase, BKE_pbvh_bmesh_after_stroke(), BKE_pbvh_type(), BKE_pbvh_update_bounds(), BKE_pbvh_update_vertex_data(), BKE_sculptsession_use_pbvh_draw(), C, CTX_wm_manager(), CTX_wm_region_view3d(), Object::data, SculptSession::deform_modifiers_active, DEG_id_tag_update(), ED_area_tag_redraw_regiontype(), ED_region_tag_redraw(), Mesh::id, Object::id, ID_REAL_USERS, ID_RECALC_GEOMETRY, LISTBASE_FOREACH, mesh, SculptSession::pbvh, PBVH_BMESH, PBVH_UpdateColor, PBVH_UpdateMask, PBVH_UpdateOriginalBB, RegionView3D::rflag, RGN_TYPE_WINDOW, RV3D_PAINTING, Object::sculpt, SCULPT_fake_neighbors_free(), SCULPT_UPDATE_COLOR, SCULPT_UPDATE_COORDS, SCULPT_UPDATE_IMAGE, sculpt_update_keyblock(), SCULPT_UPDATE_MASK, SculptSession::shapekey_active, SPACE_IMAGE, SPACE_VIEW3D, SpaceLink::spacetype, wmWindowManager::windows, and WM_window_get_active_screen().
Referenced by ED_sculpt_end_transform(), sculpt_cloth_filter_modal(), sculpt_color_filter_modal(), sculpt_expand_finish(), sculpt_expand_restore_original_state(), sculpt_face_set_edit_modify_coordinates(), sculpt_gesture_project_end(), sculpt_mask_by_color_invoke(), sculpt_mask_expand_cancel(), sculpt_mask_expand_modal(), sculpt_mesh_filter_modal(), and sculpt_stroke_done().
void SCULPT_flush_update_step | ( | bContext * | C, |
SculptUpdateType | update_flags | ||
) |
Definition at line 5144 of file sculpt.c.
References BKE_pbvh_update_bounds(), BKE_sculptsession_use_pbvh_draw(), C, SculptSession::cache, CTX_data_active_object(), CTX_data_depsgraph_pointer(), CTX_wm_region(), CTX_wm_region_view3d(), StrokeCache::current_r, DEG_id_tag_update(), depsgraph, ED_region_tag_redraw(), ED_region_tag_redraw_partial(), Object::id, ID_RECALC_GEOMETRY, ID_RECALC_SHADING, SculptSession::modifier, SculptSession::multires, MULTIRES_COORDS_MODIFIED, multires_mark_as_modified(), NULL, SculptSession::pbvh, PBVH_UpdateBB, r, RegionView3D::rflag, RV3D_PAINTING, Object::sculpt, sculpt_extend_redraw_rect_previous(), SCULPT_get_redraw_rect(), SCULPT_UPDATE_COORDS, SCULPT_UPDATE_IMAGE, SCULPT_update_object_bounding_box(), ARegion::winrct, rcti::xmin, and rcti::ymin.
Referenced by ED_sculpt_update_modal_transform(), sculpt_cloth_filter_modal(), sculpt_color_filter_modal(), sculpt_expand_flush_updates(), sculpt_expand_restore_original_state(), sculpt_face_set_edit_modify_coordinates(), sculpt_gesture_project_end(), sculpt_mask_expand_cancel(), sculpt_mask_expand_invoke(), sculpt_mask_expand_modal(), sculpt_mesh_filter_modal(), and sculpt_stroke_update_step().
bool SCULPT_get_redraw_rect | ( | struct ARegion * | region, |
struct RegionView3D * | rv3d, | ||
Object * | ob, | ||
rcti * | rect | ||
) |
Get a screen-space rectangle of the modified area.
Definition at line 1489 of file sculpt.c.
References BKE_pbvh_redraw_BB(), paint_convert_bb_to_rect(), SculptSession::pbvh, and Object::sculpt.
Referenced by SCULPT_flush_update_step(), and wpaint_stroke_update_step().
ePaintSymmetryAreas SCULPT_get_vertex_symm_area | ( | const float | co[3] | ) |
Definition at line 2848 of file sculpt.c.
References PAINT_SYMM_AREA_DEFAULT, PAINT_SYMM_AREA_X, PAINT_SYMM_AREA_Y, and PAINT_SYMM_AREA_Z.
Referenced by do_pose_brush_task_cb_ex(), sculpt_transform_radius_elastic(), and sculpt_transform_task_cb().
bool SCULPT_handles_colors_report | ( | struct SculptSession * | ss, |
struct ReportList * | reports | ||
) |
Returns true if sculpt session can handle color attributes (BKE_pbvh_type(ss->pbvh) == PBVH_FACES). If false an error message will be shown to the user. Operators should return OPERATOR_CANCELLED in this case.
NOTE: Does not check if a color attribute actually exists. Calling code must handle this itself; in most cases a call to BKE_sculpt_color_layer_create_if_needed() is sufficient.
Definition at line 5303 of file sculpt.c.
References BKE_pbvh_type(), BKE_report(), BLI_assert_msg, SculptSession::pbvh, PBVH_BMESH, PBVH_FACES, PBVH_GRIDS, and RPT_ERROR.
Referenced by sculpt_brush_stroke_invoke(), sculpt_color_filter_invoke(), sculpt_mask_by_color_invoke(), and sculpt_sample_color_invoke().
bool SCULPT_has_colors | ( | const SculptSession * | ss | ) |
Returns true if a color attribute exists in the current sculpt session.
Definition at line 156 of file sculpt.c.
References SculptSession::mcol, and SculptSession::vcol.
Referenced by sculpt_colors_poll(), SCULPT_do_paint_brush(), SCULPT_do_smear_brush(), and sculpt_sample_color_invoke().
Definition at line 148 of file sculpt.c.
References ATTR_DOMAIN_CORNER, BKE_id_attribute_domain(), BKE_id_attributes_active_color_get(), BKE_object_get_original_mesh(), and Mesh::id.
Referenced by do_brush_action(), sculpt_mask_by_color_invoke(), and vpaint_invoke().
|
static |
Definition at line 4084 of file sculpt.c.
References SculptSession::cache, StrokeCache::clip_mirror_mtx, StrokeCache::clip_tolerance, CLIP_X, eModifierMode_Realtime, eModifierType_Mirror, ListBase::first, StrokeCache::flag, MirrorModifierData::flag, invert_m4_m4(), MirrorModifierData::mirror_ob, MOD_MIR_AXIS_X, MOD_MIR_CLIPPING, ModifierData::mode, Object::modifiers, mul_m4_m4m4(), ModifierData::next, Object::obmat, MirrorModifierData::tolerance, ModifierData::type, and unit_m4().
Referenced by sculpt_update_cache_invariants().
bool SCULPT_is_symmetry_iteration_valid | ( | char | i, |
char | symm | ||
) |
Definition at line 1025 of file sculpt.c.
References ELEM.
Referenced by calc_symmetry_feather(), do_symmetrical_brush_actions(), sculpt_expand_boundary_topology_falloff_create(), sculpt_expand_diagonals_falloff_create(), sculpt_expand_find_active_connected_components_from_vert(), sculpt_expand_spherical_falloff_create(), SCULPT_floodfill_add_active(), SCULPT_floodfill_add_initial_with_symmetry(), SCULPT_geodesic_from_vertex_and_symm(), sculpt_gesture_apply(), SCULPT_is_vertex_inside_brush_radius_symm(), sculpt_pose_brush_is_vertex_inside_brush_radius(), and sculpt_transform_radius_elastic().
bool SCULPT_is_vertex_inside_brush_radius_symm | ( | const float | vertex[3], |
const float | br_co[3], | ||
float | radius, | ||
char | symm | ||
) |
Checks if a vertex is inside the brush radius from any of its mirrored axis.
Definition at line 1030 of file sculpt.c.
References flip_v3_v3(), len_squared_v3v3(), and SCULPT_is_symmetry_iteration_valid().
Referenced by automask_floodfill_cb().
MVert* SCULPT_mesh_deformed_mverts_get | ( | SculptSession * | ss | ) |
Definition at line 289 of file sculpt.c.
References BKE_pbvh_get_verts(), BKE_pbvh_type(), SculptSession::deform_modifiers_active, SculptSession::mvert, NULL, SculptSession::pbvh, PBVH_BMESH, PBVH_FACES, PBVH_GRIDS, and SculptSession::shapekey_active.
Referenced by do_draw_face_sets_brush_task_cb_ex(), blender::ed::sculpt_paint::paint::image::do_paint_pixels(), sculpt_face_set_edit_fair_face_set(), and SCULPT_geodesic_mesh_create().
char SCULPT_mesh_symmetry_xyz_get | ( | Object * | object | ) |
Definition at line 317 of file sculpt.c.
References BKE_mesh_from_object(), mesh, and Mesh::symmetry.
Referenced by cursor_draw_point_with_symmetry(), do_boundary_brush_bend_task_cb_ex(), do_boundary_brush_grab_task_cb_ex(), do_boundary_brush_inflate_task_cb_ex(), do_boundary_brush_slide_task_cb_ex(), do_boundary_brush_smooth_task_cb_ex(), do_boundary_brush_twist_task_cb_ex(), do_symmetrical_brush_actions(), pose_brush_grow_factor_task_cb_ex(), pose_ik_chain_init_face_sets(), SCULPT_do_pose_brush(), sculpt_expand_boundary_topology_falloff_create(), sculpt_expand_diagonals_falloff_create(), sculpt_expand_find_active_connected_components_from_vert(), sculpt_expand_reposition_pivot(), sculpt_expand_spherical_falloff_create(), SCULPT_floodfill_add_active(), SCULPT_floodfill_add_initial_with_symmetry(), SCULPT_geodesic_from_vertex_and_symm(), sculpt_gesture_context_init_common(), sculpt_mask_expand_modal(), SCULPT_pose_calc_pose_data(), sculpt_set_pivot_position_exec(), SCULPT_topology_automasking_init(), sculpt_transform_all_vertices(), sculpt_transform_radius_elastic(), vpaint_do_symmetrical_brush_actions(), and wpaint_do_symmetrical_brush_actions().
Definition at line 3957 of file sculpt.c.
References C, CTX_data_active_object(), Object::mode, and OB_MODE_SCULPT.
Referenced by ED_keymap_paint(), PAINT_OT_mask_flood_fill(), sculpt_and_constant_or_manual_detail_poll(), sculpt_and_dynamic_topology_poll(), sculpt_colors_poll(), SCULPT_mode_poll_view3d(), sculpt_no_multires_poll(), SCULPT_OT_cloth_filter(), SCULPT_OT_color_filter(), SCULPT_OT_dirty_mask(), SCULPT_OT_dynamic_topology_toggle(), SCULPT_OT_expand(), SCULPT_OT_face_sets_change_visibility(), SCULPT_OT_face_sets_create(), SCULPT_OT_face_sets_edit(), SCULPT_OT_face_sets_init(), SCULPT_OT_face_sets_randomize_colors(), SCULPT_OT_mask_by_color(), SCULPT_OT_mask_expand(), SCULPT_OT_mask_filter(), SCULPT_OT_mask_init(), SCULPT_OT_mesh_filter(), SCULPT_OT_optimize(), SCULPT_OT_sample_color(), SCULPT_OT_sample_detail_size(), SCULPT_OT_set_persistent_base(), SCULPT_OT_set_pivot_position(), and SCULPT_poll().
Definition at line 3963 of file sculpt.c.
References C, CTX_wm_region_view3d(), and SCULPT_mode_poll().
Referenced by ED_object_sculptmode_enter_ex(), PAINT_OT_hide_show(), PAINT_OT_mask_box_gesture(), PAINT_OT_mask_lasso_gesture(), PAINT_OT_mask_line_gesture(), SCULPT_OT_face_set_box_gesture(), SCULPT_OT_face_set_lasso_gesture(), SCULPT_OT_project_line_gesture(), SCULPT_OT_trim_box_gesture(), and SCULPT_OT_trim_lasso_gesture().
int SCULPT_nearest_vertex_get | ( | Sculpt * | sd, |
Object * | ob, | ||
const float | co[3], | ||
float | max_distance, | ||
bool | use_original | ||
) |
Definition at line 983 of file sculpt.c.
References BKE_pbvh_parallel_range_settings(), BKE_pbvh_search_gather(), BLI_task_parallel_range(), copy_v3_v3(), data, do_nearest_vertex_get_task_cb(), TaskParallelSettings::func_reduce, MEM_SAFE_FREE, NearestVertexTLSData::nearest_vertex_distance_squared, nearest_vertex_get_reduce(), NearestVertexTLSData::nearest_vertex_index, SculptThreadedTaskData::nearest_vertex_search_co, NULL, SculptSession::pbvh, Object::sculpt, SCULPT_search_sphere_cb(), SculptThreadedTaskData::sd, TaskParallelSettings::userdata_chunk, and TaskParallelSettings::userdata_chunk_size.
Referenced by pose_ik_chain_init_topology(), SCULPT_do_boundary_brush(), sculpt_expand_get_vertex_index_for_symmetry_pass(), SCULPT_floodfill_add_active(), SCULPT_floodfill_add_initial_with_symmetry(), and SCULPT_geodesic_from_vertex_and_symm().
|
static |
Definition at line 4691 of file sculpt.c.
References StrokeCache::alt_smooth, Brush::autosmooth_factor, BRUSH_MASK_SMOOTH, BRUSH_STROKE_SMOOTH, SculptSession::cache, Brush::mask_tool, SculptSession::pbvh, SCULPT_is_automasking_enabled(), Brush::sculpt_tool, SCULPT_TOOL_BOUNDARY, SCULPT_TOOL_CLOTH, SCULPT_TOOL_DISPLACEMENT_SMEAR, SCULPT_TOOL_DRAW_FACE_SETS, SCULPT_tool_is_paint(), SCULPT_TOOL_MASK, SCULPT_TOOL_PAINT, SCULPT_TOOL_POSE, SCULPT_TOOL_SLIDE_RELAX, SCULPT_TOOL_SMEAR, and SCULPT_TOOL_SMOOTH.
Referenced by sculpt_brush_stroke_init(), and SCULPT_stroke_modifiers_check().
Definition at line 4369 of file sculpt.c.
References BRUSH_CLOTH_DEFORM_GRAB, Brush::cloth_deform_type, ELEM, Brush::sculpt_tool, SCULPT_TOOL_CLAY_STRIPS, SCULPT_TOOL_CLAY_THUMB, SCULPT_TOOL_CLOTH, SCULPT_TOOL_MULTIPLANE_SCRAPE, SCULPT_TOOL_NUDGE, SCULPT_TOOL_PINCH, and SCULPT_TOOL_SNAKE_HOOK.
Referenced by sculpt_update_brush_delta().
Definition at line 4346 of file sculpt.c.
References BRUSH_ANCHORED, BRUSH_CLOTH_DEFORM_GRAB, Brush::cloth_deform_type, ELEM, Brush::flag, Brush::sculpt_tool, SCULPT_TOOL_BOUNDARY, SCULPT_TOOL_CLOTH, SCULPT_TOOL_ELASTIC_DEFORM, SCULPT_TOOL_GRAB, SCULPT_TOOL_POSE, SCULPT_TOOL_SMEAR, and SCULPT_TOOL_THUMB.
Referenced by sculpt_update_brush_delta().
|
static |
Definition at line 2788 of file sculpt.c.
References image(), SCULPT_paint_image_canvas_get(), Brush::sculpt_tool, and SCULPT_TOOL_PAINT.
Referenced by do_brush_action().
void SCULPT_orig_vert_data_init | ( | SculptOrigVertData * | data, |
Object * | ob, | ||
PBVHNode * | node, | ||
SculptUndoType | type | ||
) |
Initialize a SculptOrigVertData for accessing original vertex data; handles BMesh, Mesh, and multi-resolution.
Definition at line 1290 of file sculpt.c.
References data, node, SCULPT_orig_vert_data_unode_init(), SCULPT_undo_push_node(), and type.
Referenced by color_filter_task_cb(), do_boundary_brush_bend_task_cb_ex(), do_boundary_brush_grab_task_cb_ex(), do_boundary_brush_inflate_task_cb_ex(), do_boundary_brush_slide_task_cb_ex(), do_boundary_brush_smooth_task_cb_ex(), do_boundary_brush_twist_task_cb_ex(), do_draw_sharp_brush_task_cb_ex(), do_elastic_deform_brush_task_cb_ex(), do_grab_brush_task_cb_ex(), do_layer_brush_task_cb_ex(), do_paint_brush_task_cb_ex(), do_pose_brush_task_cb_ex(), do_rotate_brush_task_cb_ex(), do_thumb_brush_task_cb_ex(), do_topology_relax_task_cb_ex(), do_topology_slide_task_cb_ex(), mesh_filter_task_cb(), SCULPT_do_surface_smooth_brush_laplacian_task_cb_ex(), sculpt_elastic_transform_task_cb(), and sculpt_transform_task_cb().
void SCULPT_orig_vert_data_unode_init | ( | SculptOrigVertData * | data, |
Object * | ob, | ||
struct SculptUndoNode * | unode | ||
) |
Initialize a SculptOrigVertData for accessing original vertex data; handles BMesh, Mesh, and multi-resolution.
Definition at line 1271 of file sculpt.c.
References SculptSession::bm, bm, SculptSession::bm_log, data, and Object::sculpt.
Referenced by paint_mesh_restore_co_task_cb(), and SCULPT_orig_vert_data_init().
void SCULPT_orig_vert_data_update | ( | SculptOrigVertData * | orig_data, |
PBVHVertexIter * | iter | ||
) |
Update a SculptOrigVertData for a particular vertex from the PBVH iterator.
Definition at line 1300 of file sculpt.c.
References SculptOrigVertData::bm_log, BM_log_original_mask(), BM_log_original_vert_data(), PBVHVertexIter::bm_vert, SculptOrigVertData::co, SculptOrigVertData::col, SculptOrigVertData::colors, SculptOrigVertData::coords, PBVHVertexIter::i, SculptOrigVertData::mask, SculptOrigVertData::no, SculptOrigVertData::normals, SCULPT_UNDO_COLOR, SCULPT_UNDO_COORDS, SCULPT_UNDO_MASK, SculptUndoNode::type, SculptOrigVertData::unode, and SculptOrigVertData::vmasks.
Referenced by color_filter_task_cb(), do_boundary_brush_bend_task_cb_ex(), do_boundary_brush_grab_task_cb_ex(), do_boundary_brush_inflate_task_cb_ex(), do_boundary_brush_slide_task_cb_ex(), do_boundary_brush_smooth_task_cb_ex(), do_boundary_brush_twist_task_cb_ex(), do_draw_sharp_brush_task_cb_ex(), do_elastic_deform_brush_task_cb_ex(), do_grab_brush_task_cb_ex(), do_layer_brush_task_cb_ex(), do_paint_brush_task_cb_ex(), do_pose_brush_task_cb_ex(), do_rotate_brush_task_cb_ex(), do_thumb_brush_task_cb_ex(), do_topology_relax_task_cb_ex(), do_topology_slide_task_cb_ex(), mesh_filter_task_cb(), paint_mesh_restore_co_task_cb(), SCULPT_do_surface_smooth_brush_laplacian_task_cb_ex(), sculpt_elastic_transform_task_cb(), and sculpt_transform_task_cb().
void SCULPT_OT_brush_stroke | ( | wmOperatorType * | ot | ) |
Definition at line 5624 of file sculpt.c.
References wmOperatorType::cancel, wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, OPTYPE_BLOCKING, ot, paint_stroke_operator_properties(), wmOperatorType::poll, RNA_def_boolean(), sculpt_brush_stroke_cancel(), sculpt_brush_stroke_exec(), sculpt_brush_stroke_invoke(), sculpt_brush_stroke_modal(), SCULPT_poll(), and wmOperatorType::srna.
Referenced by ED_operatortypes_sculpt().
bool SCULPT_pbvh_calc_area_normal | ( | const Brush * | brush, |
Object * | ob, | ||
PBVHNode ** | nodes, | ||
int | totnode, | ||
bool | use_threading, | ||
float | r_area_no[3] | ||
) |
Definition at line 2110 of file sculpt.c.
References AreaNormalCenterTLSData::area_nos, ARRAY_SIZE, BKE_pbvh_parallel_range_settings(), BLI_task_parallel_range(), SculptSession::bm, calc_area_normal_and_center_reduce(), calc_area_normal_and_center_task_cb(), data, TaskParallelSettings::func_reduce, normalize_v3_v3(), NULL, Object::sculpt, SCULPT_stroke_is_dynamic_topology(), TaskParallelSettings::userdata_chunk, and TaskParallelSettings::userdata_chunk_size.
Referenced by SCULPT_calc_area_normal(), SCULPT_cursor_geometry_info_update(), and vwpaint_pbvh_gather_generic().
|
static |
Definition at line 2571 of file sculpt.c.
References BKE_pbvh_search_gather(), SculptSession::cursor_radius, data, NULL, SculptSession::pbvh, Object::sculpt, and SCULPT_search_sphere_cb().
Referenced by SCULPT_cursor_geometry_info_update().
|
static |
Definition at line 2590 of file sculpt.c.
References BKE_pbvh_search_gather(), SculptSession::cache, SculptSession::cursor_radius, data, dist_squared_ray_to_aabb_v3_precalc(), Brush::falloff_shape, StrokeCache::location, NULL, PAINT_FALLOFF_SHAPE_SPHERE, SculptSession::pbvh, StrokeCache::radius, Object::sculpt, SCULPT_search_circle_cb(), SCULPT_search_sphere_cb(), Brush::sculpt_tool, SCULPT_TOOL_MASK, square_f(), and StrokeCache::view_normal.
Referenced by do_brush_action(), and sculpt_topology_update().
|
static |
Definition at line 2801 of file sculpt.c.
References BKE_pbvh_build_pixels(), BLI_assert, Object::data, if(), image(), mesh, OB_MESH, SculptSession::pbvh, SCULPT_paint_image_canvas_get(), and Object::type.
Referenced by do_brush_action().
Definition at line 2996 of file sculpt.c.
References plane_point_side_v3().
Referenced by do_fill_brush_task_cb_ex(), do_multiplane_scrape_brush_task_cb_ex(), and do_scrape_brush_task_cb_ex().
int SCULPT_plane_trim | ( | const StrokeCache * | cache, |
const Brush * | brush, | ||
const float | val[3] | ||
) |
Definition at line 2990 of file sculpt.c.
References BRUSH_PLANE_TRIM, dot_v3v3(), Brush::flag, StrokeCache::plane_trim_squared, and StrokeCache::radius_squared.
Referenced by do_clay_strips_brush_task_cb_ex(), do_fill_brush_task_cb_ex(), do_flatten_brush_task_cb_ex(), do_multiplane_scrape_brush_task_cb_ex(), and do_scrape_brush_task_cb_ex().
Checks for a brush, not just sculpt mode.
Definition at line 3973 of file sculpt.c.
References C, PAINT_brush_tool_poll(), and SCULPT_mode_poll().
Referenced by SCULPT_OT_brush_stroke(), and SCULPT_poll_view3d().
Definition at line 3968 of file sculpt.c.
References C, CTX_wm_region_view3d(), and SCULPT_poll().
|
static |
Definition at line 5707 of file sculpt.c.
References SculptFakeNeighbors::fake_neighbor_index, SculptSession::fake_neighbors, and MEM_SAFE_FREE.
Referenced by SCULPT_fake_neighbors_free().
|
static |
Definition at line 1324 of file sculpt.c.
References SculptRakeData::follow_co, SculptRakeData::follow_dist, interp_v3_v3v3(), and len_v3v3().
Referenced by sculpt_update_brush_delta().
Definition at line 4727 of file sculpt.c.
References SculptRaycastData::active_face_grid_index, SculptRaycastData::active_vertex_index, BKE_pbvh_node_get_tmin(), BKE_pbvh_node_raycast(), BKE_pbvh_type(), SculptSession::cache, SculptUndoNode::co, SculptRaycastData::depth, SculptRaycastData::face_normal, float(), SculptRaycastData::hit, SculptRaycastData::isect_precalc, node, NULL, SculptRaycastData::original, SculptSession::pbvh, PBVH_BMESH, SculptRaycastData::ray_normal, SculptRaycastData::ray_start, SCULPT_UNDO_COORDS, SCULPT_undo_get_node(), and SculptRaycastData::ss.
Referenced by SCULPT_cursor_geometry_info_update(), and SCULPT_stroke_get_location().
float SCULPT_raycast_init | ( | ViewContext * | vc, |
const float | mval[2], | ||
float | ray_start[3], | ||
float | ray_end[3], | ||
float | ray_normal[3], | ||
bool | original | ||
) |
Definition at line 4798 of file sculpt.c.
References BKE_pbvh_raycast_project_ray_root(), ViewContext::depsgraph, ED_view3d_win_to_segment_clipped(), invert_m4_m4(), RegionView3D::is_persp, mul_m4_v3(), normalize_v3(), ViewContext::obact, Object::obmat, SculptSession::pbvh, ViewContext::region, ARegion::regiondata, RV3D_CLIPPING_ENABLED, Object::sculpt, sub_v3_v3v3(), and ViewContext::v3d.
Referenced by sample_detail_dyntopo(), SCULPT_cursor_geometry_info_update(), and SCULPT_stroke_get_location().
Definition at line 5102 of file sculpt.c.
References BKE_brush_use_size_pressure(), BKE_paint_brush(), BRUSH_ANCHORED, BRUSH_DRAG_DOT, SculptSession::cache, ELEM, SculptSession::face_sets, SculptUndoNode::face_sets, Brush::flag, StrokeCache::layer_displacement_factor, MEM_SAFE_FREE, Sculpt::paint, paint_mesh_restore_co(), Object::sculpt, Brush::sculpt_tool, SCULPT_TOOL_CLOTH, SCULPT_TOOL_ELASTIC_DEFORM, SCULPT_TOOL_GRAB, SCULPT_UNDO_FACE_SETS, SCULPT_undo_get_first_node(), SculptSession::totfaces, and SculptUndoNode::type.
Referenced by sculpt_stroke_update_step().
2D projection (distance to line).
Definition at line 2513 of file sculpt.c.
References BKE_pbvh_node_fully_masked_get(), BKE_pbvh_node_get_BB(), BKE_pbvh_node_get_original_BB(), data, dist_squared_ray_to_aabb_v3(), and node.
Referenced by sculpt_pbvh_gather_generic(), and vwpaint_pbvh_gather_generic().
Test AABB against sphere.
Definition at line 2467 of file sculpt.c.
References BKE_pbvh_node_fully_hidden_get(), BKE_pbvh_node_fully_masked_get(), BKE_pbvh_node_get_BB(), BKE_pbvh_node_get_original_BB(), center, data, len_squared_v3(), node, sub_v3_v3v3(), and t.
Referenced by SCULPT_cloth_brush_affected_nodes_gather(), SCULPT_fake_neighbor_search(), SCULPT_filter_cache_init(), SCULPT_nearest_vertex_get(), sculpt_pbvh_gather_cursor_update(), sculpt_pbvh_gather_generic(), and vwpaint_pbvh_gather_generic().
|
static |
Definition at line 5454 of file sculpt.c.
References StrokeCache::alt_smooth, StrokeCache::automasking, BKE_paint_brush(), BKE_pbvh_node_color_buffer_free(), BLI_assert, StrokeCache::brush, C, SculptSession::cache, CTX_data_active_object(), CTX_data_tool_settings(), UnifiedPaintSettings::draw_inverted, ED_image_undo_push_end(), NC_OBJECT, ND_DRAW, NULL, Sculpt::paint, ToolSettings::paint_mode, SculptSession::pbvh, Object::sculpt, ToolSettings::sculpt, SCULPT_automasking_cache_free(), sculpt_brush_exit_tex(), SCULPT_cache_free(), SCULPT_flush_update_done(), SCULPT_is_automasking_enabled(), SCULPT_stroke_modifiers_check(), Brush::sculpt_tool, SCULPT_TOOL_MASK, SCULPT_TOOL_PAINT, SCULPT_undo_push_end(), SCULPT_UPDATE_COLOR, SCULPT_UPDATE_COORDS, SCULPT_UPDATE_IMAGE, SCULPT_UPDATE_MASK, SCULPT_use_image_paint_brush(), smooth_brush_toggle_off(), ToolSettings::unified_paint_settings, and WM_event_add_notifier().
Referenced by sculpt_brush_stroke_exec(), and sculpt_brush_stroke_invoke().
bool SCULPT_stroke_get_location | ( | struct bContext * | C, |
float | out[3], | ||
const float | mouse[2], | ||
bool | force_original | ||
) |
Do a ray-cast in the tree to find the 3d brush location (This allows us to ignore the GL depth buffer) Returns 0 if the ray doesn't hit the mesh, non-zero otherwise.
Definition at line 4964 of file sculpt.c.
References add_v3_v3(), BKE_paint_brush(), BKE_paint_get_active_from_context(), BKE_pbvh_find_nearest_to_ray(), BKE_pbvh_raycast(), BKE_pbvh_type(), SculptSession::bm, BM_mesh_elem_index_ensure(), BM_mesh_elem_table_ensure(), BM_VERT, C, SculptSession::cache, copy_v3_v3(), CTX_data_depsgraph_pointer(), depsgraph, SculptRaycastData::depth, SculptFindNearestToRayData::depth, ED_view3d_viewcontext_init(), ELEM, SculptRaycastData::face_normal, Brush::falloff_shape, SculptRaycastData::hit, SculptFindNearestToRayData::hit, SculptRaycastData::isect_precalc, isect_ray_tri_watertight_v3_precalc(), mul_v3_fl(), ViewContext::obact, SculptRaycastData::original, SculptFindNearestToRayData::original, StrokeCache::original, usdtokens::out(), PAINT_FALLOFF_SHAPE_TUBE, SculptSession::pbvh, PBVH_BMESH, SculptRaycastData::ray_normal, SculptRaycastData::ray_start, Object::sculpt, sculpt_find_nearest_to_ray_cb(), sculpt_raycast_cb(), SCULPT_raycast_init(), SCULPT_stroke_modifiers_check(), and SculptRaycastData::ss.
Referenced by over_mesh(), paint_brush_stroke_add_step(), paint_line_strokes_spacing(), paint_space_stroke(), paint_stroke_curve_end(), paint_stroke_modal(), sculpt_brush_stroke_exec(), sculpt_brush_stroke_invoke(), sculpt_set_pivot_position_exec(), vpaint_exec(), vpaint_invoke(), wpaint_exec(), and wpaint_invoke().
bool SCULPT_stroke_is_dynamic_topology | ( | const SculptSession * | ss, |
const Brush * | brush | ||
) |
Returns true if the stroke will use dynamic topology, false otherwise.
Factors: some brushes like grab cannot do dynamic topology. Others, like smooth, are better without. Same goes for alt-key smoothing.
Definition at line 1338 of file sculpt.c.
References StrokeCache::alt_smooth, BKE_pbvh_type(), BRUSH_ANCHORED, BRUSH_DRAG_DOT, SculptSession::cache, Brush::flag, SculptSession::pbvh, PBVH_BMESH, Brush::sculpt_tool, and SCULPT_TOOL_HAS_DYNTOPO.
Referenced by sculpt_brush_stroke_cancel(), SCULPT_calc_area_center(), SCULPT_calc_area_normal_and_center(), SCULPT_is_automasking_enabled(), SCULPT_pbvh_calc_area_normal(), and sculpt_stroke_update_step().
bool SCULPT_stroke_is_first_brush_step | ( | struct StrokeCache * | cache | ) |
Return true only once per stroke on the first symmetry pass, regardless of the symmetry passes enabled.
This should be used for functionality that needs to be computed once per stroke of a particular tool (allocating memory, updating random seeds...).
Definition at line 912 of file sculpt.c.
References StrokeCache::first_time, StrokeCache::mirror_symmetry_pass, StrokeCache::radial_symmetry_pass, and StrokeCache::tile_pass.
Referenced by do_brush_action(), SCULPT_do_cloth_brush(), SCULPT_do_paint_brush(), and SCULPT_enhance_details_brush().
bool SCULPT_stroke_is_first_brush_step_of_symmetry_pass | ( | struct StrokeCache * | cache | ) |
Returns true on the first brush step of each symmetry pass.
Definition at line 918 of file sculpt.c.
References StrokeCache::first_time.
Referenced by calc_sculpt_plane(), paint_cursor_cursor_draw_3d_view_brush_cursor_active(), SCULPT_calc_brush_plane(), SCULPT_do_boundary_brush(), SCULPT_do_clay_strips_brush(), SCULPT_do_clay_thumb_brush(), SCULPT_do_cloth_brush(), SCULPT_do_multiplane_scrape_brush(), SCULPT_do_paint_brush(), SCULPT_do_pinch_brush(), SCULPT_do_slide_relax_brush(), sculpt_update_brush_delta(), sculpt_update_cache_variants(), and update_sculpt_normal().
bool SCULPT_stroke_is_main_symmetry_pass | ( | struct StrokeCache * | cache | ) |
Returns true when the step belongs to the stroke that is directly performed by the brush and not by one of the symmetry passes.
Definition at line 906 of file sculpt.c.
References StrokeCache::mirror_symmetry_pass, StrokeCache::radial_symmetry_pass, and StrokeCache::tile_pass.
Referenced by calc_sculpt_plane(), do_brush_action(), SCULPT_calc_brush_plane(), and SCULPT_do_clay_thumb_brush().
Definition at line 4712 of file sculpt.c.
References BKE_sculpt_update_object_for_edit(), BKE_sculptsession_use_pbvh_draw(), C, CTX_data_depsgraph_pointer(), CTX_data_tool_settings(), CTX_wm_region_view3d(), SculptSession::deform_modifiers_active, depsgraph, Object::sculpt, ToolSettings::sculpt, sculpt_needs_connectivity_info(), Brush::sculpt_tool, SCULPT_tool_is_paint(), and SculptSession::shapekey_active.
Referenced by sample_detail_dyntopo(), SCULPT_cursor_geometry_info_update(), sculpt_stroke_done(), SCULPT_stroke_get_location(), and sculpt_stroke_update_step().
|
static |
Definition at line 5321 of file sculpt.c.
References BKE_paint_brush(), C, View3DShading::color_type, CTX_data_active_object(), CTX_data_tool_settings(), CTX_wm_region_view3d(), CTX_wm_view3d(), ED_image_undo_push_begin(), ED_view3d_init_mats_rv3d(), wmOperator::flag, wmOperatorType::name, NULL, OB_SOLID, OP_IS_INVOKE, over_mesh(), Sculpt::paint, ToolSettings::paint_mode, PAINT_MODE_SCULPT, Object::sculpt, ToolSettings::sculpt, SCULPT_cursor_geometry_info_update(), Brush::sculpt_tool, SCULPT_tool_is_paint(), sculpt_tool_name(), SCULPT_TOOL_PAINT, SCULPT_undo_push_begin(), sculpt_update_cache_invariants(), SCULPT_use_image_paint_brush(), View3D::shading, View3DShading::type, wmOperator::type, and V3D_SHADING_VERTEX_COLOR.
Referenced by sculpt_brush_stroke_exec(), and sculpt_brush_stroke_invoke().
|
static |
Definition at line 5366 of file sculpt.c.
References BKE_paint_brush(), BKE_pbvh_bmesh_detail_size_set(), C, SculptSession::cache, Sculpt::constant_detail, copy_v3_v3(), CTX_data_active_object(), CTX_data_tool_settings(), SculptSession::deform_modifiers_active, Sculpt::detail_percent, Sculpt::detail_size, do_brush_action(), do_symmetrical_brush_actions(), StrokeCache::dyntopo_pixel_radius, StrokeCache::first_time, Sculpt::flags, mat4_to_scale(), Object::obmat, Sculpt::paint, ToolSettings::paint_mode, paint_stroke_distance_get(), SculptSession::pbvh, StrokeCache::radius, Object::sculpt, ToolSettings::sculpt, sculpt_combine_proxies(), SCULPT_DYNTOPO_DETAIL_BRUSH, SCULPT_DYNTOPO_DETAIL_CONSTANT, SCULPT_DYNTOPO_DETAIL_MANUAL, sculpt_fix_noise_tear(), SCULPT_flush_stroke_deform(), SCULPT_flush_update_step(), sculpt_restore_mesh(), SCULPT_stroke_is_dynamic_topology(), SCULPT_stroke_modifiers_check(), Brush::sculpt_tool, SCULPT_tool_is_paint(), sculpt_tool_is_proxy_used(), SCULPT_TOOL_MASK, sculpt_topology_update(), sculpt_update_cache_variants(), SCULPT_UPDATE_COLOR, SCULPT_UPDATE_COORDS, SCULPT_UPDATE_IMAGE, sculpt_update_keyblock(), SCULPT_UPDATE_MASK, SCULPT_use_image_paint_brush(), SculptSession::shapekey_active, StrokeCache::stroke_distance, StrokeCache::true_last_location, StrokeCache::true_location, and ToolSettings::unified_paint_settings.
Referenced by sculpt_brush_stroke_exec(), and sculpt_brush_stroke_invoke().
Should be used after modifying the mask or Face Sets IDs.
Definition at line 1048 of file sculpt.c.
References BKE_sculptsession_use_pbvh_draw(), C, CTX_data_active_object(), CTX_wm_region(), CTX_wm_region_view3d(), DEG_id_tag_update(), ED_region_tag_redraw(), Object::id, ID_RECALC_GEOMETRY, ID_RECALC_SHADING, NC_OBJECT, ND_DRAW, and WM_event_add_notifier().
Referenced by mask_flood_fill_exec(), sculpt_expand_restore_original_state(), sculpt_face_set_create_exec(), sculpt_face_set_edit_invoke(), sculpt_face_set_init_exec(), sculpt_face_sets_change_visibility_exec(), sculpt_face_sets_randomize_colors_exec(), sculpt_gesture_apply(), sculpt_mask_filter_exec(), and sculpt_mask_init_exec().
void SCULPT_tilt_apply_to_normal | ( | float | r_normal[3], |
struct StrokeCache * | cache, | ||
float | tilt_strength | ||
) |
Tilts a normal by the x and y tilt values using the view axis.
Definition at line 2751 of file sculpt.c.
References Object::imat, M_PI_2, mul_v3_mat3_m4v3(), normalize_v3(), ViewContext::obact, Object::obmat, rotate_v3_v3v3fl(), ViewContext::rv3d, SCULPT_TILT_SENSITIVITY, StrokeCache::vc, RegionView3D::viewinv, StrokeCache::x_tilt, and StrokeCache::y_tilt.
Referenced by SCULPT_do_clay_strips_brush(), SCULPT_do_fill_brush(), SCULPT_do_flatten_brush(), SCULPT_do_scrape_brush(), and SCULPT_tilt_effective_normal_get().
void SCULPT_tilt_effective_normal_get | ( | const SculptSession * | ss, |
const Brush * | brush, | ||
float | r_no[3] | ||
) |
Get effective surface normal with pen tilt and tilt strength applied to it.
Definition at line 2767 of file sculpt.c.
References SculptSession::cache, copy_v3_v3(), StrokeCache::sculpt_normal_symm, SCULPT_tilt_apply_to_normal(), and Brush::tilt_strength_factor.
Referenced by SCULPT_do_draw_brush(), and SCULPT_do_draw_sharp_brush().
|
static |
Definition at line 1183 of file sculpt.c.
References ELEM, SCULPT_TOOL_CLAY_STRIPS, SCULPT_TOOL_MULTIPLANE_SCRAPE, and SCULPT_TOOL_PAINT.
Referenced by do_brush_action().
|
static |
Definition at line 1210 of file sculpt.c.
References ELEM, SCULPT_TOOL_BOUNDARY, SCULPT_TOOL_CLOTH, SCULPT_TOOL_DISPLACEMENT_SMEAR, SCULPT_TOOL_DRAW_FACE_SETS, SCULPT_TOOL_LAYER, SCULPT_TOOL_PAINT, SCULPT_TOOL_POSE, SCULPT_TOOL_SMEAR, and SCULPT_TOOL_SMOOTH.
Referenced by sculpt_combine_proxies(), and sculpt_stroke_update_step().
|
static |
Definition at line 3978 of file sculpt.c.
References BKE_paint_brush(), Sculpt::paint, Brush::sculpt_tool, SCULPT_TOOL_BLOB, SCULPT_TOOL_BOUNDARY, SCULPT_TOOL_CLAY, SCULPT_TOOL_CLAY_STRIPS, SCULPT_TOOL_CLAY_THUMB, SCULPT_TOOL_CLOTH, SCULPT_TOOL_CREASE, SCULPT_TOOL_DISPLACEMENT_ERASER, SCULPT_TOOL_DISPLACEMENT_SMEAR, SCULPT_TOOL_DRAW, SCULPT_TOOL_DRAW_FACE_SETS, SCULPT_TOOL_DRAW_SHARP, SCULPT_TOOL_ELASTIC_DEFORM, SCULPT_TOOL_FILL, SCULPT_TOOL_FLATTEN, SCULPT_TOOL_GRAB, SCULPT_TOOL_INFLATE, SCULPT_TOOL_LAYER, SCULPT_TOOL_MASK, SCULPT_TOOL_MULTIPLANE_SCRAPE, SCULPT_TOOL_NUDGE, SCULPT_TOOL_PAINT, SCULPT_TOOL_PINCH, SCULPT_TOOL_POSE, SCULPT_TOOL_ROTATE, SCULPT_TOOL_SCRAPE, SCULPT_TOOL_SIMPLIFY, SCULPT_TOOL_SLIDE_RELAX, SCULPT_TOOL_SMEAR, SCULPT_TOOL_SMOOTH, SCULPT_TOOL_SNAKE_HOOK, and SCULPT_TOOL_THUMB.
Referenced by sculpt_stroke_test_start().
|
static |
Definition at line 1196 of file sculpt.c.
References ELEM, SCULPT_TOOL_BOUNDARY, SCULPT_TOOL_DRAW_SHARP, SCULPT_TOOL_ELASTIC_DEFORM, SCULPT_TOOL_GRAB, SCULPT_TOOL_LAYER, SCULPT_TOOL_POSE, SCULPT_TOOL_ROTATE, SCULPT_TOOL_SMOOTH, and SCULPT_TOOL_THUMB.
Referenced by do_brush_action(), and sculpt_topology_update().
|
static |
Definition at line 3141 of file sculpt.c.
References BKE_pbvh_bmesh_node_save_orig(), BKE_pbvh_bmesh_update_topology(), BKE_pbvh_node_mark_topology_update(), BKE_pbvh_node_mark_update(), BKE_pbvh_type(), SculptSession::bm, SculptVertexInfo::boundary, BRUSH_FRONTFACE, SculptSession::cache, SculptVertexInfo::connected_component, copy_v3_v3(), Brush::falloff_shape, Brush::flag, Sculpt::flags, StrokeCache::location, MEM_SAFE_FREE, mul_m4_v3(), Object::obmat, StrokeCache::original, PAINT_FALLOFF_SHAPE_SPHERE, SculptSession::pbvh, PBVH_BMESH, PBVH_Collapse, PBVH_Subdivide, StrokeCache::radius, Object::sculpt, SCULPT_DYNTOPO_COLLAPSE, SCULPT_DYNTOPO_DETAIL_MANUAL, SCULPT_DYNTOPO_SUBDIVIDE, sculpt_pbvh_gather_generic(), Brush::sculpt_tool, SCULPT_TOOL_MASK, sculpt_tool_needs_original(), SCULPT_TOOL_SIMPLIFY, SCULPT_UNDO_COORDS, SCULPT_UNDO_MASK, SCULPT_undo_push_node(), StrokeCache::true_location, SculptSession::vertex_info, and StrokeCache::view_normal.
Referenced by sculpt_stroke_update_step().
|
static |
Definition at line 4383 of file sculpt.c.
References add_v3_v3(), UnifiedPaintSettings::anchored_initial_mouse, StrokeCache::anchored_location, UnifiedPaintSettings::anchored_size, angle(), axis_angle_normalized_to_quat(), BRUSH_ANCHORED, BRUSH_CLOTH_DEFORM_SNAKE_HOOK, BRUSH_GRAB_ACTIVE_VERTEX, SculptSession::cache, Brush::cloth_deform_type, copy_v2_v2(), copy_v3_v3(), UnifiedPaintSettings::draw_anchored, ED_view3d_win_to_3d(), ELEM, eps, Brush::falloff_shape, Brush::flag, SculptRakeData::follow_co, SculptRakeData::follow_dist, StrokeCache::grab_delta, StrokeCache::initial_mouse, invert_m4_m4(), StrokeCache::is_rake_rotation_valid, is_zero_v3(), len_squared_v3v3(), StrokeCache::mouse_event, mul_mat3_m4_v3(), mul_v3_m4v3(), normalize_v3(), Object::obmat, StrokeCache::old_grab_location, StrokeCache::orig_grab_location, PAINT_FALLOFF_SHAPE_TUBE, UnifiedPaintSettings::pixel_radius, project_plane_v3_v3v3(), quat_to_axis_angle(), StrokeCache::radius, StrokeCache::rake_data, Brush::rake_factor, StrokeCache::rake_rotation, ViewContext::region, rotation_between_vecs_to_quat(), Object::sculpt, SCULPT_active_vertex_get(), sculpt_brush_needs_rake_rotation(), sculpt_brush_use_topology_rake(), SCULPT_is_cloth_deform_brush(), sculpt_needs_delta_for_tip_orientation(), sculpt_needs_delta_from_anchored_origin(), SCULPT_RAKE_BRUSH_FACTOR, sculpt_rake_data_update(), SCULPT_stroke_is_first_brush_step_of_symmetry_pass(), Brush::sculpt_tool, SCULPT_TOOL_BOUNDARY, SCULPT_TOOL_CLAY_STRIPS, SCULPT_TOOL_CLAY_THUMB, SCULPT_TOOL_CLOTH, SCULPT_TOOL_ELASTIC_DEFORM, SCULPT_TOOL_GRAB, SCULPT_TOOL_MULTIPLANE_SCRAPE, SCULPT_TOOL_NUDGE, SCULPT_TOOL_PAINT, SCULPT_TOOL_PINCH, SCULPT_TOOL_POSE, SCULPT_TOOL_SMEAR, SCULPT_TOOL_SNAKE_HOOK, SCULPT_TOOL_THUMB, SCULPT_vertex_co_for_grab_active_get(), sqrtf, square_f(), sub_v3_v3(), sub_v3_v3v3(), StrokeCache::true_location, StrokeCache::true_view_normal, v1, v2, ViewContext::v3d, StrokeCache::vc, and zero_v3().
Referenced by sculpt_update_cache_variants().
|
static |
Definition at line 4183 of file sculpt.c.
References StrokeCache::alt_smooth, BKE_paint_brush(), BLI_dial_init(), StrokeCache::brush, BRUSH_ACCUMULATE, BRUSH_ANCHORED, BRUSH_STROKE_INVERT, BRUSH_STROKE_SMOOTH, C, SculptSession::cache, copy_m3_m4(), copy_v2_v2(), copy_v3_v3(), CTX_data_active_object(), CTX_data_tool_settings(), SculptSession::cursor_location, SculptSession::cursor_normal, wmOperator::customdata, StrokeCache::dial, UnifiedPaintSettings::draw_inverted, ED_view3d_ob_project_mat_get(), ELEM, fabsf, StrokeCache::first_time, StrokeCache::flag, Brush::flag, Sculpt::gravity_factor, Sculpt::gravity_object, Object::imat, StrokeCache::initial_location, StrokeCache::initial_mouse, StrokeCache::initial_normal, StrokeCache::invert, invert_m4_m4(), max_ff(), MEM_callocN, StrokeCache::mouse, StrokeCache::mouse_event, mul_m3_v3(), StrokeCache::normal_weight, Brush::normal_weight, normalize_v3(), normalize_v3_v3(), Object::obmat, StrokeCache::original, Sculpt::paint, paint_stroke_view_context(), PIXEL_INPUT_THRESHHOLD, Brush::plane_trim, StrokeCache::plane_trim_squared, StrokeCache::projection_mat, wmOperator::ptr, RNA_enum_get(), ViewContext::rv3d, StrokeCache::scale, Object::scale, sculpt_init_mirror_clipping(), Brush::sculpt_tool, SCULPT_TOOL_DISPLACEMENT_ERASER, SCULPT_TOOL_DISPLACEMENT_SMEAR, SCULPT_TOOL_DRAW_SHARP, SCULPT_TOOL_HAS_ACCUMULATE, SCULPT_TOOL_HAS_NORMAL_WEIGHT, SCULPT_TOOL_MASK, SCULPT_TOOL_ROTATE, SCULPT_TOOL_SIMPLIFY, SCULPT_TOOL_SMOOTH, smooth_brush_toggle_on(), StrokeCache::supports_gravity, UnifiedPaintSettings::tex_mouse, StrokeCache::true_gravity_direction, StrokeCache::true_initial_location, StrokeCache::true_initial_normal, StrokeCache::true_view_normal, ToolSettings::unified_paint_settings, StrokeCache::vc, RegionView3D::viewinv, and zero_v2().
Referenced by sculpt_stroke_test_start().
|
static |
Definition at line 4541 of file sculpt.c.
References BRUSH_PAINT_DENSITY_PRESSURE, BRUSH_PAINT_DENSITY_PRESSURE_INVERT, BRUSH_PAINT_FLOW_PRESSURE, BRUSH_PAINT_FLOW_PRESSURE_INVERT, BRUSH_PAINT_HARDNESS_PRESSURE, BRUSH_PAINT_HARDNESS_PRESSURE_INVERT, BRUSH_PAINT_WET_MIX_PRESSURE, BRUSH_PAINT_WET_MIX_PRESSURE_INVERT, BRUSH_PAINT_WET_PERSISTENCE_PRESSURE, BRUSH_PAINT_WET_PERSISTENCE_PRESSURE_INVERT, StrokeCache::density, Brush::density, StrokeCache::flow, Brush::flow, StrokeCache::hardness, Brush::hardness, StrokeCache::paint_brush, Brush::paint_flags, pow2f(), StrokeCache::pressure, StrokeCache::wet_mix, Brush::wet_mix, StrokeCache::wet_persistence, and Brush::wet_persistence.
Referenced by sculpt_update_cache_variants().
|
static |
Definition at line 4586 of file sculpt.c.
References UnifiedPaintSettings::anchored_initial_mouse, StrokeCache::anchored_location, UnifiedPaintSettings::anchored_size, BKE_brush_size_get(), BKE_brush_unprojected_radius_get(), BKE_brush_unprojected_radius_set(), BKE_brush_use_locked_size(), BKE_brush_use_size_pressure(), BKE_paint_brush(), BLI_dial_angle(), BRUSH_ANCHORED, BRUSH_EDGE_TO_EDGE, UnifiedPaintSettings::brush_rotation, StrokeCache::bstrength, C, SculptSession::cache, StrokeCache::clay_pressure_stabilizer, StrokeCache::clay_pressure_stabilizer_index, copy_v2_v2(), copy_v3_v3(), CTX_data_scene(), StrokeCache::dial, UnifiedPaintSettings::draw_anchored, StrokeCache::dyntopo_pixel_radius, StrokeCache::first_time, Brush::flag, StrokeCache::initial_mouse, UnifiedPaintSettings::initial_pixel_radius, StrokeCache::initial_radius, StrokeCache::iteration_count, StrokeCache::mouse, StrokeCache::mouse_event, Sculpt::paint, paint_calc_object_space_radius(), PAINT_MODE_SCULPT, paint_supports_dynamic_size(), StrokeCache::pen_flip, UnifiedPaintSettings::pixel_radius, StrokeCache::pressure, ptr, StrokeCache::radius, StrokeCache::radius_squared, RNA_boolean_get(), RNA_float_get(), RNA_float_get_array(), scene, Object::sculpt, sculpt_brush_dynamic_size_get(), SCULPT_CLAY_STABILIZER_LEN, SCULPT_is_cloth_deform_brush(), SCULPT_stroke_is_first_brush_step_of_symmetry_pass(), Brush::sculpt_tool, SCULPT_TOOL_CLAY_THUMB, SCULPT_TOOL_ROTATE, SCULPT_TOOL_SNAKE_HOOK, sculpt_update_brush_delta(), sculpt_update_cache_paint_variants(), StrokeCache::special_rotation, Scene::toolsettings, StrokeCache::true_location, ToolSettings::unified_paint_settings, StrokeCache::vc, StrokeCache::vertex_rotation, StrokeCache::x_tilt, and StrokeCache::y_tilt.
Referenced by sculpt_stroke_update_step().
Copy the modified vertices from the PBVH to the active key.
Definition at line 3670 of file sculpt.c.
References BKE_pbvh_vert_coords_alloc(), float(), MEM_freeN, SculptSession::orig_cos, SculptSession::pbvh, Object::sculpt, SCULPT_vertcos_to_key(), and SculptSession::shapekey_active.
Referenced by SCULPT_flush_stroke_deform(), SCULPT_flush_update_done(), and sculpt_stroke_update_step().
Copy the PBVH bounding box into the object's bounding box.
Definition at line 5134 of file sculpt.c.
References Object_Runtime::bb, BKE_boundbox_init_from_minmax(), BKE_pbvh_bounding_box(), SculptSession::pbvh, Object::runtime, and Object::sculpt.
Referenced by SCULPT_flush_update_step(), and sculpt_undo_restore_list().
Definition at line 3097 of file sculpt.c.
References Freestyle::a, BKE_keyblock_convert_to_vertcos(), BKE_keyblock_is_basis(), BKE_keyblock_update_from_offset(), BKE_keyblock_update_from_vertcos(), BKE_mesh_tag_coords_changed(), Key::block, MVert::co, copy_v3_v3(), Object::data, ListBase::first, Mesh::key, MEM_freeN, Mesh::mvert, KeyBlock::next, NULL, Key::refkey, KeyBlock::relative, Object::shapenr, sub_v3_v3v3(), and Mesh::totvert.
Referenced by SCULPT_flush_stroke_deform(), sculpt_undo_restore_coords(), and sculpt_update_keyblock().
bool SCULPT_vertex_all_face_sets_visible_get | ( | const SculptSession * | ss, |
int | index | ||
) |
Definition at line 459 of file sculpt.c.
References BKE_pbvh_get_grid_key(), BKE_pbvh_type(), BKE_subdiv_ccg_grid_to_face_index(), MeshElemMap::count, SculptSession::face_sets, CCGKey::grid_area, MeshElemMap::indices, SculptSession::pbvh, PBVH_BMESH, PBVH_FACES, PBVH_GRIDS, SculptSession::pmap, and SculptSession::subdiv_ccg.
Referenced by SCULPT_vertex_is_boundary().
bool SCULPT_vertex_any_face_set_visible_get | ( | SculptSession * | ss, |
int | index | ||
) |
Definition at line 439 of file sculpt.c.
References BKE_pbvh_type(), MeshElemMap::count, SculptSession::face_sets, MeshElemMap::indices, SculptSession::pbvh, PBVH_BMESH, PBVH_FACES, PBVH_GRIDS, and SculptSession::pmap.
const float* SCULPT_vertex_co_for_grab_active_get | ( | SculptSession * | ss, |
int | index | ||
) |
Coordinates used for manipulating the base mesh when Grab Active Vertex is enabled.
Definition at line 201 of file sculpt.c.
References BKE_pbvh_get_verts(), MVert::co, SculptSession::mvert, SculptSession::pbvh, SCULPT_vertex_co_get(), and SculptSession::shapekey_active.
Referenced by paint_cursor_draw_3d_view_brush_cursor_inactive(), sculpt_geometry_preview_lines_draw(), SCULPT_geometry_preview_lines_update(), and sculpt_update_brush_delta().
const float* SCULPT_vertex_co_get | ( | SculptSession * | ss, |
int | index | ||
) |
Definition at line 125 of file sculpt.c.
References BKE_pbvh_get_bmesh(), BKE_pbvh_get_grid_key(), BKE_pbvh_get_grids(), BKE_pbvh_get_verts(), BKE_pbvh_type(), BM_vert_at_index(), CCG_elem_co(), CCG_elem_offset(), BMVert::co, MVert::co, SculptSession::deform_modifiers_active, CCGKey::grid_area, SculptSession::mvert, NULL, SculptSession::pbvh, PBVH_BMESH, PBVH_FACES, PBVH_GRIDS, and SculptSession::shapekey_active.
Referenced by automask_floodfill_cb(), boundary_floodfill_cb(), boundary_initial_vertex_floodfill_cb(), cloth_brush_add_length_constraint(), do_boundary_brush_smooth_task_cb_ex(), do_displacement_smear_store_prev_disp_task_cb_ex(), do_smear_brush_task_cb_exec(), do_topology_slide_task_cb_ex(), dyntopo_detail_size_sample_from_surface(), mesh_filter_enhance_details_init_directions(), mesh_filter_sharpen_init(), mesh_filter_task_cb(), neighbor_dirty_mask(), paint_cursor_draw_3d_view_brush_cursor_inactive(), paint_cursor_preview_boundary_data_pivot_draw(), pose_face_sets_floodfill_cb(), pose_ik_chain_init_face_sets(), pose_ik_chain_init_face_sets_fk(), pose_topology_floodfill_cb(), sample_detail_voxel(), SCULPT_active_vertex_co_get(), sculpt_boundary_bend_data_init(), SCULPT_boundary_edges_preview_draw(), sculpt_boundary_edit_data_init(), sculpt_boundary_indices_init(), SCULPT_boundary_pivot_line_preview_draw(), sculpt_boundary_slide_data_init(), sculpt_boundary_twist_data_init(), SCULPT_cloth_brush_simulation_init(), SCULPT_cloth_brush_store_simulation_state(), sculpt_cloth_filter_modal(), SCULPT_do_displacement_smear_brush(), SCULPT_enhance_details_brush(), sculpt_expand_falloff_value_vertex_get(), sculpt_expand_get_vertex_index_for_symmetry_pass(), sculpt_expand_reposition_pivot(), sculpt_expand_spherical_falloff_create(), SCULPT_fake_neighbor_search(), SCULPT_floodfill_add_initial_with_symmetry(), SCULPT_geodesic_fallback_create(), SCULPT_geodesic_from_vertex_and_symm(), sculpt_gesture_trim_calculate_depth(), SCULPT_neighbor_coords_average(), SCULPT_neighbor_coords_average_interior(), SCULPT_relax_vertex(), sculpt_set_persistent_base_exec(), SCULPT_vertex_co_for_grab_active_get(), SCULPT_vertex_limit_surface_get(), and SCULPT_vertex_persistent_co_get().
void SCULPT_vertex_color_get | ( | const SculptSession * | ss, |
int | index, | ||
float | r_color[4] | ||
) |
Definition at line 161 of file sculpt.c.
References BKE_pbvh_vertex_color_get(), and SculptSession::pbvh.
Referenced by color_filter_task_cb(), do_color_smooth_task_cb_exec(), do_mask_by_color_task_cb(), do_paint_brush_task_cb_ex(), do_sample_wet_paint_task_cb(), do_smear_brush_task_cb_exec(), do_smear_store_prev_colors_task_cb_exec(), sculpt_color_presmooth_init(), SCULPT_do_smear_brush(), sculpt_expand_colors_update_task_cb(), sculpt_expand_original_state_store(), sculpt_mask_by_color_contiguous(), sculpt_mask_by_color_contiguous_floodfill_cb(), SCULPT_neighbor_color_average(), and sculpt_sample_color_invoke().
void SCULPT_vertex_color_set | ( | SculptSession * | ss, |
int | index, | ||
const float | color[4] | ||
) |
Definition at line 166 of file sculpt.c.
References BKE_pbvh_vertex_color_set(), color, and SculptSession::pbvh.
Referenced by color_filter_task_cb(), do_color_smooth_task_cb_exec(), do_paint_brush_task_cb_ex(), do_smear_brush_task_cb_exec(), paint_mesh_restore_co_task_cb(), sculpt_expand_colors_update_task_cb(), and sculpt_expand_restore_color_data().
int SCULPT_vertex_count_get | ( | SculptSession * | ss | ) |
Definition at line 111 of file sculpt.c.
References BKE_pbvh_get_bmesh(), BKE_pbvh_get_grid_num_vertices(), BKE_pbvh_type(), BM_mesh_elem_count(), BM_VERT, SculptSession::pbvh, PBVH_BMESH, PBVH_FACES, PBVH_GRIDS, and SculptSession::totvert.
Referenced by cloth_brush_apply_brush_foces(), do_brush_action(), mesh_filter_enhance_details_init_directions(), mesh_filter_init_limit_surface_co(), mesh_filter_sharpen_init(), mesh_filter_surface_smooth_init(), pose_ik_chain_init_face_sets(), pose_ik_chain_init_face_sets_fk(), pose_ik_chain_init_topology(), SCULPT_automasking_cache_init(), SCULPT_boundary_automasking_init(), sculpt_boundary_bend_data_init(), sculpt_boundary_edit_data_init(), sculpt_boundary_falloff_factor_init(), sculpt_boundary_get_closest_boundary_vertex(), sculpt_boundary_indices_init(), sculpt_boundary_slide_data_init(), SCULPT_cloth_brush_simulation_create(), SCULPT_cloth_brush_simulation_init(), SCULPT_cloth_brush_store_simulation_state(), sculpt_cloth_filter_modal(), sculpt_color_presmooth_init(), SCULPT_connected_components_ensure(), SCULPT_do_displacement_smear_brush(), SCULPT_do_layer_brush(), SCULPT_do_smear_brush(), SCULPT_enhance_details_brush(), sculpt_expand_bitmap_from_enabled(), sculpt_expand_boundary_from_enabled(), sculpt_expand_boundary_topology_falloff_create(), sculpt_expand_diagonals_falloff_create(), sculpt_expand_geodesics_from_state_boundary(), sculpt_expand_initialize_from_face_set_boundary(), sculpt_expand_invoke(), sculpt_expand_modal(), sculpt_expand_normal_falloff_create(), sculpt_expand_original_state_store(), sculpt_expand_reposition_pivot(), sculpt_expand_spherical_falloff_create(), sculpt_expand_topology_falloff_create(), sculpt_expand_topology_from_state_boundary(), sculpt_expand_update_max_vert_falloff_value(), sculpt_face_set_create_exec(), sculpt_face_set_edit_fair_face_set(), sculpt_face_sets_automasking_init(), sculpt_face_sets_change_visibility_exec(), SCULPT_fake_neighbor_init(), SCULPT_fake_neighbors_ensure(), SCULPT_floodfill_init(), SCULPT_geometry_preview_lines_update(), sculpt_gesture_trim_calculate_depth(), sculpt_mask_by_color_contiguous(), sculpt_mask_expand_invoke(), sculpt_mask_filter_exec(), sculpt_pose_grow_pose_factor(), sculpt_set_persistent_base_exec(), and SCULPT_topology_automasking_init().
int SCULPT_vertex_face_set_get | ( | SculptSession * | ss, |
int | index | ||
) |
Definition at line 508 of file sculpt.c.
References blender::math::abs(), BKE_pbvh_get_grid_key(), BKE_pbvh_type(), BKE_subdiv_ccg_grid_to_face_index(), MeshElemMap::count, SculptSession::face_sets, CCGKey::grid_area, MeshElemMap::indices, SculptSession::pbvh, PBVH_BMESH, PBVH_FACES, PBVH_GRIDS, SculptSession::pmap, and SculptSession::subdiv_ccg.
Referenced by mask_init_task_cb(), pose_face_sets_fk_find_masked_floodfill_cb(), pose_face_sets_floodfill_cb(), and sculpt_expand_state_get().
void SCULPT_vertex_face_set_set | ( | SculptSession * | ss, |
int | index, | ||
int | face_set | ||
) |
Definition at line 483 of file sculpt.c.
References blender::math::abs(), BKE_pbvh_get_grid_key(), BKE_pbvh_type(), BKE_subdiv_ccg_grid_to_face_index(), MeshElemMap::count, SculptSession::face_sets, CCGKey::grid_area, MeshElemMap::indices, SculptSession::pbvh, PBVH_BMESH, PBVH_FACES, PBVH_GRIDS, SculptSession::pmap, and SculptSession::subdiv_ccg.
Referenced by do_draw_face_sets_brush_task_cb_ex(), face_set_gesture_apply_task_cb(), sculpt_expand_task_cb(), and sculpt_face_set_create_exec().
|
static |
Definition at line 5679 of file sculpt.c.
References SculptVertexInfo::connected_component, SCULPT_TOPOLOGY_ID_DEFAULT, and SculptSession::vertex_info.
Referenced by do_fake_neighbor_search_task_cb(), and SCULPT_fake_neighbor_search().
bool SCULPT_vertex_has_face_set | ( | SculptSession * | ss, |
int | index, | ||
int | face_set | ||
) |
Definition at line 533 of file sculpt.c.
References BKE_pbvh_get_grid_key(), BKE_pbvh_type(), BKE_subdiv_ccg_grid_to_face_index(), MeshElemMap::count, SculptSession::face_sets, CCGKey::grid_area, MeshElemMap::indices, SculptSession::pbvh, PBVH_BMESH, PBVH_FACES, PBVH_GRIDS, SculptSession::pmap, and SculptSession::subdiv_ccg.
Referenced by cloth_filter_apply_forces_task_cb(), pose_face_sets_fk_find_masked_floodfill_cb(), pose_face_sets_fk_set_weights_floodfill_cb(), pose_face_sets_floodfill_cb(), pose_ik_chain_init_face_sets_fk(), SCULPT_automasking_factor_get(), sculpt_expand_initialize_from_face_set_boundary(), sculpt_face_set_edit_fair_face_set(), and sculpt_face_sets_automasking_init().
bool SCULPT_vertex_has_unique_face_set | ( | SculptSession * | ss, |
int | index | ||
) |
Definition at line 662 of file sculpt.c.
References BKE_pbvh_get_grid_key(), BKE_pbvh_type(), BKE_subdiv_ccg_coarse_mesh_adjacency_info_get(), CCGKey::grid_area, SubdivCCGCoord::grid_index, CCGKey::grid_size, SculptSession::mloop, SculptSession::mpoly, SculptSession::pbvh, PBVH_BMESH, PBVH_FACES, PBVH_GRIDS, sculpt_check_unique_face_set_for_edge_in_base_mesh(), sculpt_check_unique_face_set_in_base_mesh(), SculptSession::subdiv_ccg, SUBDIV_CCG_ADJACENT_EDGE, SUBDIV_CCG_ADJACENT_NONE, SUBDIV_CCG_ADJACENT_VERTEX, v1, and v2.
Referenced by do_relax_face_sets_brush_task_cb_ex(), mesh_filter_task_cb(), pose_face_sets_fk_find_masked_floodfill_cb(), pose_face_sets_floodfill_cb(), SCULPT_automasking_factor_get(), SCULPT_boundary_automasking_init(), sculpt_expand_initialize_from_face_set_boundary(), sculpt_face_set_edit_fair_face_set(), and SCULPT_relax_vertex().
bool SCULPT_vertex_is_boundary | ( | const SculptSession * | ss, |
const int | index | ||
) |
Definition at line 865 of file sculpt.c.
References BKE_pbvh_get_grid_key(), BKE_pbvh_type(), BKE_subdiv_ccg_coarse_mesh_adjacency_info_get(), SculptSession::bm, BM_vert_at_index(), BM_vert_is_boundary(), CCGKey::grid_area, SubdivCCGCoord::grid_index, CCGKey::grid_size, SculptSession::mloop, SculptSession::mpoly, SculptSession::pbvh, PBVH_BMESH, PBVH_FACES, PBVH_GRIDS, sculpt_check_boundary_vertex_in_base_mesh(), SCULPT_vertex_all_face_sets_visible_get(), SculptSession::subdiv_ccg, SUBDIV_CCG_ADJACENT_EDGE, SUBDIV_CCG_ADJACENT_NONE, SUBDIV_CCG_ADJACENT_VERTEX, v, v1, and v2.
Referenced by boundary_floodfill_cb(), boundary_initial_vertex_floodfill_cb(), SCULPT_automasking_factor_get(), SCULPT_boundary_automasking_init(), sculpt_boundary_get_closest_boundary_vertex(), sculpt_boundary_is_vertex_in_editable_boundary(), sculpt_expand_boundary_from_enabled(), sculpt_expand_invoke(), sculpt_face_set_edit_fair_face_set(), SCULPT_neighbor_coords_average_interior(), and SCULPT_relax_vertex().
void SCULPT_vertex_limit_surface_get | ( | SculptSession * | ss, |
int | index, | ||
float | r_co[3] | ||
) |
Returns the info of the limit surface when multi-res is available, otherwise it returns the current coordinate of the vertex.
Definition at line 218 of file sculpt.c.
References BKE_pbvh_get_grid_key(), BKE_pbvh_type(), BKE_subdiv_ccg_eval_limit_point(), copy_v3_v3(), CCGKey::grid_area, SubdivCCGCoord::grid_index, CCGKey::grid_size, SculptSession::pbvh, PBVH_BMESH, PBVH_FACES, PBVH_GRIDS, SCULPT_vertex_co_get(), and SculptSession::subdiv_ccg.
Referenced by do_displacement_eraser_brush_task_cb_ex(), do_displacement_smear_brush_task_cb_ex(), mesh_filter_init_limit_surface_co(), and SCULPT_do_displacement_smear_brush().
float SCULPT_vertex_mask_get | ( | SculptSession * | ss, |
int | index | ||
) |
Definition at line 248 of file sculpt.c.
References BKE_pbvh_get_bmesh(), BKE_pbvh_get_grid_key(), BKE_pbvh_get_grids(), BKE_pbvh_type(), SculptSession::bm, BM_ELEM_CD_GET_VOID_P, BM_vert_at_index(), CCG_elem_mask(), CCG_elem_offset(), CD_PAINT_MASK, CustomData_get_offset(), CCGKey::grid_area, mask(), SculptSession::pbvh, PBVH_BMESH, PBVH_FACES, PBVH_GRIDS, v, BMesh::vdata, and SculptSession::vmask.
Referenced by cloth_brush_satisfy_constraints(), sculpt_expand_original_state_store(), sculpt_face_set_create_exec(), sculpt_mask_expand_invoke(), sculpt_mask_filter_exec(), and SCULPT_neighbor_mask_average().
|
static |
Definition at line 717 of file sculpt.c.
References SculptVertexNeighborIter::capacity, MEM_mallocN, MEM_reallocN_id, SculptVertexNeighborIter::neighbors, SculptVertexNeighborIter::neighbors_fixed, SCULPT_VERTEX_NEIGHBOR_FIXED_CAPACITY, and SculptVertexNeighborIter::size.
Referenced by sculpt_vertex_neighbors_get_bmesh(), sculpt_vertex_neighbors_get_faces(), and sculpt_vertex_neighbors_get_grids().
void SCULPT_vertex_neighbors_get | ( | SculptSession * | ss, |
const int | index, | ||
const bool | include_duplicates, | ||
SculptVertexNeighborIter * | iter | ||
) |
Definition at line 841 of file sculpt.c.
References BKE_pbvh_type(), SculptSession::pbvh, PBVH_BMESH, PBVH_FACES, PBVH_GRIDS, sculpt_vertex_neighbors_get_bmesh(), sculpt_vertex_neighbors_get_faces(), and sculpt_vertex_neighbors_get_grids().
|
static |
Definition at line 742 of file sculpt.c.
References ARRAY_SIZE, SculptSession::bm, BM_elem_index_get, BM_ITER_ELEM, BM_LOOPS_OF_VERT, BM_vert_at_index(), SculptVertexNeighborIter::capacity, l, SculptVertexNeighborIter::neighbors, SculptVertexNeighborIter::neighbors_fixed, BMLoop::next, SculptVertexNeighborIter::num_duplicates, BMLoop::prev, sculpt_vertex_neighbor_add(), SCULPT_VERTEX_NEIGHBOR_FIXED_CAPACITY, SculptVertexNeighborIter::size, BMLoop::v, and v.
Referenced by SCULPT_vertex_neighbors_get().
|
static |
Definition at line 765 of file sculpt.c.
References ARRAY_SIZE, BLI_assert, SculptVertexNeighborIter::capacity, MeshElemMap::count, SculptSession::face_sets, SculptFakeNeighbors::fake_neighbor_index, FAKE_NEIGHBOR_NONE, SculptSession::fake_neighbors, MeshElemMap::indices, SculptSession::mloop, SculptSession::mpoly, SculptVertexNeighborIter::neighbors, SculptVertexNeighborIter::neighbors_fixed, NULL, SculptVertexNeighborIter::num_duplicates, SculptSession::pmap, poly_get_adj_loops_from_vert(), sculpt_vertex_neighbor_add(), SCULPT_VERTEX_NEIGHBOR_FIXED_CAPACITY, SculptVertexNeighborIter::size, and SculptFakeNeighbors::use_fake_neighbors.
Referenced by SCULPT_vertex_neighbors_get().
|
static |
Definition at line 799 of file sculpt.c.
References BKE_pbvh_get_grid_key(), BKE_subdiv_ccg_neighbor_coords_get(), BLI_assert, SculptVertexNeighborIter::capacity, SubdivCCGNeighbors::coords, SubdivCCGNeighbors::coords_fixed, SculptFakeNeighbors::fake_neighbor_index, FAKE_NEIGHBOR_NONE, SculptSession::fake_neighbors, CCGKey::grid_area, SubdivCCGCoord::grid_index, CCGKey::grid_size, MEM_freeN, SculptVertexNeighborIter::neighbors, SculptVertexNeighborIter::neighbors_fixed, NULL, SubdivCCGNeighbors::num_duplicates, SculptVertexNeighborIter::num_duplicates, SculptSession::pbvh, sculpt_vertex_neighbor_add(), SCULPT_VERTEX_NEIGHBOR_FIXED_CAPACITY, SubdivCCGNeighbors::size, SculptVertexNeighborIter::size, SculptSession::subdiv_ccg, SculptFakeNeighbors::use_fake_neighbors, SubdivCCGCoord::x, and SubdivCCGCoord::y.
Referenced by SCULPT_vertex_neighbors_get().
void SCULPT_vertex_normal_get | ( | SculptSession * | ss, |
int | index, | ||
float | no[3] | ||
) |
Get the normal for a given sculpt vertex; do not modify the result
Definition at line 171 of file sculpt.c.
References BKE_pbvh_get_bmesh(), BKE_pbvh_get_grid_key(), BKE_pbvh_get_grids(), BKE_pbvh_get_vert_normals(), BKE_pbvh_type(), BM_vert_at_index(), CCG_elem_no(), CCG_elem_offset(), copy_v3_v3(), float(), CCGKey::grid_area, BMVert::no, SculptSession::pbvh, PBVH_BMESH, PBVH_FACES, and PBVH_GRIDS.
Referenced by cloth_filter_apply_forces_task_cb(), do_smear_brush_task_cb_exec(), mask_expand_floodfill_cb(), mask_expand_normal_floodfill_cb(), SCULPT_active_vertex_normal_get(), sculpt_boundary_bend_data_init(), sculpt_expand_normal_falloff_create(), sculpt_gesture_is_vertex_effected(), SCULPT_relax_vertex(), sculpt_set_persistent_base_exec(), and SCULPT_vertex_persistent_normal_get().
const float* SCULPT_vertex_persistent_co_get | ( | SculptSession * | ss, |
int | index | ||
) |
Definition at line 193 of file sculpt.c.
References SculptPersistentBase::co, SculptSession::persistent_base, and SCULPT_vertex_co_get().
Referenced by cloth_brush_add_length_constraint(), and do_layer_brush_task_cb_ex().
void SCULPT_vertex_persistent_normal_get | ( | SculptSession * | ss, |
int | index, | ||
float | no[3] | ||
) |
Definition at line 239 of file sculpt.c.
References copy_v3_v3(), SculptPersistentBase::no, SculptSession::persistent_base, and SCULPT_vertex_normal_get().
Referenced by do_layer_brush_task_cb_ex().
void SCULPT_vertex_random_access_ensure | ( | struct SculptSession * | ss | ) |
Ensure random access; required for PBVH_BMESH
Definition at line 103 of file sculpt.c.
References BKE_pbvh_type(), SculptSession::bm, BM_mesh_elem_index_ensure(), BM_mesh_elem_table_ensure(), BM_VERT, SculptSession::pbvh, and PBVH_BMESH.
Referenced by dyntopo_detail_size_edit_invoke(), ED_sculpt_init_transform(), ED_sculpt_update_modal_transform(), sample_detail_voxel(), SCULPT_automasking_cache_init(), SCULPT_boundary_data_init(), sculpt_cloth_filter_invoke(), sculpt_cloth_filter_modal(), SCULPT_cursor_geometry_info_update(), sculpt_dirty_mask_exec(), SCULPT_enhance_details_brush(), sculpt_expand_ensure_sculptsession_data(), sculpt_face_sets_change_visibility_invoke(), SCULPT_floodfill_init(), sculpt_mask_by_color_invoke(), sculpt_mask_expand_invoke(), sculpt_mask_filter_exec(), sculpt_mesh_filter_invoke(), sculpt_mesh_filter_modal(), SCULPT_pose_calc_pose_data(), sculpt_set_persistent_base_exec(), SCULPT_smooth(), sculpt_trim_gesture_box_invoke(), and sculpt_trim_gesture_lasso_invoke().
bool SCULPT_vertex_visible_get | ( | SculptSession * | ss, |
int | index | ||
) |
Definition at line 356 of file sculpt.c.
References BKE_pbvh_get_grid_key(), BKE_pbvh_get_grid_visibility(), BKE_pbvh_type(), BLI_BITMAP_TEST, SculptSession::bm, BM_elem_flag_test, BM_ELEM_HIDDEN, BM_vert_at_index(), MVert::flag, CCGKey::grid_area, ME_HIDE, SculptSession::mvert, SculptSession::pbvh, PBVH_BMESH, PBVH_FACES, and PBVH_GRIDS.
Referenced by boundary_initial_vertex_floodfill_cb(), sculpt_boundary_edit_data_init(), sculpt_boundary_is_vertex_in_editable_boundary(), sculpt_expand_state_get(), sculpt_face_set_create_exec(), sculpt_face_sets_change_visibility_exec(), SCULPT_floodfill_execute(), SCULPT_visibility_sync_all_vertex_to_face_sets(), and sculpt_visibility_sync_vertex_to_face_sets().
void SCULPT_vertex_visible_set | ( | SculptSession * | ss, |
int | index, | ||
bool | visible | ||
) |
Definition at line 341 of file sculpt.c.
References BKE_pbvh_type(), BKE_pbvh_vert_tag_update_normal(), SculptSession::bm, BM_elem_flag_set, BM_ELEM_HIDDEN, BM_vert_at_index(), MVert::flag, ME_HIDE, SculptSession::mvert, SculptSession::pbvh, PBVH_BMESH, PBVH_FACES, PBVH_GRIDS, and SET_FLAG_FROM_TEST.
Definition at line 557 of file sculpt.c.
References BKE_object_get_original_mesh(), BKE_pbvh_type(), BKE_sculpt_sync_face_sets_visibility_to_base_mesh(), BKE_sculpt_sync_face_sets_visibility_to_grids(), mesh, SculptSession::pbvh, PBVH_BMESH, PBVH_FACES, PBVH_GRIDS, Object::sculpt, and SculptSession::subdiv_ccg.
Referenced by face_set_edit_do_post_visibility_updates(), sculpt_face_set_init_exec(), sculpt_face_sets_change_visibility_exec(), and sculpt_undo_restore_list().
void SCULPT_visibility_sync_all_vertex_to_face_sets | ( | SculptSession * | ss | ) |
Definition at line 591 of file sculpt.c.
References blender::math::abs(), BKE_pbvh_type(), SculptSession::face_sets, l, MPoly::loopstart, SculptSession::mloop, SculptSession::mpoly, SculptSession::pbvh, PBVH_FACES, SCULPT_vertex_visible_get(), SculptSession::totfaces, MPoly::totloop, and MLoop::v.
Referenced by hide_show_exec(), and sculpt_undo_restore_list().
|
static |
Definition at line 576 of file sculpt.c.
References blender::math::abs(), MeshElemMap::indices, and SCULPT_vertex_visible_get().
|
static |
Definition at line 4156 of file sculpt.c.
References BKE_brush_size_set(), BKE_libblock_find_name(), BKE_paint_brush(), BKE_paint_brush_set(), C, CTX_data_main(), CTX_data_scene(), ELEM, ID_BR, Brush::mask_tool, StrokeCache::saved_active_brush_name, StrokeCache::saved_mask_brush_tool, StrokeCache::saved_smooth_size, scene, Brush::sculpt_tool, SCULPT_TOOL_DRAW_FACE_SETS, SCULPT_TOOL_MASK, SCULPT_TOOL_PAINT, SCULPT_TOOL_SLIDE_RELAX, and SCULPT_TOOL_SMEAR.
Referenced by sculpt_stroke_done().
|
static |
Definition at line 4122 of file sculpt.c.
References BKE_brush_size_get(), BKE_brush_size_set(), BKE_curvemapping_init(), BKE_paint_brush_set(), BKE_paint_toolslots_brush_get(), BLI_strncpy(), Paint::brush, BRUSH_MASK_SMOOTH, C, CTX_data_scene(), Brush::curve, ELEM, Brush::id, Brush::mask_tool, ID::name, StrokeCache::saved_active_brush_name, StrokeCache::saved_mask_brush_tool, StrokeCache::saved_smooth_size, scene, Brush::sculpt_tool, SCULPT_TOOL_DRAW_FACE_SETS, SCULPT_TOOL_MASK, SCULPT_TOOL_PAINT, SCULPT_TOOL_SLIDE_RELAX, SCULPT_TOOL_SMEAR, and SCULPT_TOOL_SMOOTH.
Referenced by sculpt_update_cache_invariants().
Definition at line 2773 of file sculpt.c.
References BKE_paint_brush(), StrokeCache::brush_local_mat, SculptSession::cache, calc_brush_local_mat(), StrokeCache::mirror_symmetry_pass, Sculpt::paint, StrokeCache::radial_symmetry_pass, and Object::sculpt.
Referenced by do_brush_action().
|
static |
Definition at line 2664 of file sculpt.c.
References BKE_paint_brush(), BRUSH_ANCHORED, BRUSH_ORIGINAL_NORMAL, SculptSession::cache, calc_sculpt_normal(), copy_v3_v3(), Brush::falloff_shape, Brush::flag, flip_v3(), StrokeCache::mirror_symmetry_pass, mul_m4_v3(), StrokeCache::normal_weight, normalize_v3(), Sculpt::paint, PAINT_FALLOFF_SHAPE_TUBE, project_plane_v3_v3v3(), StrokeCache::radial_symmetry_pass, Object::sculpt, StrokeCache::sculpt_normal, StrokeCache::sculpt_normal_symm, SCULPT_stroke_is_first_brush_step_of_symmetry_pass(), Brush::sculpt_tool, SCULPT_TOOL_ELASTIC_DEFORM, SCULPT_TOOL_GRAB, SCULPT_TOOL_SNAKE_HOOK, SCULPT_TOOL_THUMB, StrokeCache::symm_rot_mat, and StrokeCache::view_normal.
Referenced by do_brush_action().