Blender V5.0
blender::ed::sculpt_paint::pose Namespace Reference

Classes

struct  BrushLocalData
struct  PoseGrowFactorData
struct  GrowFactorLocalData
struct  IKChainSegment
struct  IKChain

Functions

static void solve_ik_chain (IKChain &ik_chain, const float3 &initial_target, const bool use_anchor)
static void solve_roll_chain (IKChain &ik_chain, const Brush &brush, const float roll)
static void solve_translate_chain (IKChain &ik_chain, const float delta[3])
static void solve_scale_chain (IKChain &ik_chain, const float scale[3])
static BLI_NOINLINE void calc_segment_translations (const Span< float3 > positions, const IKChainSegment &segment, const MutableSpan< float3 > translations)
static BLI_NOINLINE void add_arrays (const MutableSpan< float3 > a, const Span< float3 > b)
static void calc_mesh (const Depsgraph &depsgraph, const Sculpt &sd, const Brush &brush, const MeshAttributeData &attribute_data, const bke::pbvh::MeshNode &node, Object &object, BrushLocalData &tls, const PositionDeformData &position_data)
static void calc_grids (const Depsgraph &depsgraph, const Sculpt &sd, const Brush &brush, const bke::pbvh::GridsNode &node, Object &object, BrushLocalData &tls)
static void calc_bmesh (const Depsgraph &depsgraph, const Sculpt &sd, const Brush &brush, bke::pbvh::BMeshNode &node, Object &object, BrushLocalData &tls)
static BLI_NOINLINE void add_fake_neighbors (const Span< int > fake_neighbors, const Span< int > verts, const Span< int > orig_neighbor_data, MutableSpan< int > neighbor_offsets, Vector< int > &neighbor_data_with_fake)
static void grow_factors_mesh (const ePaintSymmetryFlags symm, const float3 &pose_initial_position, const Span< float3 > vert_positions, const OffsetIndices< int > faces, const Span< int > corner_verts, const GroupedSpan< int > vert_to_face_map, const Span< bool > hide_vert, const Span< bool > hide_poly, const Span< int > fake_neighbors, const Span< float > prev_mask, const bke::pbvh::MeshNode &node, GrowFactorLocalData &tls, const MutableSpan< float > pose_factor, PoseGrowFactorData &gftd)
static void grow_factors_grids (const ePaintSymmetryFlags symm, const float3 &pose_initial_position, const SubdivCCG &subdiv_ccg, const Span< int > fake_neighbors, const Span< float > prev_mask, const bke::pbvh::GridsNode &node, const MutableSpan< float > pose_factor, PoseGrowFactorData &gftd)
static void grow_factors_bmesh (const ePaintSymmetryFlags symm, const float3 &pose_initial_position, const Span< int > fake_neighbors, const Span< float > prev_mask, bke::pbvh::BMeshNode &node, const MutableSpan< float > pose_factor, PoseGrowFactorData &gftd)
static void grow_pose_factor (const Depsgraph &depsgraph, Object &ob, SculptSession &ss, float pose_origin[3], float pose_target[3], float max_len, float *r_pose_origin, MutableSpan< float > pose_factor)
static bool vert_inside_brush_radius (const float3 &vertex, const float3 &br_co, float radius, char symm)
static void calc_pose_origin_and_factor_mesh (const Depsgraph &depsgraph, Object &object, SculptSession &ss, const float3 &initial_location, float radius, float3 &r_pose_origin, MutableSpan< float > r_pose_factor)
static void calc_pose_origin_and_factor_grids (Object &object, SculptSession &ss, const float3 &initial_location, float radius, float3 &r_pose_origin, MutableSpan< float > r_pose_factor)
static void calc_pose_origin_and_factor_bmesh (Object &object, SculptSession &ss, const float3 &initial_location, float radius, float3 &r_pose_origin, MutableSpan< float > r_pose_factor)
static void calc_pose_data (const Depsgraph &depsgraph, Object &object, SculptSession &ss, const float3 &initial_location, float radius, float pose_offset, float3 &r_pose_origin, MutableSpan< float > r_pose_factor)
static std::unique_ptr< IKChainik_chain_new (const int totsegments, const int totverts)
static void ik_chain_origin_heads_init (IKChain &ik_chain, const float3 &initial_location)
static int brush_num_effective_segments (const Brush &brush)
static std::unique_ptr< IKChainik_chain_init_topology (const Depsgraph &depsgraph, Object &object, SculptSession &ss, const Brush &brush, const float3 &initial_location, const float radius)
static std::unique_ptr< IKChainik_chain_init_face_sets_mesh (const Depsgraph &depsgraph, Object &object, SculptSession &ss, const Brush &brush, const float radius)
static std::unique_ptr< IKChainik_chain_init_face_sets_grids (Object &object, SculptSession &ss, const Brush &brush, const float radius)
static std::unique_ptr< IKChainik_chain_init_face_sets_bmesh (Object &object, SculptSession &ss, const Brush &brush, const float radius)
static std::unique_ptr< IKChainik_chain_init_face_sets (const Depsgraph &depsgraph, Object &object, SculptSession &ss, const Brush &brush, const float radius)
static std::optional< float3calc_average_face_set_center (const Depsgraph &depsgraph, Object &object, const Span< int > floodfill_step, const int active_face_set, const int target_face_set)
static std::unique_ptr< IKChainik_chain_init_face_sets_fk_mesh (const Depsgraph &depsgraph, Object &object, SculptSession &ss, const float radius, const float3 &initial_location)
static std::unique_ptr< IKChainik_chain_init_face_sets_fk_grids (const Depsgraph &depsgraph, Object &object, SculptSession &ss, const float radius, const float3 &initial_location)
static std::unique_ptr< IKChainik_chain_init_face_sets_fk_bmesh (const Depsgraph &depsgraph, Object &object, SculptSession &ss, const float radius, const float3 &initial_location)
static std::unique_ptr< IKChainik_chain_init_face_sets_fk (const Depsgraph &depsgraph, Object &object, SculptSession &ss, const float radius, const float3 &initial_location)
static std::unique_ptr< IKChainik_chain_init (const Depsgraph &depsgraph, Object &ob, SculptSession &ss, const Brush &brush, const float3 &initial_location, const float radius)
static void pose_brush_init (const Depsgraph &depsgraph, Object &ob, SculptSession &ss, const Brush &brush)
std::unique_ptr< SculptPoseIKChainPreviewpreview_ik_chain_init (const Depsgraph &depsgraph, Object &ob, SculptSession &ss, const Brush &brush, const float3 &initial_location, const float radius)
static void sculpt_pose_do_translate_deform (SculptSession &ss, const Brush &brush)
static float calc_scale_from_grab_delta (SculptSession &ss, const float3 &ik_target)
static void calc_scale_deform (SculptSession &ss, const Brush &brush)
static void calc_twist_deform (SculptSession &ss, const Brush &brush)
static void calc_rotate_deform (SculptSession &ss, const Brush &brush)
static void calc_rotate_twist_deform (SculptSession &ss, const Brush &brush)
static void calc_scale_translate_deform (SculptSession &ss, const Brush &brush)
static void calc_squash_stretch_deform (SculptSession &ss, const Brush &)
static void align_pivot_local_space (float r_mat[4][4], ePaintSymmetryFlags symm, ePaintSymmetryAreas symm_area, IKChainSegment *segment, const float3 &grab_location)
void do_pose_brush (const Depsgraph &depsgraph, const Sculpt &sd, Object &ob, const IndexMask &node_mask)

