Blender V4.3
blender::ed::sculpt_paint::pose Namespace Reference

Classes

struct  BrushLocalData
 
struct  GrowFactorLocalData
 
struct  IKChain
 
struct  IKChainSegment
 
struct  PoseGrowFactorData
 

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 MutableSpan< Vector< int > > neighbors)
 
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)
 
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()

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

Definition at line 150 of file sculpt_pose.cc.

References b, and BLI_assert.

Referenced by calc_bmesh(), calc_grids(), and calc_mesh().

◆ add_fake_neighbors()

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

Definition at line 332 of file sculpt_pose.cc.

References FAKE_NEIGHBOR_NONE, and verts.

Referenced by grow_factors_mesh().

◆ align_pivot_local_space()

static 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()

static std::optional< float3 > blender::ed::sculpt_paint::pose::calc_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

◆ calc_bmesh()

static 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()

static 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

◆ calc_mesh()

static 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 158 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, blender::ed::sculpt_paint::PositionDeformData::deform(), Brush::deform_target, depsgraph, blender::ed::sculpt_paint::PositionDeformData::eval, blender::ed::sculpt_paint::pose::BrushLocalData::factors, blender::MutableSpan< T >::fill(), 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(), blender::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, and verts.

Referenced by do_pose_brush().

◆ calc_pose_data()

static void blender::ed::sculpt_paint::pose::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

◆ calc_pose_origin_and_factor_bmesh()

◆ calc_pose_origin_and_factor_grids()

◆ calc_pose_origin_and_factor_mesh()

static 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()

static 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()

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

◆ calc_segment_translations()

static 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()

◆ grow_factors_bmesh()

◆ grow_factors_grids()

◆ grow_factors_mesh()

static void blender::ed::sculpt_paint::pose::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

◆ grow_pose_factor()

◆ ik_chain_init()

◆ ik_chain_init_face_sets()

static 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()

static 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()

static 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()

void blender::ed::sculpt_paint::pose::pose_brush_init ( const Depsgraph & depsgraph,
Object & ob,
SculptSession & ss,
const Brush & brush )

Calculate the pose origin and (Optionally the pose factor) that is used when using the pose brush.

Parameters
r_pose_originMust be a valid pointer.
r_pose_factorOptional, when set to NULL it won't be calculated.

Definition at line 1897 of file sculpt_pose.cc.

References SculptSession::cache, depsgraph, ik_chain_init(), blender::ed::sculpt_paint::StrokeCache::location, pose_brush_init(), blender::ed::sculpt_paint::StrokeCache::pose_ik_chain, Brush::pose_smooth_iterations, and blender::ed::sculpt_paint::StrokeCache::radius.

Referenced by blender::ed::sculpt_paint::do_brush_action(), and 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()

static 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()

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

◆ solve_translate_chain()

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

◆ vert_inside_brush_radius()