Blender
V3.3
|
#include <ctype.h>
#include <float.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_task.h"
#include "BLI_utildefines.h"
#include "DNA_armature_types.h"
#include "DNA_gpencil_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.h"
#include "BKE_armature.h"
#include "BKE_customdata.h"
#include "BKE_deform.h"
#include "BKE_editmesh.h"
#include "BKE_lattice.h"
#include "DEG_depsgraph_build.h"
#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], float weight, float co_accum[3], DualQuat *dq_accum, float mat_accum[3][3]) |
static void | b_bone_deform (const bPoseChannel *pchan, const float co[3], float weight, float vec[3], DualQuat *dq, float defmat[3][3]) |
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]) |
static void | pchan_bone_deform (const bPoseChannel *pchan, float weight, float vec[3], DualQuat *dq, float mat[3][3], const float co[3], float *contrib) |
Variables | |
static CLG_LogRef | LOG = {"bke.armature_deform"} |
Armature Deform #BKE_armature_deform_coords API | |
typedef struct ArmatureUserdata | ArmatureUserdata |
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 UNUSED(tls)) |
static void | armature_vert_task_editmesh (void *__restrict userdata, MempoolIterData *iter, const TaskParallelTLS *__restrict UNUSED(tls)) |
static void | armature_vert_task_editmesh_no_dvert (void *__restrict userdata, MempoolIterData *iter, const TaskParallelTLS *__restrict UNUSED(tls)) |
static void | armature_deform_coords_impl (const Object *ob_arm, const Object *ob_target, 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, const Mesh *me_target, BMEditMesh *em_target, bGPDstroke *gps_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_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, BMEditMesh *em_target) |
Deform coordinates by a armature object (used by modifier).
Definition in file armature_deform.c.
typedef struct ArmatureUserdata ArmatureUserdata |
|
static |
Definition at line 449 of file armature_deform.c.
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_id_defgroup_list_get(), BKE_id_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(), data, Object::data, bGPDstroke::dvert, Lattice::dvert, Mesh::dvert, bArmature::edbo, bPoseChannel::flag, bPose::flag, Mesh::id, Object::id, if(), invert_m4_m4(), LISTBASE_FOREACH_INDEX, LOG, MEM_callocN, MEM_freeN, TaskParallelSettings::min_iter_per_thread, mul_m4_m4m4(), ID::name, NULL, OB_GPENCIL, OB_LATTICE, OB_MESH, Object::obmat, Lattice::pntsu, Lattice::pntsv, Lattice::pntsw, Object::pose, POSE_RECALC, bGPDstroke::totpoints, Mesh::totvert, Object::type, BMesh::vdata, and BMesh::vpool.
Referenced by BKE_armature_deform_coords_with_editmesh(), BKE_armature_deform_coords_with_gpencil_stroke(), and BKE_armature_deform_coords_with_mesh().
|
static |
Definition at line 400 of file armature_deform.c.
References armature_vert_task_with_dvert(), BLI_assert, data, and NULL.
Referenced by armature_deform_coords_impl().
|
static |
Definition at line 430 of file armature_deform.c.
References armature_vert_task_with_dvert(), BM_ELEM_CD_GET_VOID_P, BM_elem_index_get, data, and v.
Referenced by armature_deform_coords_impl().
|
static |
Definition at line 440 of file armature_deform.c.
References armature_vert_task_with_dvert(), BM_elem_index_get, data, NULL, and v.
Referenced by armature_deform_coords_impl().
|
static |
Definition at line 253 of file armature_deform.c.
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(), data, 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(), NULL, 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 83 of file armature_deform.c.
References bPoseChannel_Runtime::bbone_deform_mats, bPoseChannel_Runtime::bbone_dual_quats, BKE_pchan_bbone_deform_segment_index(), blend(), bPoseChannel::bone, float(), Bone::length, Mat4::mat, pchan_deform_accumulate(), bPoseChannel::runtime, and y.
Referenced by dist_bone_deform(), and pchan_bone_deform().
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, | ||
BMEditMesh * | em_target | ||
) |
Definition at line 654 of file armature_deform.c.
References armature_deform_coords_impl(), and NULL.
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 608 of file armature_deform.c.
References armature_deform_coords_impl(), and NULL.
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 631 of file armature_deform.c.
References armature_deform_coords_impl(), and NULL.
|
static |
Definition at line 161 of file armature_deform.c.
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(), NULL, 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 108 of file armature_deform.c.
References Freestyle::a, dot_v3v3(), l, len_squared_v3(), len_squared_v3v3(), normalize_v3(), sqrtf, and sub_v3_v3v3().
Referenced by armature_vert_task_with_dvert(), armdef_accumulate_bone(), dist_bone_deform(), and envelope_bone_weighting().
|
static |
Definition at line 191 of file armature_deform.c.
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 50 of file armature_deform.c.
References add_weighted_dq_dq(), 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 43 of file armature_deform.c.
Referenced by armature_deform_coords_impl().