77 if (
data->heat &&
data->armob->pose &&
88 for (
a = 0;
a < segments;
a++) {
145 bool is_weight_paint;
151 if (
data->heat &&
data->armob->pose &&
172 for (
a = 0;
a < segments;
a++) {
198 bool use_mask =
false;
215 for (
int j = 0; j < numbones; j++) {
220 Bone *bone = bonelist[j];
240 if (dgroupflip && dgroupflip[j] && iflip != -1) {
273 Bone **bonelist, *bone;
279 float(*root)[3], (*tip)[3], (*verts)[3];
281 int numbones, vertsfilled = 0, segments = 0;
287 bool is_weight_paint;
290 looper_data.armob = par;
291 looper_data.heat = heat;
292 looper_data.list =
NULL;
293 looper_data.is_weight_paint = wpmode;
309 looper_data.list = bonelist;
318 looper_data.list = dgrouplist;
323 root =
MEM_callocN(
sizeof(
float[3]) * numbones,
"root");
324 tip =
MEM_callocN(
sizeof(
float[3]) * numbones,
"tip");
325 selected =
MEM_callocN(
sizeof(
int) * numbones,
"selected");
327 for (
int j = 0; j < numbones; j++) {
329 dgroup = dgrouplist[j];
352 if ((segments + 1) < bone->
segments) {
378 if (dgroup && mirror) {
420 ob,
mesh,
verts, numbones, dgrouplist, dgroupflip, root, tip, selected, &
error);
typedef float(TangentPoint)[2]
Blender kernel action and pose functionality.
struct bPoseChannel * BKE_pose_channel_find_name(const struct bPose *pose, const char *name)
float distfactor_to_bone(const float vec[3], const float b1[3], const float b2[3], float rad1, float rad2, float rdist)
void BKE_pchan_bbone_spline_setup(struct bPoseChannel *pchan, bool rest, bool for_deform, Mat4 *result_array)
const CustomData_MeshMasks CD_MASK_BAREMESH
void BKE_mesh_foreach_mapped_vert_coords_get(struct Mesh *me_eval, float(*r_cos)[3], int totcos)
struct Mesh * mesh_get_eval_final(struct Depsgraph *depsgraph, const struct Scene *scene, struct Object *ob, const struct CustomData_MeshMasks *dataMask)
struct ModifierData * BKE_modifiers_findby_type(const struct Object *ob, ModifierType type)
void BKE_report(ReportList *reports, eReportType type, const char *message)
void subsurf_calculate_limit_positions(struct Mesh *me, float(*r_positions)[3])
void mul_m4_v3(const float M[4][4], float r[3])
float mat4_to_scale(const float M[4][4])
void mul_v3_m4v3(float r[3], const float M[4][4], const float v[3])
MINLINE void copy_v3_v3(float r[3], const float a[3])
size_t BLI_string_flip_side_name(char *r_name, const char *from_name, bool strip_number, size_t name_len)
struct Depsgraph Depsgraph
struct Object * DEG_get_evaluated_object(const struct Depsgraph *depsgraph, struct Object *object)
struct Scene * DEG_get_evaluated_scene(const struct Depsgraph *graph)
Object is a sort of wrapper for general info.
#define ARM_GROUPS_ENVELOPE
void ED_vgroup_vert_add(struct Object *ob, struct bDeformGroup *dg, int vertnum, float weight, int assignmode)
void ED_vgroup_vert_remove(struct Object *ob, struct bDeformGroup *dg, int vertnum)
void ED_mesh_mirror_spatial_table_end(struct Object *ob)
int mesh_get_x_mirror_vert(struct Object *ob, struct Mesh *me_eval, int index, bool use_topology)
void ED_vgroup_data_clamp_range(struct ID *id, int total)
Read Guarded memory(de)allocation.
int bone_looper(struct Object *ob, struct Bone *bone, void *data, int(*bone_func)(struct Object *, struct Bone *, void *))
static void envelope_bone_weighting(Object *ob, Mesh *mesh, float(*verts)[3], int numbones, Bone **bonelist, bDeformGroup **dgrouplist, bDeformGroup **dgroupflip, float(*root)[3], float(*tip)[3], const int *selected, float scale)
static void add_verts_to_dgroups(ReportList *reports, Depsgraph *depsgraph, Scene *UNUSED(scene), Object *ob, Object *par, int heat, const bool mirror)
void ED_object_vgroup_calc_from_armature(ReportList *reports, Depsgraph *depsgraph, Scene *scene, Object *ob, Object *par, const int mode, const bool mirror)
static int dgroup_skinnable_cb(Object *ob, Bone *bone, void *datap)
static int bone_skinnable_cb(Object *UNUSED(ob), Bone *bone, void *datap)
static int vgroup_add_unique_bone_cb(Object *ob, Bone *bone, void *UNUSED(ptr))
const Depsgraph * depsgraph
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
static void error(const char *str)
void heat_bone_weighting(Object *ob, Mesh *me, float(*verts)[3], int numbones, bDeformGroup **dgrouplist, bDeformGroup **dgroupflip, float(*root)[3], float(*tip)[3], const int *selected, const char **error_str)
T distance(const T &a, const T &b)