Function Documentation

◆ add_arrays()

BLI_NOINLINE void blender::ed::sculpt_paint::pose::add_arrays ( const MutableSpan< float3 > a,
const Span< float3 > b )
static

◆ add_fake_neighbors()

BLI_NOINLINE void blender::ed::sculpt_paint::pose::add_fake_neighbors ( const Span< int > fake_neighbors,
const Span< int > verts,
const Span< int > orig_neighbor_data,
MutableSpan< int > neighbor_offsets,
Vector< int > & neighbor_data_with_fake )
static

◆ align_pivot_local_space()

void blender::ed::sculpt_paint::pose::align_pivot_local_space ( float r_mat[4][4],
ePaintSymmetryFlags symm,
ePaintSymmetryAreas symm_area,
IKChainSegment * segment,
const float3 & grab_location )
static

◆ brush_num_effective_segments()

◆ calc_average_face_set_center()

◆ calc_bmesh()

void blender::ed::sculpt_paint::pose::calc_bmesh ( const Depsgraph & depsgraph,
const Sculpt & sd,
const Brush & brush,
bke::pbvh::BMeshNode & node,
Object & object,
BrushLocalData & tls )
static

◆ calc_grids()

void blender::ed::sculpt_paint::pose::calc_grids ( const Depsgraph & depsgraph,
const Sculpt & sd,
const Brush & brush,
const bke::pbvh::GridsNode & node,
Object & object,
BrushLocalData & tls )
static

Definition at line 207 of file sculpt_pose.cc.

