|
Blender V4.3
|
#include <optional>#include <queue>#include "BKE_attribute.hh"#include "BKE_paint.hh"#include "BKE_pbvh_api.hh"#include "BKE_subdiv_ccg.hh"#include "BLI_array.hh"#include "BLI_generic_array.hh"#include "BLI_math_matrix_types.hh"#include "BLI_math_quaternion_types.hh"#include "BLI_math_vector_types.hh"#include "BLI_set.hh"#include "BLI_span.hh"#include "BLI_vector.hh"#include "DNA_brush_enums.h"#include "ED_view3d.hh"Go to the source code of this file.
Classes | |
| class | blender::ed::sculpt_paint::PositionDeformData |
| struct | SculptCursorGeometryInfo |
| struct | SculptRakeData |
| struct | blender::ed::sculpt_paint::StrokeCache |
| struct | blender::ed::sculpt_paint::OrigPositionData |
Namespaces | |
| namespace | blender |
| namespace | blender::ed |
| namespace | blender::ed::sculpt_paint |
| namespace | blender::ed::sculpt_paint::auto_mask |
| namespace | blender::ed::sculpt_paint::boundary |
| namespace | blender::ed::sculpt_paint::cloth |
| namespace | blender::ed::sculpt_paint::pose |
| namespace | blender::ed::sculpt_paint::undo |
| namespace | blender::ed::sculpt_paint::expand |
| namespace | blender::ed::sculpt_paint::project |
| namespace | blender::ed::sculpt_paint::trim |
| namespace | blender::ed::sculpt_paint::face_set |
| namespace | blender::ed::sculpt_paint::filter |
| namespace | blender::ed::sculpt_paint::color |
| namespace | blender::ed::sculpt_paint::mask |
| namespace | blender::ed::sculpt_paint::dyntopo |
Macros | |
Sculpt Types | |
| #define | SCULPT_RAKE_BRUSH_FACTOR 0.25f |
Sculpt mesh accessor API | |
| #define | FAKE_NEIGHBOR_NONE -1 |
| void | SCULPT_vertex_random_access_ensure (Object &object) |
| int | SCULPT_vertex_count_get (const Object &object) |
| bool | SCULPT_vertex_is_occluded (const Depsgraph &depsgraph, const Object &object, const blender::float3 &position, bool original) |
| blender::Span< int > | SCULPT_fake_neighbors_ensure (const Depsgraph &depsgraph, Object &ob, float max_dist) |
| void | SCULPT_fake_neighbors_free (Object &ob) |
| #define FAKE_NEIGHBOR_NONE -1 |
Definition at line 535 of file sculpt_intern.hh.
Referenced by blender::ed::sculpt_paint::pose::add_fake_neighbors(), blender::ed::sculpt_paint::fake_neighbor_init(), blender::ed::sculpt_paint::fake_neighbor_search(), blender::ed::sculpt_paint::fake_neighbor_search_bmesh(), blender::ed::sculpt_paint::fake_neighbor_search_grids(), blender::ed::sculpt_paint::fake_neighbor_search_mesh(), blender::ed::sculpt_paint::pose::grow_factors_bmesh(), and blender::ed::sculpt_paint::pose::grow_factors_grids().
| #define SCULPT_RAKE_BRUSH_FACTOR 0.25f |
Definition at line 131 of file sculpt_intern.hh.
Referenced by blender::ed::sculpt_paint::brush_delta_update().
| void sculpt_apply_texture | ( | const SculptSession & | ss, |
| const Brush & | brush, | ||
| const float | brush_point[3], | ||
| int | thread_id, | ||
| float * | r_value, | ||
| float | r_rgba[4] ) |
Sample the brush's texture value.
Definition at line 2219 of file sculpt.cc.
References add_v3_fl(), BKE_brush_mask_texture_get(), BKE_brush_sample_tex_3d(), blender::ed::sculpt_paint::StrokeCache::brush_local_mat, MTex::brush_map_mode, SculptSession::cache, copy_v4_fl(), ED_view3d_project_float_v2_m4(), blender::ed::sculpt_paint::StrokeCache::mirror_symmetry_pass, MTEX_MAP_MODE_3D, MTEX_MAP_MODE_AREA, mul_m4_v3(), OB_MODE_SCULPT, MTex::ofs, paint_get_tex_pixel(), blender::ed::sculpt_paint::StrokeCache::plane_offset, blender::ed::sculpt_paint::StrokeCache::projection_mat, blender::MatBase< T, NumCol, NumRow, Alignment >::ptr(), blender::ed::sculpt_paint::StrokeCache::radial_symmetry_pass, ViewContext::region, ViewContext::scene, MTex::size, sub_v3_v3v3(), blender::ed::sculpt_paint::StrokeCache::symm_rot_mat_inv, blender::ed::sculpt_paint::symmetry_flip(), MTex::tex, SculptSession::tex_pool, Brush::texture_sample_bias, and blender::ed::sculpt_paint::StrokeCache::vc.
Referenced by blender::ed::sculpt_paint::calc_brush_texture_factors(), and blender::ed::sculpt_paint::calc_brush_texture_factors().
| bool SCULPT_brush_cursor_poll | ( | bContext * | C | ) |
Determines whether or not the brush cursor should be shown in the viewport
Definition at line 3617 of file sculpt.cc.
References is_brush_related_tool(), and SCULPT_mode_poll().
Referenced by blender::ed::sculpt_paint::object_sculpt_mode_enter().
| const float * SCULPT_brush_frontface_normal_from_falloff_shape | ( | const SculptSession & | ss, |
| char | falloff_shape ) |
Definition at line 1212 of file sculpt.cc.
References BLI_assert, SculptSession::cache, PAINT_FALLOFF_SHAPE_SPHERE, PAINT_FALLOFF_SHAPE_TUBE, blender::ed::sculpt_paint::StrokeCache::sculpt_normal_symm, and blender::ed::sculpt_paint::StrokeCache::view_normal_symm.
Referenced by calculate_average_weight(), do_vpaint_brush_blur_loops(), do_vpaint_brush_blur_verts(), do_vpaint_brush_smear(), do_wpaint_brush_blur(), do_wpaint_brush_draw(), do_wpaint_brush_smear(), and vpaint_do_draw().
| float SCULPT_brush_plane_offset_get | ( | const Sculpt & | sd, |
| const SculptSession & | ss ) |
Definition at line 2883 of file sculpt.cc.
References BKE_paint_brush_for_read(), BRUSH_OFFSET_PRESSURE, SculptSession::cache, Brush::flag, Sculpt::paint, Brush::plane_offset, and blender::ed::sculpt_paint::StrokeCache::pressure.
Referenced by blender::ed::sculpt_paint::do_clay_brush(), blender::ed::sculpt_paint::do_clay_strips_brush(), and blender::ed::sculpt_paint::do_multiplane_scrape_brush().
| BLI_INLINE bool SCULPT_brush_type_is_attribute_only | ( | int | tool | ) |
Definition at line 946 of file sculpt_intern.hh.
References ELEM, SCULPT_BRUSH_TYPE_DRAW_FACE_SETS, SCULPT_brush_type_is_mask(), and SCULPT_brush_type_is_paint().
Referenced by blender::ed::sculpt_paint::sculpt_brush_stroke_invoke().
|
inline |
Definition at line 941 of file sculpt_intern.hh.
References ELEM, and SCULPT_BRUSH_TYPE_MASK.
Referenced by blender::ed::sculpt_paint::sculpt_brush_stroke_invoke(), and SCULPT_brush_type_is_attribute_only().
|
inline |
Definition at line 936 of file sculpt_intern.hh.
References ELEM, SCULPT_BRUSH_TYPE_PAINT, and SCULPT_BRUSH_TYPE_SMEAR.
Referenced by brush_stroke_init(), blender::ed::sculpt_paint::push_undo_nodes(), blender::ed::sculpt_paint::sculpt_brush_stroke_invoke(), SCULPT_brush_type_is_attribute_only(), blender::ed::sculpt_paint::sculpt_needs_connectivity_info(), SCULPT_stroke_modifiers_check(), blender::ed::sculpt_paint::stroke_test_start(), and blender::ed::sculpt_paint::stroke_update_step().
| bool SCULPT_brush_type_needs_all_pbvh_nodes | ( | const Brush & | brush | ) |
Definition at line 2754 of file sculpt.cc.
References BRUSH_SNAKE_HOOK_DEFORM_ELASTIC, Brush::sculpt_brush_type, SCULPT_BRUSH_TYPE_BOUNDARY, SCULPT_BRUSH_TYPE_ELASTIC_DEFORM, SCULPT_BRUSH_TYPE_POSE, SCULPT_BRUSH_TYPE_SNAKE_HOOK, and Brush::snake_hook_deform_type.
Referenced by blender::ed::sculpt_paint::do_brush_action().
| void SCULPT_cache_calc_brushdata_symm | ( | blender::ed::sculpt_paint::StrokeCache & | cache, |
| ePaintSymmetryFlags | 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 3346 of file sculpt.cc.
References flip_qt_qt(), frac(), blender::ed::sculpt_paint::StrokeCache::grab_delta, blender::ed::sculpt_paint::StrokeCache::grab_delta_symm, blender::ed::sculpt_paint::StrokeCache::gravity_direction, blender::ed::sculpt_paint::StrokeCache::gravity_direction_symm, blender::ed::sculpt_paint::StrokeCache::initial_location, blender::ed::sculpt_paint::StrokeCache::initial_location_symm, blender::ed::sculpt_paint::StrokeCache::initial_normal, blender::ed::sculpt_paint::StrokeCache::initial_normal_symm, blender::ed::sculpt_paint::StrokeCache::last_location, blender::ed::sculpt_paint::StrokeCache::last_location_symm, blender::ed::sculpt_paint::StrokeCache::location, blender::ed::sculpt_paint::StrokeCache::location_symm, mul_m4_v3(), mul_v3_fl(), PAINT_SYMMETRY_FEATHER, blender::ed::sculpt_paint::StrokeCache::plane_offset, printf, blender::MatBase< T, NumCol, NumRow, Alignment >::ptr(), blender::ed::sculpt_paint::StrokeCache::rake_rotation, blender::ed::sculpt_paint::StrokeCache::rake_rotation_symm, rotate_m4(), blender::ed::sculpt_paint::StrokeCache::supports_gravity, blender::ed::sculpt_paint::StrokeCache::symm_rot_mat, blender::ed::sculpt_paint::StrokeCache::symm_rot_mat_inv, blender::ed::sculpt_paint::StrokeCache::view_normal, blender::ed::sculpt_paint::StrokeCache::view_normal_symm, and zero_v3().
Referenced by blender::ed::sculpt_paint::do_radial_symmetry(), blender::ed::sculpt_paint::do_symmetrical_brush_actions(), vpaint_do_paint(), vpaint_do_symmetrical_brush_actions(), wpaint_do_paint(), and wpaint_do_symmetrical_brush_actions().
| void SCULPT_calc_vertex_displacement | ( | const SculptSession & | ss, |
| const Brush & | brush, | ||
| float | rgba[3], | ||
| float | r_offset[3] ) |
Calculates the vertex offset for a single vertex depending on the brush setting rgb as vector displacement.
Definition at line 2285 of file sculpt.cc.
References blender::ed::sculpt_paint::StrokeCache::brush_local_mat_inv, blender::ed::sculpt_paint::StrokeCache::bstrength, SculptSession::cache, copy_v3_v3(), blender::ed::sculpt_paint::StrokeCache::mirror_symmetry_pass, Brush::mtex, mul_m4_v3(), mul_mat3_m4_v3(), mul_v3_fl(), pow2f(), blender::MatBase< T, NumCol, NumRow, Alignment >::ptr(), blender::ed::sculpt_paint::StrokeCache::radial_symmetry_pass, blender::math::safe_divide(), MTex::size, blender::ed::sculpt_paint::StrokeCache::symm_rot_mat, and blender::ed::sculpt_paint::symmetry_flip().
Definition at line 519 of file sculpt.cc.
Referenced by blender::ed::sculpt_paint::pose::calc_pose_origin_and_factor_bmesh(), blender::ed::sculpt_paint::pose::calc_pose_origin_and_factor_grids(), blender::ed::sculpt_paint::pose::calc_pose_origin_and_factor_mesh(), blender::ed::sculpt_paint::filter_verts_outside_symmetry_area(), blender::ed::sculpt_paint::pose::grow_factors_bmesh(), blender::ed::sculpt_paint::pose::grow_factors_grids(), blender::ed::sculpt_paint::pose::grow_factors_mesh(), blender::ed::sculpt_paint::pose::ik_chain_init_face_sets_bmesh(), blender::ed::sculpt_paint::pose::ik_chain_init_face_sets_grids(), blender::ed::sculpt_paint::pose::ik_chain_init_face_sets_mesh(), and blender::ed::sculpt_paint::expand::reposition_pivot().
| void SCULPT_cube_tip_init | ( | const Sculpt & | sd, |
| const Object & | ob, | ||
| const Brush & | brush, | ||
| float | mat[4][4] ) |
Definition at line 6024 of file sculpt.cc.
References SculptSession::cache, invert_m4_m4(), mul_m4_m4m4(), mul_v3_fl(), normalize_m4(), blender::ed::sculpt_paint::StrokeCache::radius, scale_m4_fl(), Object::sculpt, Brush::tip_scale_x, and zero_m4().
Referenced by blender::ed::sculpt_paint::color::do_paint_brush().
| 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 4580 of file sculpt.cc.
References SculptSession::active_face_index, SculptSession::active_grid_index, SculptSession::active_vert_position(), add_v3_v3(), BKE_base_is_visible(), BKE_brush_size_get(), BKE_brush_unprojected_radius_get(), BKE_brush_use_locked_size(), BKE_paint_brush_for_read(), BKE_paint_get_active_from_context(), blender::bke::pbvh::BMesh, SculptSession::clear_active_vert(), copy_m3_m4(), copy_v3_v3(), CTX_data_active_base(), CTX_data_depsgraph_pointer(), CTX_data_scene(), CTX_wm_view3d(), SculptSession::cursor_location, SculptSession::cursor_normal, SculptSession::cursor_radius, SculptSession::cursor_sampled_normal, SculptSession::cursor_view_normal, Object::data, depsgraph, ED_view3d_viewcontext_init(), blender::bke::Face, blender::bke::pbvh::Grids, invert_m4_m4(), isect_ray_tri_watertight_v3_precalc(), blender::bke::AttributeAccessor::lookup(), blender::bke::pbvh::Mesh, mul_m3_v3(), mul_v3_fl(), normalize_v3_v3(), ViewContext::obact, SculptRaycastData::original, paint_calc_object_space_radius(), blender::bke::object::pbvh_get(), blender::bke::pbvh::raycast(), Object::runtime, SculptSession::rv3d, ViewContext::rv3d, Object::sculpt, sculpt_raycast_cb(), SCULPT_raycast_init(), SCULPT_stroke_modifiers_check(), SCULPT_vertex_random_access_ensure(), SculptSession::set_active_vert(), SculptSession::subdiv_ccg, blender::bke::pbvh::Tree::type(), blender::bke::pbvh::update_normals(), SculptSession::v3d, ViewContext::v3d, blender::bke::pbvh::vert_positions_eval(), RegionView3D::viewinv, and zero_v3().
Referenced by blender::ed::sculpt_paint::face_set::active_update_and_get(), blender::ed::sculpt_paint::face_set::change_visibility_invoke(), blender::ed::sculpt_paint::face_set::edit_op_invoke(), blender::ed::sculpt_paint::trim::initialize_cursor_info(), blender::ed::sculpt_paint::mask::mask_by_color_invoke(), blender::ed::sculpt_paint::paint_cursor_sculpt_session_update_and_init(), blender::ed::sculpt_paint::dyntopo::sample_detail_voxel(), blender::ed::sculpt_paint::cloth::sculpt_cloth_filter_invoke(), blender::ed::sculpt_paint::color::sculpt_color_filter_init(), blender::ed::sculpt_paint::filter::sculpt_mesh_filter_start(), blender::ed::sculpt_paint::stroke_test_start(), and blender::ed::sculpt_paint::expand::target_vert_update_and_get().
| void SCULPT_do_paint_brush_image | ( | const Scene & | scene, |
| const Depsgraph & | depsgraph, | ||
| PaintModeSettings & | paint_mode_settings, | ||
| const Sculpt & | sd, | ||
| Object & | ob, | ||
| const blender::IndexMask & | node_mask ) |
Definition at line 502 of file sculpt_paint_image.cc.
References BKE_paint_brush_for_read(), depsgraph, blender::ed::sculpt_paint::paint::image::do_paint_pixels(), blender::ed::sculpt_paint::paint::image::do_push_undo_tile(), blender::ed::sculpt_paint::paint::image::fix_non_manifold_seam_bleeding(), blender::index_mask::IndexMask::foreach_index(), blender::ed::sculpt_paint::paint::image::ImageData::image, blender::ed::sculpt_paint::paint::image::ImageData::image_user, blender::ed::sculpt_paint::paint::image::ImageData::init_active_image(), blender::bke::pbvh::Tree::nodes(), and Sculpt::paint.
Referenced by blender::ed::sculpt_paint::color::do_paint_brush().
| blender::Span< int > SCULPT_fake_neighbors_ensure | ( | const Depsgraph & | depsgraph, |
| Object & | ob, | ||
| float | max_dist ) |
This allows the sculpt brushes to work on meshes with multiple connected components as if they had only one connected component. These neighbors are calculated for each vertex using the minimum distance to a vertex that is in a different connected component.
Definition at line 5795 of file sculpt.cc.
References SculptFakeNeighbors::current_max_distance, depsgraph, SculptFakeNeighbors::fake_neighbor_index, SculptSession::fake_neighbors, blender::Array< T, InlineBufferCapacity, Allocator >::is_empty(), and Object::sculpt.
Referenced by blender::ed::sculpt_paint::pose::ik_chain_init().
| void SCULPT_fake_neighbors_free | ( | Object & | ob | ) |
Definition at line 5817 of file sculpt.cc.
References Object::sculpt.
Referenced by blender::ed::sculpt_paint::flush_update_done(), and blender::ed::sculpt_paint::pose::ik_chain_init().
| void SCULPT_flip_quat_by_symm_area | ( | float | quat[4], |
| ePaintSymmetryFlags | symm, | ||
| ePaintSymmetryAreas | symmarea, | ||
| const float | pivot[3] ) |
Definition at line 2735 of file sculpt.cc.
References flip_qt().
Referenced by blender::ed::sculpt_paint::pose::do_pose_brush(), and blender::ed::sculpt_paint::transform_matrices_init().
| blender::float3 SCULPT_flip_v3_by_symm_area | ( | const blender::float3 & | vector, |
| ePaintSymmetryFlags | symm, | ||
| ePaintSymmetryAreas | symmarea, | ||
| const blender::float3 & | pivot ) |
| bool SCULPT_get_redraw_rect | ( | const ARegion & | region, |
| const RegionView3D & | rv3d, | ||
| const Object & | ob, | ||
| rcti & | rect ) |
Get a screen-space rectangle of the modified area.
Definition at line 1191 of file sculpt.cc.
References BKE_pbvh_redraw_BB(), bounds(), and paint_convert_bb_to_rect().
Referenced by blender::ed::sculpt_paint::flush_update_step(), and wpaint_stroke_update_step().
| ePaintSymmetryAreas SCULPT_get_vertex_symm_area | ( | const float | co[3] | ) |
Definition at line 2671 of file sculpt.cc.
References PAINT_SYMM_AREA_DEFAULT, PAINT_SYMM_AREA_X, PAINT_SYMM_AREA_Y, and PAINT_SYMM_AREA_Z.
Referenced by blender::ed::sculpt_paint::pose::calc_segment_translations(), blender::ed::sculpt_paint::calc_symm_area_transform_translations(), and blender::ed::sculpt_paint::transform_radius_elastic().
| bool SCULPT_handles_colors_report | ( | const Object & | object, |
| ReportList * | reports ) |
Returns true if sculpt session can handle color attributes (pbvh->type() == bke::pbvh::Type::Mesh). 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 5177 of file sculpt.cc.
References BKE_report(), BLI_assert_unreachable, blender::bke::pbvh::BMesh, blender::bke::pbvh::Grids, blender::bke::pbvh::Mesh, blender::bke::object::pbvh_get(), and RPT_ERROR.
Referenced by blender::ed::sculpt_paint::mask::mask_by_color_invoke(), blender::ed::sculpt_paint::sample_color_invoke(), blender::ed::sculpt_paint::sculpt_brush_stroke_invoke(), and blender::ed::sculpt_paint::color::sculpt_color_filter_init().
| bool SCULPT_is_symmetry_iteration_valid | ( | char | i, |
| char | symm ) |
Definition at line 713 of file sculpt.cc.
References ELEM.
Referenced by blender::ed::sculpt_paint::gesture::apply(), calc_symmetry_feather(), blender::ed::sculpt_paint::do_symmetrical_brush_actions(), blender::ed::sculpt_paint::expand::find_active_connected_components_from_vert(), blender::ed::sculpt_paint::find_symm_verts_bmesh(), blender::ed::sculpt_paint::find_symm_verts_grids(), blender::ed::sculpt_paint::find_symm_verts_mesh(), SCULPT_is_vertex_inside_brush_radius_symm(), blender::ed::sculpt_paint::transform_radius_elastic(), and blender::ed::sculpt_paint::pose::vert_inside_brush_radius().
| 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 718 of file sculpt.cc.
References len_squared_v3v3(), SCULPT_is_symmetry_iteration_valid(), and blender::ed::sculpt_paint::symmetry_flip().
Referenced by blender::ed::sculpt_paint::auto_mask::fill_topology_automasking_factors_bmesh(), blender::ed::sculpt_paint::auto_mask::fill_topology_automasking_factors_grids(), and blender::ed::sculpt_paint::auto_mask::fill_topology_automasking_factors_mesh().
| ePaintSymmetryFlags SCULPT_mesh_symmetry_xyz_get | ( | const Object & | object | ) |
Definition at line 186 of file sculpt.cc.
Referenced by blender::ed::sculpt_paint::boundary::calc_bend_bmesh(), blender::ed::sculpt_paint::boundary::calc_bend_grids(), blender::ed::sculpt_paint::boundary::calc_bend_mesh(), blender::ed::sculpt_paint::boundary::calc_grab_bmesh(), blender::ed::sculpt_paint::boundary::calc_grab_grids(), blender::ed::sculpt_paint::boundary::calc_grab_mesh(), blender::ed::sculpt_paint::boundary::calc_inflate_bmesh(), blender::ed::sculpt_paint::boundary::calc_inflate_grids(), blender::ed::sculpt_paint::boundary::calc_inflate_mesh(), blender::ed::sculpt_paint::pose::calc_pose_origin_and_factor_bmesh(), blender::ed::sculpt_paint::pose::calc_pose_origin_and_factor_grids(), blender::ed::sculpt_paint::pose::calc_pose_origin_and_factor_mesh(), blender::ed::sculpt_paint::boundary::calc_slide_bmesh(), blender::ed::sculpt_paint::boundary::calc_slide_grids(), blender::ed::sculpt_paint::boundary::calc_slide_mesh(), blender::ed::sculpt_paint::boundary::calc_smooth_bmesh(), blender::ed::sculpt_paint::boundary::calc_smooth_grids(), blender::ed::sculpt_paint::boundary::calc_smooth_mesh(), blender::ed::sculpt_paint::boundary::calc_twist_bmesh(), blender::ed::sculpt_paint::boundary::calc_twist_grids(), blender::ed::sculpt_paint::boundary::calc_twist_mesh(), blender::ed::sculpt_paint::cursor_draw_point_with_symmetry(), blender::ed::sculpt_paint::pose::do_pose_brush(), blender::ed::sculpt_paint::do_symmetrical_brush_actions(), blender::ed::sculpt_paint::auto_mask::fill_topology_automasking_factors_bmesh(), blender::ed::sculpt_paint::auto_mask::fill_topology_automasking_factors_grids(), blender::ed::sculpt_paint::auto_mask::fill_topology_automasking_factors_mesh(), blender::ed::sculpt_paint::expand::find_active_connected_components_from_vert(), blender::ed::sculpt_paint::find_symm_verts_bmesh(), blender::ed::sculpt_paint::find_symm_verts_grids(), blender::ed::sculpt_paint::find_symm_verts_mesh(), blender::ed::sculpt_paint::pose::grow_pose_factor(), blender::ed::sculpt_paint::pose::ik_chain_init_face_sets_bmesh(), blender::ed::sculpt_paint::pose::ik_chain_init_face_sets_grids(), blender::ed::sculpt_paint::pose::ik_chain_init_face_sets_mesh(), blender::ed::sculpt_paint::gesture::init_common(), blender::ed::sculpt_paint::expand::reposition_pivot(), blender::ed::sculpt_paint::sculpt_transform_all_vertices(), blender::ed::sculpt_paint::set_pivot_position_exec(), blender::ed::sculpt_paint::transform_node_bmesh(), blender::ed::sculpt_paint::transform_node_grids(), blender::ed::sculpt_paint::transform_node_mesh(), blender::ed::sculpt_paint::transform_radius_elastic(), vpaint_do_symmetrical_brush_actions(), and wpaint_do_symmetrical_brush_actions().
| bool SCULPT_mode_poll | ( | bContext * | C | ) |
Definition at line 3560 of file sculpt.cc.
References CTX_data_active_object(), Object::mode, and OB_MODE_SCULPT.
Referenced by ED_keymap_paint(), blender::ed::sculpt_paint::no_multires_poll(), blender::ed::sculpt_paint::mask::PAINT_OT_mask_flood_fill(), blender::ed::sculpt_paint::dyntopo::sculpt_and_constant_or_manual_detail_poll(), blender::ed::sculpt_paint::dyntopo::sculpt_and_dynamic_topology_poll(), SCULPT_brush_cursor_poll(), SCULPT_mode_poll_view3d(), blender::ed::sculpt_paint::cloth::SCULPT_OT_cloth_filter(), blender::ed::sculpt_paint::color::SCULPT_OT_color_filter(), blender::ed::sculpt_paint::dyntopo::SCULPT_OT_dynamic_topology_toggle(), blender::ed::sculpt_paint::expand::SCULPT_OT_expand(), blender::ed::sculpt_paint::face_set::SCULPT_OT_face_set_change_visibility(), blender::ed::sculpt_paint::face_set::SCULPT_OT_face_sets_create(), blender::ed::sculpt_paint::face_set::SCULPT_OT_face_sets_edit(), blender::ed::sculpt_paint::face_set::SCULPT_OT_face_sets_init(), blender::ed::sculpt_paint::face_set::SCULPT_OT_face_sets_randomize_colors(), blender::ed::sculpt_paint::mask::SCULPT_OT_mask_by_color(), blender::ed::sculpt_paint::mask::SCULPT_OT_mask_filter(), blender::ed::sculpt_paint::mask::SCULPT_OT_mask_from_boundary(), blender::ed::sculpt_paint::mask::SCULPT_OT_mask_from_cavity(), blender::ed::sculpt_paint::mask::SCULPT_OT_mask_init(), blender::ed::sculpt_paint::filter::SCULPT_OT_mesh_filter(), blender::ed::sculpt_paint::SCULPT_OT_optimize(), blender::ed::sculpt_paint::SCULPT_OT_sample_color(), blender::ed::sculpt_paint::dyntopo::SCULPT_OT_sample_detail_size(), blender::ed::sculpt_paint::SCULPT_OT_set_persistent_base(), blender::ed::sculpt_paint::SCULPT_OT_set_pivot_position(), and SCULPT_poll().
| bool SCULPT_mode_poll_view3d | ( | bContext * | C | ) |
Definition at line 3566 of file sculpt.cc.
References CTX_wm_region_view3d(), ED_gpencil_session_active(), and SCULPT_mode_poll().
Referenced by blender::ed::sculpt_paint::hide::PAINT_OT_hide_show(), blender::ed::sculpt_paint::hide::PAINT_OT_hide_show_all(), blender::ed::sculpt_paint::hide::PAINT_OT_hide_show_lasso_gesture(), blender::ed::sculpt_paint::hide::PAINT_OT_hide_show_line_gesture(), blender::ed::sculpt_paint::hide::PAINT_OT_hide_show_masked(), blender::ed::sculpt_paint::hide::PAINT_OT_hide_show_polyline_gesture(), blender::ed::sculpt_paint::mask::PAINT_OT_mask_box_gesture(), blender::ed::sculpt_paint::mask::PAINT_OT_mask_lasso_gesture(), blender::ed::sculpt_paint::mask::PAINT_OT_mask_line_gesture(), blender::ed::sculpt_paint::mask::PAINT_OT_mask_polyline_gesture(), blender::ed::sculpt_paint::hide::PAINT_OT_visibility_filter(), blender::ed::sculpt_paint::hide::PAINT_OT_visibility_invert(), blender::ed::sculpt_paint::face_set::SCULPT_OT_face_set_box_gesture(), blender::ed::sculpt_paint::face_set::SCULPT_OT_face_set_lasso_gesture(), blender::ed::sculpt_paint::face_set::SCULPT_OT_face_set_line_gesture(), blender::ed::sculpt_paint::face_set::SCULPT_OT_face_set_polyline_gesture(), blender::ed::sculpt_paint::project::SCULPT_OT_project_line_gesture(), blender::ed::sculpt_paint::trim::SCULPT_OT_trim_box_gesture(), blender::ed::sculpt_paint::trim::SCULPT_OT_trim_lasso_gesture(), blender::ed::sculpt_paint::trim::SCULPT_OT_trim_line_gesture(), and blender::ed::sculpt_paint::trim::SCULPT_OT_trim_polyline_gesture().
| bool SCULPT_paint_image_canvas_get | ( | PaintModeSettings & | paint_mode_settings, |
| Object & | ob, | ||
| Image ** | r_image, | ||
| ImageUser ** | r_image_user ) |
Get the image canvas for painting on the given object.
Definition at line 471 of file sculpt_paint_image.cc.
References blender::ed::sculpt_paint::paint::image::ImageData::image, blender::ed::sculpt_paint::paint::image::ImageData::image_user, and blender::ed::sculpt_paint::paint::image::ImageData::init_active_image().
Referenced by sculpt_needs_pbvh_pixels(), and sculpt_pbvh_update_pixels().
| bool SCULPT_poll | ( | bContext * | C | ) |
Checks for a brush, not just sculpt mode.
Definition at line 3572 of file sculpt.cc.
References blender::ed::sculpt_paint::paint_brush_tool_poll(), and SCULPT_mode_poll().
Referenced by blender::ed::sculpt_paint::SCULPT_OT_brush_stroke().
| void sculpt_project_v3_normal_align | ( | const SculptSession & | ss, |
| float | normal_weight, | ||
| float | grab_delta[3] ) |
Align the grab delta to the brush normal.
| grab_delta | Typically from ss.cache->grab_delta_symmetry. |
Definition at line 538 of file sculpt.cc.
References SculptSession::cache, dot_v3v3(), fabsf, madd_v3_v3fl(), mul_v3_fl(), project_plane_v3_v3v3(), blender::ed::sculpt_paint::StrokeCache::sculpt_normal_symm, and blender::ed::sculpt_paint::StrokeCache::view_normal_symm.
Referenced by blender::ed::sculpt_paint::do_elastic_deform_brush(), blender::ed::sculpt_paint::do_grab_brush(), and blender::ed::sculpt_paint::do_snake_hook_brush().
| 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 4536 of file sculpt.cc.
References blender::bke::pbvh::clip_ray_ortho(), ViewContext::depsgraph, ED_view3d_win_to_origin(), ED_view3d_win_to_segment_clipped(), invert_m4_m4(), RegionView3D::is_persp, len_v3v3(), mul_m4_v3(), normalize_v3(), ViewContext::obact, blender::bke::object::pbvh_get(), ViewContext::region, ViewContext::rv3d, RV3D_CLIPPING_ENABLED, sub_v3_v3v3(), and ViewContext::v3d.
Referenced by blender::ed::sculpt_paint::dyntopo::sample_detail_dyntopo(), SCULPT_cursor_geometry_info_update(), SCULPT_stroke_get_location_ex(), and SCULPT_vertex_is_occluded().
| bool SCULPT_stroke_get_location | ( | bContext * | C, |
| float | out[3], | ||
| const float | mouse[2], | ||
| bool | force_original ) |
Definition at line 4732 of file sculpt.cc.
References BKE_paint_brush(), BKE_paint_get_active_from_context(), Brush::falloff_shape, PAINT_FALLOFF_SHAPE_TUBE, and SCULPT_stroke_get_location_ex().
Referenced by blender::ed::sculpt_paint::filter::cache_init(), blender::ed::sculpt_paint::paint_brush_stroke_add_step(), blender::ed::sculpt_paint::paint_line_strokes_spacing(), blender::ed::sculpt_paint::paint_space_stroke(), blender::ed::sculpt_paint::paint_stroke_curve_end(), blender::ed::sculpt_paint::paint_stroke_modal(), blender::ed::sculpt_paint::sculpt_brush_stroke_exec(), blender::ed::sculpt_paint::sculpt_brush_stroke_invoke(), blender::ed::sculpt_paint::set_pivot_position_exec(), vpaint_exec(), vpaint_invoke(), wpaint_exec(), and wpaint_invoke().
| bool SCULPT_stroke_get_location_ex | ( | bContext * | C, |
| float | out[3], | ||
| const float | mval[2], | ||
| bool | force_original, | ||
| bool | check_closest, | ||
| bool | limit_closest_radius ) |
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.
If check_closest is true and the ray test fails a point closest to the ray will be found. If limit_closest_radius is true then the closest point will be tested against the active brush radius.
Definition at line 4743 of file sculpt.cc.
References blender::ed::sculpt_paint::StrokeCache::accum, add_v3_v3(), BKE_paint_brush(), BKE_paint_get_active_from_context(), SculptSession::bm, BM_mesh_elem_index_ensure(), BM_mesh_elem_table_ensure(), BM_VERT, blender::bke::pbvh::BMesh, SculptSession::cache, copy_v3_v3(), SculptRaycastData::corner_tris, SculptRaycastData::corner_verts, CTX_data_depsgraph_pointer(), CTX_data_scene(), Object::data, depsgraph, SculptRaycastData::depth, ED_view3d_viewcontext_init(), blender::bke::Face, SculptRaycastData::faces, blender::bke::pbvh::find_nearest_to_ray(), blender::bke::pbvh::Grids, SculptRaycastData::hide_poly, SculptRaycastData::hit, SculptRaycastData::isect_precalc, isect_ray_tri_watertight_v3_precalc(), blender::bke::AttributeAccessor::lookup(), blender::bke::pbvh::Mesh, mul_v3_fl(), ViewContext::obact, SculptRaycastData::object, SculptFindNearestToRayData::original, SculptRaycastData::original, blender::bke::object::pbvh_get(), SculptRaycastData::ray_normal, SculptRaycastData::ray_start, blender::bke::pbvh::raycast(), Object::sculpt, sculpt_find_nearest_to_ray_cb(), sculpt_raycast_cb(), SCULPT_raycast_init(), SCULPT_stroke_modifiers_check(), SCULPT_vertex_random_access_ensure(), SculptRaycastData::ss, SculptRaycastData::subdiv_ccg, SculptSession::subdiv_ccg, blender::bke::pbvh::Tree::type(), SculptRaycastData::vert_positions, and blender::bke::pbvh::vert_positions_eval().
Referenced by over_mesh(), and SCULPT_stroke_get_location().
| bool SCULPT_stroke_is_first_brush_step | ( | const blender::ed::sculpt_paint::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 507 of file sculpt.cc.
References blender::ed::sculpt_paint::StrokeCache::first_time, blender::ed::sculpt_paint::StrokeCache::mirror_symmetry_pass, blender::ed::sculpt_paint::StrokeCache::radial_symmetry_pass, and blender::ed::sculpt_paint::StrokeCache::tile_pass.
Referenced by blender::ed::sculpt_paint::do_brush_action(), blender::ed::sculpt_paint::cloth::do_cloth_brush(), blender::ed::sculpt_paint::do_enhance_details_brush(), and blender::ed::sculpt_paint::color::do_paint_brush().
| bool SCULPT_stroke_is_first_brush_step_of_symmetry_pass | ( | const blender::ed::sculpt_paint::StrokeCache & | cache | ) |
Returns true on the first brush step of each symmetry pass.
Definition at line 513 of file sculpt.cc.
References blender::ed::sculpt_paint::StrokeCache::first_time.
Referenced by blender::ed::sculpt_paint::brush_delta_update(), blender::ed::sculpt_paint::calc_brush_plane(), blender::ed::sculpt_paint::boundary::do_boundary_brush(), blender::ed::sculpt_paint::do_clay_thumb_brush(), blender::ed::sculpt_paint::cloth::do_cloth_brush(), blender::ed::sculpt_paint::do_multiplane_scrape_brush(), blender::ed::sculpt_paint::color::do_paint_brush(), blender::ed::sculpt_paint::do_pinch_brush(), blender::ed::sculpt_paint::do_topology_relax_brush(), blender::ed::sculpt_paint::do_topology_slide_brush(), blender::ed::sculpt_paint::paint_cursor_cursor_draw_3d_view_brush_cursor_active(), blender::ed::sculpt_paint::sculpt_update_cache_variants(), and blender::ed::sculpt_paint::update_sculpt_normal().
| bool SCULPT_stroke_is_main_symmetry_pass | ( | const blender::ed::sculpt_paint::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 501 of file sculpt.cc.
References blender::ed::sculpt_paint::StrokeCache::mirror_symmetry_pass, blender::ed::sculpt_paint::StrokeCache::radial_symmetry_pass, and blender::ed::sculpt_paint::StrokeCache::tile_pass.
Referenced by blender::ed::sculpt_paint::calc_brush_plane(), blender::ed::sculpt_paint::do_brush_action(), and blender::ed::sculpt_paint::do_clay_thumb_brush().
Definition at line 4358 of file sculpt.cc.
References BKE_sculpt_update_object_for_edit(), BKE_sculptsession_use_pbvh_draw(), CTX_data_depsgraph_pointer(), CTX_data_tool_settings(), CTX_wm_region_view3d(), SculptSession::deform_modifiers_active, depsgraph, Object::sculpt, ToolSettings::sculpt, Brush::sculpt_brush_type, SCULPT_brush_type_is_paint(), and SculptSession::shapekey_active.
Referenced by blender::ed::sculpt_paint::dyntopo::sample_detail_dyntopo(), SCULPT_cursor_geometry_info_update(), SCULPT_stroke_get_location_ex(), blender::ed::sculpt_paint::stroke_done(), and blender::ed::sculpt_paint::stroke_update_step().
| void SCULPT_tag_update_overlays | ( | bContext * | C | ) |
Should be used after modifying the mask or Face Sets IDs.
Definition at line 735 of file sculpt.cc.
References BKE_sculptsession_use_pbvh_draw(), 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 blender::ed::sculpt_paint::gesture::apply(), blender::ed::sculpt_paint::face_set::create_op_exec(), blender::ed::sculpt_paint::face_set::edit_op_exec(), blender::ed::sculpt_paint::face_set::init_op_exec(), blender::ed::sculpt_paint::mask::mask_flood_fill_exec(), blender::ed::sculpt_paint::mask::mask_from_boundary_exec(), blender::ed::sculpt_paint::mask::mask_from_cavity_exec(), blender::ed::sculpt_paint::face_set::randomize_colors_exec(), blender::ed::sculpt_paint::expand::restore_original_state(), blender::ed::sculpt_paint::mask::sculpt_mask_filter_exec(), and blender::ed::sculpt_paint::mask::sculpt_mask_init_exec().
| void SCULPT_tilt_apply_to_normal | ( | float | r_normal[3], |
| blender::ed::sculpt_paint::StrokeCache * | cache, | ||
| float | tilt_strength ) |
Tilts a normal by the x and y tilt values using the view axis.
Definition at line 2550 of file sculpt.cc.
References M_PI_2, mul_v3_mat3_m4v3(), normalize_v3(), ViewContext::obact, rotate_v3_v3v3fl(), ViewContext::rv3d, SCULPT_TILT_SENSITIVITY, blender::ed::sculpt_paint::StrokeCache::tilt, blender::ed::sculpt_paint::StrokeCache::vc, and RegionView3D::viewinv.
Referenced by blender::ed::sculpt_paint::do_clay_strips_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 2568 of file sculpt.cc.
References SculptSession::cache, copy_v3_v3(), blender::ed::sculpt_paint::StrokeCache::sculpt_normal_symm, SCULPT_tilt_apply_to_normal(), and Brush::tilt_strength_factor.
Referenced by blender::ed::sculpt_paint::do_draw_brush(), and blender::ed::sculpt_paint::do_draw_sharp_brush().
| bool SCULPT_use_image_paint_brush | ( | PaintModeSettings & | settings, |
| Object & | ob ) |
Definition at line 489 of file sculpt_paint_image.cc.
References BKE_paint_canvas_image_get(), image(), OB_MESH, and Object::type.
Referenced by brush_stroke_init(), blender::ed::sculpt_paint::color::do_paint_brush(), blender::ed::sculpt_paint::sculpt_update_cache_invariants(), blender::ed::sculpt_paint::stroke_done(), blender::ed::sculpt_paint::stroke_test_start(), stroke_undo_begin(), stroke_undo_end(), and blender::ed::sculpt_paint::stroke_update_step().
Definition at line 153 of file sculpt.cc.
References BKE_pbvh_get_grid_num_verts(), BLI_assert, SculptSession::bm, BM_mesh_elem_count(), BM_VERT, blender::bke::pbvh::BMesh, blender::bke::pbvh::Grids, blender::bke::pbvh::Mesh, OB_MESH, and blender::bke::object::pbvh_get().
Referenced by blender::ed::sculpt_paint::expand::boundary_from_enabled(), blender::ed::sculpt_paint::expand::boundary_topology_falloff_create(), blender::ed::sculpt_paint::cloth::brush_simulation_create(), blender::ed::sculpt_paint::auto_mask::cache_init(), blender::ed::sculpt_paint::expand::calc_topology_falloff_from_verts(), blender::ed::sculpt_paint::cloth::cloth_brush_satisfy_constraints(), blender::ed::sculpt_paint::expand::diagonals_falloff_create(), blender::ed::sculpt_paint::do_brush_action(), blender::ed::sculpt_paint::do_enhance_details_brush(), blender::ed::sculpt_paint::do_layer_brush(), blender::ed::sculpt_paint::expand::enabled_state_to_bitmap(), blender::ed::sculpt_paint::fake_neighbor_init(), blender::ed::sculpt_paint::pose::grow_pose_factor(), blender::ed::sculpt_paint::pose::ik_chain_init_topology(), blender::ed::sculpt_paint::expand::init_from_face_set_boundary(), blender::ed::sculpt_paint::filter::mesh_filter_sharpen_init(), blender::ed::sculpt_paint::filter::mesh_filter_surface_smooth_init(), blender::ed::sculpt_paint::auto_mask::normal_occlusion_automasking_fill(), blender::ed::sculpt_paint::expand::normals_falloff_create(), blender::ed::sculpt_paint::expand::original_state_store(), blender::ed::sculpt_paint::expand::sculpt_expand_invoke(), blender::ed::sculpt_paint::expand::sculpt_expand_modal(), blender::ed::sculpt_paint::filter::sculpt_filter_specific_init(), blender::ed::sculpt_paint::mask::sculpt_mask_filter_exec(), blender::ed::sculpt_paint::expand::spherical_falloff_create(), blender::ed::sculpt_paint::expand::topology_falloff_create(), blender::ed::sculpt_paint::expand::topology_from_state_boundary(), blender::ed::sculpt_paint::expand::update_max_vert_falloff_value(), and blender::ed::sculpt_paint::hide::visibility_filter_exec().
| bool SCULPT_vertex_is_occluded | ( | const Depsgraph & | depsgraph, |
| const Object & | object, | ||
| const blender::float3 & | position, | ||
| bool | original ) |
| void SCULPT_vertex_random_access_ensure | ( | Object & | object | ) |
Ensure random access; required for blender::bke::pbvh::Type::BMesh
Definition at line 144 of file sculpt.cc.
References SculptSession::bm, BM_mesh_elem_index_ensure(), BM_mesh_elem_table_ensure(), BM_VERT, blender::bke::pbvh::BMesh, and blender::bke::object::pbvh_get().
Referenced by blender::ed::sculpt_paint::auto_mask::cache_init(), blender::ed::sculpt_paint::pose::calc_average_face_set_center(), blender::ed::sculpt_paint::pose::calc_pose_origin_and_factor_bmesh(), blender::ed::sculpt_paint::face_set::change_visibility_invoke(), blender::ed::sculpt_paint::boundary::data_init_bmesh(), blender::ed::sculpt_paint::dyntopo::dyntopo_detail_size_edit_invoke(), blender::ed::sculpt_paint::expand::ensure_sculptsession_data(), blender::ed::sculpt_paint::pose::ik_chain_init_face_sets_fk_bmesh(), blender::ed::sculpt_paint::init_transform(), blender::ed::sculpt_paint::trim::initialize_cursor_info(), blender::ed::sculpt_paint::mask::mask_from_boundary_exec(), blender::ed::sculpt_paint::mask::mask_from_cavity_exec(), blender::ed::sculpt_paint::paint_cursor_draw_3d_view_brush_cursor_inactive(), blender::ed::sculpt_paint::cloth::sculpt_cloth_filter_modal(), SCULPT_cursor_geometry_info_update(), blender::ed::sculpt_paint::filter::sculpt_mesh_filter_apply(), blender::ed::sculpt_paint::filter::sculpt_mesh_filter_start(), SCULPT_stroke_get_location_ex(), SCULPT_vertex_is_occluded(), and blender::ed::sculpt_paint::update_modal_transform().