|
Blender V4.3
|
#include <cctype>#include <cfloat>#include <cmath>#include <cstdio>#include <cstdlib>#include <cstring>#include "MEM_guardedalloc.h"#include "BLI_listbase.h"#include "BLI_math_matrix.h"#include "BLI_math_rotation.h"#include "BLI_math_vector.h"#include "BLI_task.h"#include "BLI_utildefines.h"#include "DNA_armature_types.h"#include "DNA_gpencil_legacy_types.h"#include "DNA_lattice_types.h"#include "DNA_listBase.h"#include "DNA_mesh_types.h"#include "DNA_meshdata_types.h"#include "DNA_object_types.h"#include "BKE_action.hh"#include "BKE_armature.hh"#include "BKE_curves.hh"#include "BKE_customdata.hh"#include "BKE_deform.hh"#include "BKE_editmesh.hh"#include "BKE_lattice.hh"#include "BKE_mesh.hh"#include "DEG_depsgraph_build.hh"#include "CLG_log.h"Go to the source code of this file.
Classes | |
| struct | ArmatureUserdata |
Functions | |
Armature Deform Internal Utilities | |
| static void | pchan_deform_accumulate (const DualQuat *deform_dq, const float deform_mat[4][4], const float co_in[3], const float weight, float co_accum[3], DualQuat *dq_accum, float mat_accum[3][3], const bool full_deform) |
| static void | b_bone_deform (const bPoseChannel *pchan, const float co[3], const float weight, float vec[3], DualQuat *dq, float defmat[3][3], const bool full_deform) |
| float | distfactor_to_bone (const float vec[3], const float b1[3], const float b2[3], float rad1, float rad2, float rdist) |
| static float | dist_bone_deform (const bPoseChannel *pchan, float vec[3], DualQuat *dq, float mat[3][3], const float co[3], const bool full_deform) |
| static void | pchan_bone_deform (const bPoseChannel *pchan, const float weight, float vec[3], DualQuat *dq, float mat[3][3], const float co[3], const bool full_deform, float *contrib) |
Armature Deform #BKE_armature_deform_coords API | |
#BKE_armature_deform_coords and related functions. | |
| static void | armature_vert_task_with_dvert (const ArmatureUserdata *data, const int i, const MDeformVert *dvert) |
| static void | armature_vert_task (void *__restrict userdata, const int i, const TaskParallelTLS *__restrict) |
| static void | armature_vert_task_editmesh (void *__restrict userdata, MempoolIterData *iter, const TaskParallelTLS *__restrict) |
| static void | armature_vert_task_editmesh_no_dvert (void *__restrict userdata, MempoolIterData *iter, const TaskParallelTLS *__restrict) |
| static void | armature_deform_coords_impl (const Object *ob_arm, const Object *ob_target, const ListBase *defbase, float(*vert_coords)[3], float(*vert_deform_mats)[3][3], const int vert_coords_len, const int deformflag, float(*vert_coords_prev)[3], const char *defgrp_name, blender::Span< MDeformVert > dverts, const Mesh *me_target, const BMEditMesh *em_target) |
| void | BKE_armature_deform_coords_with_gpencil_stroke (const Object *ob_arm, const Object *ob_target, float(*vert_coords)[3], float(*vert_deform_mats)[3][3], int vert_coords_len, int deformflag, float(*vert_coords_prev)[3], const char *defgrp_name, bGPDstroke *gps_target) |
| void | BKE_armature_deform_coords_with_curves (const Object &ob_arm, const Object &ob_target, const ListBase *defbase, blender::MutableSpan< blender::float3 > vert_coords, std::optional< blender::MutableSpan< blender::float3 > > vert_coords_prev, std::optional< blender::MutableSpan< blender::float3x3 > > vert_deform_mats, blender::Span< MDeformVert > dverts, int deformflag, blender::StringRefNull defgrp_name) |
| void | BKE_armature_deform_coords_with_mesh (const Object *ob_arm, const Object *ob_target, float(*vert_coords)[3], float(*vert_deform_mats)[3][3], int vert_coords_len, int deformflag, float(*vert_coords_prev)[3], const char *defgrp_name, const Mesh *me_target) |
| void | BKE_armature_deform_coords_with_editmesh (const Object *ob_arm, const Object *ob_target, float(*vert_coords)[3], float(*vert_deform_mats)[3][3], int vert_coords_len, int deformflag, float(*vert_coords_prev)[3], const char *defgrp_name, const BMEditMesh *em_target) |
Variables | |
| static CLG_LogRef | LOG = {"bke.armature_deform"} |
Deform coordinates by a armature object (used by modifier).
Definition in file armature_deform.cc.
|
static |
Definition at line 482 of file armature_deform.cc.
References ARM_DEF_ENVELOPE, ARM_DEF_INVERT_VGROUP, ARM_DEF_QUATERNION, ARM_DEF_VGROUP, armature_vert_task(), armature_vert_task_editmesh(), armature_vert_task_editmesh_no_dvert(), BKE_defgroup_name_index(), BKE_object_supports_vertex_groups(), BKE_pose_channel_find_name(), BLI_assert, BLI_listbase_count(), BLI_parallel_mempool_settings_defaults(), BLI_parallel_range_settings_defaults(), BLI_task_parallel_mempool(), BLI_task_parallel_range(), BMEditMesh::bm, BM_mesh_elem_index_ensure(), BM_VERT, BONE_NO_DEFORM, CD_MDEFORMVERT, CLOG_ERROR, CustomData_get_offset(), blender::Span< T >::data(), Object::data, bArmature::edbo, bPose::flag, bPoseChannel::flag, Object::id, invert_m4_m4(), LISTBASE_FOREACH_INDEX, LOG, MEM_callocN, MEM_freeN(), mul_m4_m4m4(), ID::name, ArmatureUserdata::ob_arm, Object::pose, POSE_RECALC, blender::Span< T >::size(), BMesh::vdata, and BMesh::vpool.
Referenced by BKE_armature_deform_coords_with_curves(), BKE_armature_deform_coords_with_editmesh(), BKE_armature_deform_coords_with_gpencil_stroke(), and BKE_armature_deform_coords_with_mesh().
|
static |
Definition at line 432 of file armature_deform.cc.
References armature_vert_task_with_dvert(), and BLI_assert.
Referenced by armature_deform_coords_impl().
|
static |
Definition at line 462 of file armature_deform.cc.
References armature_vert_task_with_dvert(), BM_ELEM_CD_GET_VOID_P, BM_elem_index_get, and v.
Referenced by armature_deform_coords_impl().
|
static |
Definition at line 473 of file armature_deform.cc.
References armature_vert_task_with_dvert(), BM_elem_index_get, and v.
Referenced by armature_deform_coords_impl().
|
static |
Definition at line 267 of file armature_deform.cc.
References add_v3_v3(), add_v3_v3v3(), Bone::arm_head, Bone::arm_tail, BKE_defvert_find_weight(), bPoseChannel::bone, BONE_MULT_VG_ENV, BONE_NO_DEFORM, copy_m3_m3(), copy_m3_m4(), copy_v3_v3(), MDeformWeight::def_nr, Bone::dist, dist_bone_deform(), distfactor_to_bone(), MDeformVert::dw, Bone::flag, float, mul_m3_fl(), mul_m3_series, mul_m4_v3(), mul_v3_fl(), mul_v3m3_dq(), bPoseChannel::next, normalize_dq(), pchan_bone_deform(), Bone::rad_head, Bone::rad_tail, sub_v3_v3(), MDeformVert::totweight, MDeformWeight::weight, zero_m3(), and zero_v3().
Referenced by armature_vert_task(), armature_vert_task_editmesh(), and armature_vert_task_editmesh_no_dvert().
|
static |
Definition at line 89 of file armature_deform.cc.
References bPoseChannel_Runtime::bbone_deform_mats, bPoseChannel_Runtime::bbone_dual_quats, BKE_pchan_bbone_deform_segment_index(), blend, pchan_deform_accumulate(), and bPoseChannel::runtime.
Referenced by dist_bone_deform(), and pchan_bone_deform().
| void BKE_armature_deform_coords_with_curves | ( | const Object & | ob_arm, |
| const Object & | ob_target, | ||
| const ListBase * | defbase, | ||
| blender::MutableSpan< blender::float3 > | vert_coords, | ||
| std::optional< blender::MutableSpan< blender::float3 > > | vert_coords_prev, | ||
| std::optional< blender::MutableSpan< blender::float3x3 > > | vert_deform_mats, | ||
| blender::Span< MDeformVert > | dverts, | ||
| int | deformflag, | ||
| blender::StringRefNull | defgrp_name ) |
Definition at line 635 of file armature_deform.cc.
References armature_deform_coords_impl(), BLI_assert, blender::StringRefNull::c_str(), blender::MutableSpan< T >::data(), blender::MutableSpan< T >::size(), and blender::Span< T >::size().
Referenced by blender::modify_curves().
| void BKE_armature_deform_coords_with_editmesh | ( | const Object * | ob_arm, |
| const Object * | ob_target, | ||
| float(*) | vert_coords[3], | ||
| float(*) | vert_deform_mats[3][3], | ||
| int | vert_coords_len, | ||
| int | deformflag, | ||
| float(*) | vert_coords_prev[3], | ||
| const char * | defgrp_name, | ||
| const BMEditMesh * | em_target ) |
Definition at line 707 of file armature_deform.cc.
References armature_deform_coords_impl(), BKE_id_defgroup_list_get(), and Object::data.
Referenced by deform_matrices_EM(), and deform_verts_EM().
| void BKE_armature_deform_coords_with_gpencil_stroke | ( | const Object * | ob_arm, |
| const Object * | ob_target, | ||
| float(*) | vert_coords[3], | ||
| float(*) | vert_deform_mats[3][3], | ||
| int | vert_coords_len, | ||
| int | deformflag, | ||
| float(*) | vert_coords_prev[3], | ||
| const char * | defgrp_name, | ||
| bGPDstroke * | gps_target ) |
Definition at line 609 of file armature_deform.cc.
References armature_deform_coords_impl(), BKE_id_defgroup_list_get(), Object::data, bGPDstroke::dvert, and bGPDstroke::totpoints.
| void BKE_armature_deform_coords_with_mesh | ( | const Object * | ob_arm, |
| const Object * | ob_target, | ||
| float(*) | vert_coords[3], | ||
| float(*) | vert_deform_mats[3][3], | ||
| int | vert_coords_len, | ||
| int | deformflag, | ||
| float(*) | vert_coords_prev[3], | ||
| const char * | defgrp_name, | ||
| const Mesh * | me_target ) |
Definition at line 665 of file armature_deform.cc.
References armature_deform_coords_impl(), BKE_id_defgroup_list_get(), BKE_id_supports_vertex_groups(), Object::data, Lattice::dvert, OB_LATTICE, OB_MESH, Lattice::pntsu, Lattice::pntsv, Lattice::pntsw, and Object::type.
Referenced by deform_matrices(), and deform_verts().
|
static |
Definition at line 170 of file armature_deform.cc.
References Bone::arm_head, Bone::arm_tail, b_bone_deform(), bPoseChannel_Runtime::bbone_segments, bPoseChannel::bone, bPoseChannel::chan_mat, bPoseChannel_Runtime::deform_dual_quat, Bone::dist, distfactor_to_bone(), pchan_deform_accumulate(), Bone::rad_head, Bone::rad_tail, bPoseChannel::runtime, Bone::segments, and Bone::weight.
Referenced by armature_vert_task_with_dvert().
| float distfactor_to_bone | ( | const float | vec[3], |
| const float | b1[3], | ||
| const float | b2[3], | ||
| float | rad1, | ||
| float | rad2, | ||
| float | rdist ) |
Using vec with dist to bone b1 - b2.
Definition at line 117 of file armature_deform.cc.
References dot_v3v3(), l, len_squared_v3(), len_squared_v3v3(), normalize_v3(), sqrtf, and sub_v3_v3v3().
Referenced by blender::ed::greasepencil::add_armature_envelope_weights(), armature_vert_task_with_dvert(), armdef_accumulate_bone(), dist_bone_deform(), and envelope_bone_weighting().
|
static |
Definition at line 204 of file armature_deform.cc.
References b_bone_deform(), bPoseChannel_Runtime::bbone_segments, bPoseChannel::bone, bPoseChannel::chan_mat, bPoseChannel_Runtime::deform_dual_quat, pchan_deform_accumulate(), bPoseChannel::runtime, and Bone::segments.
Referenced by armature_vert_task_with_dvert().
|
static |
Definition at line 55 of file armature_deform.cc.
References add_weighted_dq_dq_pivot(), BLI_assert, copy_m3_m4(), madd_m3_m3m3fl(), madd_v3_v3fl(), mul_v3_m4v3(), and sub_v3_v3().
Referenced by b_bone_deform(), dist_bone_deform(), and pchan_bone_deform().
|
static |
Definition at line 48 of file armature_deform.cc.
Referenced by armature_deform_coords_impl().