References add_arrays(), blender::ed::sculpt_paint::apply_translations(), blender::MutableSpan< T >::as_span(), blender::ed::sculpt_paint::StrokeCache::automasking, BRUSH_DEFORM_TARGET_CLOTH_SIM, BRUSH_DEFORM_TARGET_GEOMETRY, SculptSession::cache, blender::ed::sculpt_paint::auto_mask::calc_grids_factors(), calc_segment_translations(), blender::ed::sculpt_paint::clip_and_lock_translations(), blender::ed::sculpt_paint::StrokeCache::cloth_sim, Brush::deform_target, depsgraph, blender::ed::sculpt_paint::pose::BrushLocalData::factors, blender::MutableSpan< T >::fill(), blender::ed::sculpt_paint::fill_factor_from_hide_and_mask(), blender::ed::sculpt_paint::gather_data_grids(), blender::ed::sculpt_paint::gather_grids_positions(), blender::bke::pbvh::GridsNode::grids(), blender::ed::sculpt_paint::orig_position_data_get_grids(), blender::ed::sculpt_paint::StrokeCache::pose_ik_chain, blender::ed::sculpt_paint::OrigPositionData::positions, blender::ed::sculpt_paint::pose::BrushLocalData::positions, blender::ed::sculpt_paint::reset_translations_to_original(), Vector< T, InlineBufferCapacity, Allocator >::resize(), blender::ed::sculpt_paint::scale_translations(), blender::ed::sculpt_paint::scatter_data_grids(), blender::ed::sculpt_paint::pose::BrushLocalData::segment_translations, blender::ed::sculpt_paint::pose::BrushLocalData::segment_weights, blender::Span< T >::size(), SculptSession::subdiv_ccg, and blender::ed::sculpt_paint::pose::BrushLocalData::translations.

Referenced by do_pose_brush().

◆ calc_mesh()

void blender::ed::sculpt_paint::pose::calc_mesh ( const Depsgraph & depsgraph,
const Sculpt & sd,
const Brush & brush,
const MeshAttributeData & attribute_data,
const bke::pbvh::MeshNode & node,
Object & object,
BrushLocalData & tls,
const PositionDeformData & position_data )
static

Definition at line 155 of file sculpt_pose.cc.

References add_arrays(), blender::MutableSpan< T >::as_span(), blender::ed::sculpt_paint::StrokeCache::automasking, BRUSH_DEFORM_TARGET_CLOTH_SIM, BRUSH_DEFORM_TARGET_GEOMETRY, SculptSession::cache, calc_segment_translations(), blender::ed::sculpt_paint::auto_mask::calc_vert_factors(), blender::ed::sculpt_paint::clip_and_lock_translations(), blender::ed::sculpt_paint::StrokeCache::cloth_sim, Brush::deform_target, depsgraph, blender::ed::sculpt_paint::pose::BrushLocalData::factors, blender::MutableSpan< T >::fill(), blender::ed::sculpt_paint::fill_factor_from_hide_and_mask(), blender::ed::sculpt_paint::gather_data_mesh(), blender::ed::sculpt_paint::MeshAttributeData::hide_vert, blender::ed::sculpt_paint::MeshAttributeData::mask, blender::ed::sculpt_paint::orig_position_data_get_mesh(), blender::ed::sculpt_paint::StrokeCache::pose_ik_chain, blender::ed::sculpt_paint::OrigPositionData::positions, blender::ed::sculpt_paint::pose::BrushLocalData::positions, blender::ed::sculpt_paint::reset_translations_to_original(), Vector< T, InlineBufferCapacity, Allocator >::resize(), blender::ed::sculpt_paint::scale_translations(), blender::ed::sculpt_paint::scatter_data_mesh(), blender::ed::sculpt_paint::pose::BrushLocalData::segment_translations, blender::ed::sculpt_paint::pose::BrushLocalData::segment_weights, blender::ed::sculpt_paint::pose::BrushLocalData::translations, blender::bke::pbvh::MeshNode::verts(), and verts.

Referenced by do_pose_brush().

◆ calc_pose_data()

◆ calc_pose_origin_and_factor_bmesh()

◆ calc_pose_origin_and_factor_grids()

◆ calc_pose_origin_and_factor_mesh()

void blender::ed::sculpt_paint::pose::calc_pose_origin_and_factor_mesh ( const Depsgraph & depsgraph,
Object & object,
SculptSession & ss,
const float3 & initial_location,
float radius,
float3 & r_pose_origin,
MutableSpan< float > r_pose_factor )
static

◆ calc_rotate_deform()

◆ calc_rotate_twist_deform()

void blender::ed::sculpt_paint::pose::calc_rotate_twist_deform ( SculptSession & ss,
const Brush & brush )
static

◆ calc_scale_deform()

◆ calc_scale_from_grab_delta()

◆ calc_scale_translate_deform()

void blender::ed::sculpt_paint::pose::calc_scale_translate_deform ( SculptSession & ss,
const Brush & brush )
static

◆ calc_segment_translations()

BLI_NOINLINE void blender::ed::sculpt_paint::pose::calc_segment_translations ( const Span< float3 > positions,
const IKChainSegment & segment,
const MutableSpan< float3 > translations )
static

◆ calc_squash_stretch_deform()

