|
Blender V5.0
|
#include <cmath>#include <cstdlib>#include <cstring>#include "MEM_guardedalloc.h"#include "CLG_log.h"#include "BLI_array_utils.hh"#include "BLI_atomic_disjoint_set.hh"#include "BLI_dial_2d.h"#include "BLI_enumerable_thread_specific.hh"#include "BLI_listbase.h"#include "BLI_math_axis_angle.hh"#include "BLI_math_geom.h"#include "BLI_math_matrix.h"#include "BLI_math_matrix.hh"#include "BLI_math_rotation.h"#include "BLI_rect.h"#include "BLI_set.hh"#include "BLI_span.hh"#include "BLI_task.h"#include "BLI_task.hh"#include "BLI_utildefines.h"#include "BLI_vector.hh"#include "DNA_brush_types.h"#include "DNA_customdata_types.h"#include "DNA_key_types.h"#include "DNA_node_types.h"#include "DNA_object_types.h"#include "DNA_scene_types.h"#include "BKE_attribute.hh"#include "BKE_brush.hh"#include "BKE_ccg.hh"#include "BKE_colortools.hh"#include "BKE_context.hh"#include "BKE_customdata.hh"#include "BKE_global.hh"#include "BKE_image.hh"#include "BKE_key.hh"#include "BKE_layer.hh"#include "BKE_lib_id.hh"#include "BKE_mesh.hh"#include "BKE_modifier.hh"#include "BKE_multires.hh"#include "BKE_node_runtime.hh"#include "BKE_object.hh"#include "BKE_object_types.hh"#include "BKE_paint.hh"#include "BKE_paint_bvh.hh"#include "BKE_paint_types.hh"#include "BKE_report.hh"#include "BKE_subdiv_ccg.hh"#include "BLI_math_rotation_legacy.hh"#include "BLI_math_vector.hh"#include "NOD_texture.h"#include "DEG_depsgraph.hh"#include "WM_api.hh"#include "WM_toolsystem.hh"#include "WM_types.hh"#include "ED_paint.hh"#include "ED_screen.hh"#include "ED_sculpt.hh"#include "ED_view3d.hh"#include "paint_intern.hh"#include "sculpt_automask.hh"#include "sculpt_boundary.hh"#include "sculpt_cloth.hh"#include "sculpt_color.hh"#include "sculpt_dyntopo.hh"#include "sculpt_face_set.hh"#include "sculpt_filter.hh"#include "sculpt_hide.hh"#include "sculpt_intern.hh"#include "sculpt_islands.hh"#include "sculpt_pose.hh"#include "sculpt_undo.hh"#include "RNA_access.hh"#include "RNA_define.hh"#include "bmesh.hh"#include "editors/sculpt_paint/brushes/brushes.hh"#include "mesh_brush_common.hh"Go to the source code of this file.
Namespaces | |
| namespace | blender |
| namespace | blender::ed |
| namespace | blender::ed::sculpt_paint |
| namespace | blender::ed::sculpt_paint::face_set |
| namespace | blender::ed::sculpt_paint::boundary |
| namespace | blender::ed::sculpt_paint::dyntopo |
| namespace | blender::ed::sculpt_paint::undo |
| namespace | blender::ed::sculpt_paint::islands |
Typedefs | |
| using | blender::ed::sculpt_paint::BrushActionFunc |
| using | float3 |
Enumerations | |
| enum class | blender::ed::sculpt_paint::AverageDataFlags : uint8_t { blender::ed::sculpt_paint::Position = 1 << 0 , blender::ed::sculpt_paint::Normal = 1 << 1 , blender::ed::sculpt_paint::All = Position | Normal } |
Variables | |
| static CLG_LogRef | LOG = {"sculpt"} |
| using blender::float3 |
Definition at line 619 of file BLI_math_vector_types.hh.
|
strong |
|
static |
Calculates the sign of the direction of the brush stroke, typically indicates whether the stroke will deform a surface inwards or outwards along the brush normal.
Definition at line 2161 of file sculpt.cc.
References BRUSH_DIR_IN, Brush::flag, blender::ed::sculpt_paint::StrokeCache::invert, invert(), and blender::ed::sculpt_paint::StrokeCache::pen_flip.
Referenced by brush_strength(), and blender::ed::sculpt_paint::sculpt_update_cache_invariants().
|
static |
Definition at line 4958 of file sculpt.cc.
References BKE_brush_mask_texture_get(), BKE_image_pool_new(), BKE_paint_brush_for_read(), Tex::nodetree, ntreeTexBeginExecTree(), OB_MODE_SCULPT, Sculpt::paint, MTex::tex, and SculptSession::tex_pool.
Referenced by brush_stroke_init().
|
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 2175 of file sculpt.cc.
References BKE_brush_alpha_get(), BKE_brush_use_alpha_pressure(), BKE_curvemapping_evaluateF(), BKE_paint_brush_for_read(), BLI_assert_unreachable, BRUSH_CLOTH_DEFORM_EXPAND, BRUSH_CLOTH_DEFORM_GRAB, BRUSH_CLOTH_DEFORM_SNAKE_HOOK, brush_flip(), BRUSH_MASK_DRAW, BRUSH_MASK_SMOOTH, BRUSH_PLANE_SWAP_HEIGHT_AND_DEPTH, Brush::cloth_deform_type, Brush::curve_strength, Brush::mask_tool, blender::bke::PaintRuntime::overlap_factor, Sculpt::paint, Brush::plane_inversion_mode, pow4f(), powf, blender::ed::sculpt_paint::StrokeCache::pressure, Paint::runtime, Brush::sculpt_brush_type, SCULPT_BRUSH_TYPE_BLOB, SCULPT_BRUSH_TYPE_BOUNDARY, SCULPT_BRUSH_TYPE_CLAY, SCULPT_BRUSH_TYPE_CLAY_STRIPS, SCULPT_BRUSH_TYPE_CLAY_THUMB, SCULPT_BRUSH_TYPE_CLOTH, SCULPT_BRUSH_TYPE_CREASE, SCULPT_BRUSH_TYPE_DISPLACEMENT_ERASER, SCULPT_BRUSH_TYPE_DISPLACEMENT_SMEAR, SCULPT_BRUSH_TYPE_DRAW, SCULPT_BRUSH_TYPE_DRAW_FACE_SETS, SCULPT_BRUSH_TYPE_DRAW_SHARP, SCULPT_BRUSH_TYPE_ELASTIC_DEFORM, SCULPT_BRUSH_TYPE_GRAB, SCULPT_BRUSH_TYPE_INFLATE, SCULPT_BRUSH_TYPE_LAYER, SCULPT_BRUSH_TYPE_MASK, SCULPT_BRUSH_TYPE_MULTIPLANE_SCRAPE, SCULPT_BRUSH_TYPE_NUDGE, SCULPT_BRUSH_TYPE_PAINT, SCULPT_BRUSH_TYPE_PINCH, SCULPT_BRUSH_TYPE_PLANE, SCULPT_BRUSH_TYPE_POSE, SCULPT_BRUSH_TYPE_ROTATE, SCULPT_BRUSH_TYPE_SIMPLIFY, SCULPT_BRUSH_TYPE_SLIDE_RELAX, SCULPT_BRUSH_TYPE_SMEAR, SCULPT_BRUSH_TYPE_SMOOTH, SCULPT_BRUSH_TYPE_SNAKE_HOOK, and SCULPT_BRUSH_TYPE_THUMB.
Referenced by blender::ed::sculpt_paint::brushes::do_smooth_brush(), blender::ed::sculpt_paint::brushes::do_smooth_mask_brush(), blender::ed::sculpt_paint::do_symmetrical_brush_actions(), 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(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::soft_eraser(), blender::ed::sculpt_paint::vwpaint::test_brush_angle_falloff(), vpaint_blend_stroke(), and vpaint_do_draw().
|
static |
Definition at line 4974 of file sculpt.cc.
References BKE_paint_brush_for_read(), BKE_sculpt_color_layer_create_if_needed(), BKE_sculpt_update_object_for_edit(), brush_init_tex(), blender::ed::sculpt_paint::brush_type_is_paint(), C, CTX_data_active_object(), CTX_data_ensure_evaluated_depsgraph(), CTX_data_tool_settings(), depsgraph, ED_image_paint_brush_type_update_sticky_shading_color(), G, Sculpt::paint, ToolSettings::paint_mode, Object::sculpt, ToolSettings::sculpt, Brush::sculpt_brush_type, SCULPT_use_image_paint_brush(), and view3d_operator_needs_gpu().
Referenced by blender::ed::sculpt_paint::sculpt_brush_stroke_exec(), and blender::ed::sculpt_paint::sculpt_brush_stroke_invoke().
|
static |
Definition at line 1193 of file sculpt.cc.
References angle(), axis_angle_to_mat3_single(), len_squared_v3v3(), blender::ed::sculpt_paint::StrokeCache::location, mul_m3_v3(), blender::ed::sculpt_paint::StrokeCache::radius, blender::ed::sculpt_paint::StrokeCache::radius_squared, sqrtf, and blender::ed::sculpt_paint::symmetry_flip().
Referenced by calc_radial_symmetry_feather(), and calc_symmetry_feather().
|
static |
Definition at line 1214 of file sculpt.cc.
References angle(), calc_overlap(), i, and M_PI.
Referenced by calc_symmetry_feather().
|
static |
Definition at line 1229 of file sculpt.cc.
References calc_overlap(), calc_radial_symmetry_feather(), i, blender::ed::sculpt_paint::is_symmetry_iteration_valid(), Sculpt::paint, PAINT_SYMMETRY_FEATHER, blender::ed::sculpt_paint::StrokeCache::symmetry, and Paint::symmetry_flags.
Referenced by blender::ed::sculpt_paint::do_symmetrical_brush_actions().
|
static |
Definition at line 2863 of file sculpt.cc.
References flip_qt_qt().
Referenced by SCULPT_flip_quat_by_symm_area().
|
static |
Definition at line 2840 of file sculpt.cc.
References angle(), axis_angle_normalized_to_quat(), in, normalize_v3(), out, PAINT_SYMM_X, PAINT_SYMM_Y, PAINT_SYMM_Z, and quat_to_axis_angle().
Referenced by flip_qt(), and SCULPT_cache_calc_brushdata_symm().
|
static |
While most non-brush tools in sculpt mode do not use the brush cursor, the trim tools and the filter tools are expected to have the cursor visible so that some functionality is easier to visually estimate.
See: #122856
Definition at line 3702 of file sculpt.cc.
References BKE_paint_brush(), BKE_paint_get_active_from_context(), C, CTX_data_active_object(), CTX_wm_area(), CTX_wm_region(), ELEM, bToolRef_Runtime::keymap, ot, ARegion::regiontype, RGN_TYPE_WINDOW, bToolRef::runtime, ScrArea::runtime, SPACE_IMAGE, SPACE_VIEW3D, ScrArea::spacetype, ScrArea_Runtime::tool, and WM_operatortype_find().
Referenced by SCULPT_brush_cursor_poll().
|
static |
Definition at line 5423 of file sculpt.cc.
References BKE_paint_brush(), C, CTX_data_tool_settings(), Brush::falloff_shape, Sculpt::paint, PAINT_FALLOFF_SHAPE_TUBE, ToolSettings::sculpt, and blender::ed::sculpt_paint::stroke_get_location_bvh_ex().
Referenced by blender::ed::sculpt_paint::sculpt_brush_stroke_invoke(), and blender::ed::sculpt_paint::stroke_test_start().
|
static |
Definition at line 5004 of file sculpt.cc.
References BKE_paint_brush_for_read(), BRUSH_ANCHORED, BRUSH_DRAG_DOT, SculptSession::cache, depsgraph, ELEM, Brush::flag, blender::ed::sculpt_paint::StrokeCache::layer_displacement_factor, blender::ed::sculpt_paint::StrokeCache::mix_colors, Sculpt::paint, blender::ed::sculpt_paint::StrokeCache::paint_brush, blender::ed::sculpt_paint::undo::restore_from_undo_step(), Object::sculpt, Brush::sculpt_brush_type, SCULPT_BRUSH_TYPE_CLOTH, SCULPT_BRUSH_TYPE_ELASTIC_DEFORM, SCULPT_BRUSH_TYPE_GRAB, SCULPT_BRUSH_TYPE_ROTATE, and SCULPT_BRUSH_TYPE_THUMB.
Referenced by blender::ed::sculpt_paint::stroke_update_step().
| 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 2322 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, blender::ed::sculpt_paint::StrokeCache::paint, 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, 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, blender::ed::sculpt_paint::StrokeCache::vc, x, and y.
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 3734 of file sculpt.cc.
References C, is_brush_related_tool(), blender::ed::sculpt_paint::paint_brush_cursor_poll(), 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 1180 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().
|
static |
Definition at line 3740 of file sculpt.cc.
References BKE_paint_brush_for_read(), Sculpt::paint, Brush::sculpt_brush_type, SCULPT_BRUSH_TYPE_BLOB, SCULPT_BRUSH_TYPE_BOUNDARY, SCULPT_BRUSH_TYPE_CLAY, SCULPT_BRUSH_TYPE_CLAY_STRIPS, SCULPT_BRUSH_TYPE_CLAY_THUMB, SCULPT_BRUSH_TYPE_CLOTH, SCULPT_BRUSH_TYPE_CREASE, SCULPT_BRUSH_TYPE_DISPLACEMENT_ERASER, SCULPT_BRUSH_TYPE_DISPLACEMENT_SMEAR, SCULPT_BRUSH_TYPE_DRAW, SCULPT_BRUSH_TYPE_DRAW_FACE_SETS, SCULPT_BRUSH_TYPE_DRAW_SHARP, SCULPT_BRUSH_TYPE_ELASTIC_DEFORM, SCULPT_BRUSH_TYPE_GRAB, SCULPT_BRUSH_TYPE_INFLATE, SCULPT_BRUSH_TYPE_LAYER, SCULPT_BRUSH_TYPE_MASK, SCULPT_BRUSH_TYPE_MULTIPLANE_SCRAPE, SCULPT_BRUSH_TYPE_NUDGE, SCULPT_BRUSH_TYPE_PAINT, SCULPT_BRUSH_TYPE_PINCH, SCULPT_BRUSH_TYPE_PLANE, SCULPT_BRUSH_TYPE_POSE, SCULPT_BRUSH_TYPE_ROTATE, SCULPT_BRUSH_TYPE_SIMPLIFY, SCULPT_BRUSH_TYPE_SLIDE_RELAX, SCULPT_BRUSH_TYPE_SMEAR, SCULPT_BRUSH_TYPE_SMOOTH, SCULPT_BRUSH_TYPE_SNAKE_HOOK, and SCULPT_BRUSH_TYPE_THUMB.
Referenced by stroke_undo_begin().
| 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 3465 of file sculpt.cc.
References angle(), 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::MatBase< float, 4, 4 >::identity(), 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::symmetry_flip(), 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 | translation[3] ) |
Calculates the vertex offset for a single vertex depending on the brush setting rgb as vector displacement.
Definition at line 2388 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(), i, 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 548 of file sculpt.cc.
References i.
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 6328 of file sculpt.cc.
References SculptSession::cache, blender::ed::sculpt_paint::calc_brush_local_mat(), 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().
| 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 6098 of file sculpt.cc.
References SculptFakeNeighbors::current_max_distance, depsgraph, blender::ed::sculpt_paint::islands::ensure_cache(), SculptFakeNeighbors::fake_neighbor_index, blender::ed::sculpt_paint::fake_neighbor_init(), blender::ed::sculpt_paint::fake_neighbor_search(), SculptSession::fake_neighbors, 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 6120 of file sculpt.cc.
References blender::ed::sculpt_paint::pose_fake_neighbors_free(), and 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], |
| const ePaintSymmetryFlags | symm, | ||
| const ePaintSymmetryAreas | symmarea, | ||
| const float | pivot[3] ) |
Definition at line 2889 of file sculpt.cc.
Referenced by blender::ed::sculpt_paint::pose::do_pose_brush(), and blender::ed::sculpt_paint::transform_matrices_init().
| float3 SCULPT_flip_v3_by_symm_area | ( | const float3 & | vector, |
| const ePaintSymmetryFlags | symm, | ||
| const ePaintSymmetryAreas | symmarea, | ||
| const float3 & | pivot ) |
Definition at line 2868 of file sculpt.cc.
References i, result, and blender::ed::sculpt_paint::symmetry_flip().
Referenced by blender::ed::sculpt_paint::pose::align_pivot_local_space(), blender::ed::sculpt_paint::pose::do_pose_brush(), and blender::ed::sculpt_paint::transform_matrices_init().
| ePaintSymmetryAreas SCULPT_get_vertex_symm_area | ( | const float | co[3] | ) |
Definition at line 2825 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_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 742 of file sculpt.cc.
References i, blender::ed::sculpt_paint::is_symmetry_iteration_valid(), len_squared_v3v3(), 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 184 of file sculpt.cc.
References Mesh::symmetry.
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 3677 of file sculpt.cc.
References C, 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 3683 of file sculpt.cc.
References C, CTX_wm_region_view3d(), 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().
|
static |
Definition at line 2744 of file sculpt.cc.
References Brush::sculpt_brush_type, SCULPT_BRUSH_TYPE_PAINT, SCULPT_paint_image_canvas_get(), U, and USER_EXPERIMENTAL_TEST.
Referenced by blender::ed::sculpt_paint::do_brush_action().
|
static |
Definition at line 2759 of file sculpt.cc.
References BLI_assert, blender::bke::pbvh::build_pixels(), depsgraph, OB_MESH, SCULPT_paint_image_canvas_get(), and Object::type.
Referenced by blender::ed::sculpt_paint::do_brush_action().
| bool SCULPT_poll | ( | bContext * | C | ) |
Checks for a brush, not just sculpt mode.
Definition at line 3689 of file sculpt.cc.
References C, 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 567 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::brushes::do_elastic_deform_brush(), blender::ed::sculpt_paint::brushes::do_grab_brush(), and blender::ed::sculpt_paint::brushes::do_snake_hook_brush().
| 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 536 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::brushes::do_surface_smooth_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 542 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::brushes::do_clay_thumb_brush(), blender::ed::sculpt_paint::cloth::do_cloth_brush(), blender::ed::sculpt_paint::brushes::do_multiplane_scrape_brush(), blender::ed::sculpt_paint::color::do_paint_brush(), blender::ed::sculpt_paint::brushes::do_pinch_brush(), blender::ed::sculpt_paint::brushes::do_topology_relax_brush(), blender::ed::sculpt_paint::brushes::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 530 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::brushes::do_clay_thumb_brush().
Definition at line 4468 of file sculpt.cc.
References BKE_sculpt_update_object_for_edit(), BKE_sculptsession_use_pbvh_draw(), blender::ed::sculpt_paint::brush_type_is_paint(), C, 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, blender::ed::sculpt_paint::sculpt_needs_connectivity_info(), and SculptSession::shapekey_active.
Referenced by blender::ed::sculpt_paint::cursor_geometry_info_update(), blender::ed::sculpt_paint::dyntopo::sample_detail_dyntopo(), blender::ed::sculpt_paint::stroke_done(), blender::ed::sculpt_paint::stroke_get_location_bvh_ex(), 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 759 of file sculpt.cc.
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 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().
| int SCULPT_vertex_count_get | ( | const Object & | object | ) |
Definition at line 151 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::brushes::do_enhance_details_brush(), blender::ed::sculpt_paint::brushes::do_layer_brush(), blender::ed::sculpt_paint::brushes::do_surface_smooth_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().
|
static |
Definition at line 5435 of file sculpt.cc.
References BKE_paint_brush_for_read(), C, CTX_data_active_object(), CTX_data_scene(), CTX_data_tool_settings(), ED_image_undo_push_begin(), wmOperatorType::name, Sculpt::paint, ToolSettings::paint_mode, blender::ed::sculpt_paint::undo::push_begin_ex(), Sculpt, ToolSettings::sculpt, Brush::sculpt_brush_type, sculpt_brush_type_name(), SCULPT_BRUSH_TYPE_PAINT, SCULPT_use_image_paint_brush(), and wmOperator::type.
Referenced by blender::ed::sculpt_paint::stroke_test_start().
Definition at line 5456 of file sculpt.cc.
References C, CTX_data_active_object(), CTX_data_tool_settings(), ED_image_undo_push_end(), ToolSettings::paint_mode, blender::ed::sculpt_paint::undo::push_end(), Brush::sculpt_brush_type, SCULPT_BRUSH_TYPE_PAINT, and SCULPT_use_image_paint_brush().
Referenced by blender::ed::sculpt_paint::stroke_done().
Definition at line 2725 of file sculpt.cc.
References BKE_brush_mask_texture_get(), BKE_paint_brush_for_read(), blender::ed::sculpt_paint::StrokeCache::brush_local_mat, blender::ed::sculpt_paint::StrokeCache::brush_local_mat_inv, SculptSession::cache, blender::ed::sculpt_paint::calc_brush_local_mat(), blender::ed::sculpt_paint::StrokeCache::mirror_symmetry_pass, OB_MODE_SCULPT, Sculpt::paint, blender::MatBase< T, NumCol, NumRow, Alignment >::ptr(), blender::ed::sculpt_paint::StrokeCache::radial_symmetry_pass, MTex::rot, and Object::sculpt.
Referenced by blender::ed::sculpt_paint::do_brush_action().
|
static |