◆ calc_twist_deform()

◆ do_pose_brush()

void blender::ed::sculpt_paint::pose::do_pose_brush ( const Depsgraph & depsgraph,
const Sculpt & sd,
Object & ob,
const IndexMask & node_mask )

Main Brush Function.

Definition at line 2057 of file sculpt_pose.cc.

References align_pivot_local_space(), BKE_paint_brush_for_read(), blender::bke::pbvh::BMesh, BRUSH_POSE_DEFORM_ROTATE_TWIST, BRUSH_POSE_DEFORM_SCALE_TRASLATE, BRUSH_POSE_DEFORM_SQUASH_STRETCH, SculptSession::cache, calc_bmesh(), calc_grids(), calc_mesh(), calc_rotate_twist_deform(), calc_scale_translate_deform(), calc_squash_stretch_deform(), copy_qt_qt(), Object::data, depsgraph, do_pose_brush(), blender::bke::pbvh::Tree::flush_bounds_to_parents(), blender::index_mask::IndexMask::foreach_index(), SubdivCCG::grid_area, blender::bke::pbvh::Grids, i, invert_m4_m4(), blender::threading::EnumerableThreadSpecific< T >::local(), blender::bke::pbvh::Mesh, blender::ed::sculpt_paint::StrokeCache::mirror_symmetry_pass, mul_m4_m4_post(), mul_v3_fl(), blender::bke::pbvh::Tree::nodes(), blender::ed::sculpt_paint::StrokeCache::orig_grab_location, Sculpt::paint, PAINT_SYMM_AREAS, blender::bke::object::pbvh_get(), pose_brush_init(), Brush::pose_deform_type, blender::ed::sculpt_paint::StrokeCache::pose_ik_chain, SubdivCCG::positions, quat_to_mat4(), Object::sculpt, SCULPT_flip_quat_by_symm_area(), SCULPT_flip_v3_by_symm_area(), SCULPT_mesh_symmetry_xyz_get(), blender::ed::sculpt_paint::pose::IKChain::segments, SculptSession::subdiv_ccg, blender::bke::pbvh::Tree::tag_positions_changed(), translate_m4(), blender::bke::pbvh::Tree::type(), unit_m4(), blender::bke::pbvh::update_node_bounds_bmesh(), blender::bke::pbvh::update_node_bounds_grids(), and blender::bke::pbvh::update_node_bounds_mesh().

Referenced by blender::ed::sculpt_paint::do_brush_action(), and do_pose_brush().

◆ grow_factors_bmesh()

◆ grow_factors_grids()

◆ grow_factors_mesh()

◆ grow_pose_factor()

◆ ik_chain_init()

◆ ik_chain_init_face_sets()

std::unique_ptr< IKChain > blender::ed::sculpt_paint::pose::ik_chain_init_face_sets ( const Depsgraph & depsgraph,
Object & object,
SculptSession & ss,
const Brush & brush,
const float radius )
static

◆ ik_chain_init_face_sets_bmesh()

◆ ik_chain_init_face_sets_fk()

std::unique_ptr< IKChain > blender::ed::sculpt_paint::pose::ik_chain_init_face_sets_fk ( const Depsgraph & depsgraph,
Object & object,
SculptSession & ss,
const float radius,
const float3 & initial_location )
static

◆ ik_chain_init_face_sets_fk_bmesh()

◆ ik_chain_init_face_sets_fk_grids()

◆ ik_chain_init_face_sets_fk_mesh()

◆ ik_chain_init_face_sets_grids()

◆ ik_chain_init_face_sets_mesh()

◆ ik_chain_init_topology()

◆ ik_chain_new()

std::unique_ptr< IKChain > blender::ed::sculpt_paint::pose::ik_chain_new ( const int totsegments,
const int totverts )
static

◆ ik_chain_origin_heads_init()

◆ pose_brush_init()

◆ preview_ik_chain_init()

std::unique_ptr< SculptPoseIKChainPreview > blender::ed::sculpt_paint::pose::preview_ik_chain_init ( const Depsgraph & depsgraph,
Object & ob,
SculptSession & ss,
const Brush & brush,
const float3 & initial_location,
const float radius )

◆ sculpt_pose_do_translate_deform()

◆ solve_ik_chain()

void blender::ed::sculpt_paint::pose::solve_ik_chain ( IKChain & ik_chain,
const float3 & initial_target,
const bool use_anchor )
static

◆ solve_roll_chain()

◆ solve_scale_chain()

void blender::ed::sculpt_paint::pose::solve_scale_chain ( IKChain & ik_chain,
const float scale[3] )
static

◆ solve_translate_chain()

void blender::ed::sculpt_paint::pose::solve_translate_chain ( IKChain & ik_chain,
const float delta[3] )
static

◆ vert_inside_brush_radius()