55#define PT_DEFAULT_RAD 0.05f
82 return is_editbone_ ? eBone_->name : pchan_->name;
88 "conversion to EditBone* only possible when "
89 "UnifiedBonePtr contains an edit bone");
95 "conversion to EditBone* only possible when "
96 "UnifiedBonePtr contains an edit bone");
103 "conversion to bPoseChannel* only possible when "
104 "UnifiedBonePtr contains a pose channel");
110 "conversion to bPoseChannel* only possible when "
111 "UnifiedBonePtr contains a pose channel");
118 "bPoseChannel's armature Bone* only set when "
119 "UnifiedBonePtr contains a pose channel");
125 "bPoseChannel's armature Bone* only set when "
126 "UnifiedBonePtr contains a pose channel");
132 "bPoseChannel's armature Bone* only set when "
133 "UnifiedBonePtr contains a pose channel");
134 return {pchan_, bone_};
139 "bPoseChannel's armature Bone* only set when "
140 "UnifiedBonePtr contains a pose channel");
141 return {pchan_, bone_};
188 return is_editbone_ ? eBone_->parent !=
nullptr : bone_->parent !=
nullptr;
194 return is_editbone_ ? eBone_->disp_mat : pchan_->disp_mat;
198 return is_editbone_ ? eBone_->disp_mat : pchan_->disp_mat;
203 return is_editbone_ ? eBone_->disp_tail_mat : pchan_->disp_tail_mat;
208 return is_editbone_ ? eBone_->disp_tail_mat : pchan_->disp_tail_mat;
215 return is_editbone_ ? eBone_->rad_head : bone_->rad_head;
220 return is_editbone_ ? eBone_->rad_tail : bone_->rad_tail;
226 return eBone_->color.wrap();
229 if (pchan_->color.palette_index == 0) {
232 return bone_->color.wrap();
234 return pchan_->color.wrap();
244 const float (*bone_mat)[4],
245 const float col_wire[4],
246 const float col_bone[4],
247 const float col_head[4],
248 const float col_tail[4],
259 *
reinterpret_cast<float4 *
>(
const_cast<float *
>(col_wire)),
260 *
reinterpret_cast<float4 *
>(
const_cast<float *
>(col_bone)),
261 *
reinterpret_cast<float4 *
>(
const_cast<float *
>(col_head)),
262 *
reinterpret_cast<float4 *
>(
const_cast<float *
>(col_tail))},
268 const float (*bone_mat)[4],
269 const float *radius_head,
270 const float *radius_tail,
274 float head_sph[4] = {0.0f, 0.0f, 0.0f, 1.0f}, tail_sph[4] = {0.0f, 1.0f, 0.0f, 1.0f};
275 float xaxis[4] = {1.0f, 0.0f, 0.0f, 1.0f};
280 mul_m4_v4(ctx->
ob->object_to_world().ptr(), head_sph);
281 mul_m4_v4(ctx->
ob->object_to_world().ptr(), tail_sph);
282 mul_m4_v4(ctx->
ob->object_to_world().ptr(), xaxis);
285 head_sph[3] = *radius_head * obscale;
287 tail_sph[3] = *radius_tail * obscale;
291 *
reinterpret_cast<float4 *
>(tail_sph),
292 *
reinterpret_cast<float3 *
>(xaxis)},
298 const float (*bone_mat)[4],
299 const float bone_col[4],
300 const float hint_col[4],
301 const float outline_col[4],
302 const float *radius_head,
303 const float *radius_tail,
306 float head_sph[4] = {0.0f, 0.0f, 0.0f, 1.0f}, tail_sph[4] = {0.0f, 1.0f, 0.0f, 1.0f};
307 float xaxis[4] = {1.0f, 0.0f, 0.0f, 1.0f};
312 mul_m4_v4(ctx->
ob->object_to_world().ptr(), head_sph);
313 mul_m4_v4(ctx->
ob->object_to_world().ptr(), tail_sph);
314 mul_m4_v4(ctx->
ob->object_to_world().ptr(), xaxis);
316 head_sph[3] = *radius_head * obscale;
317 tail_sph[3] = *radius_tail * obscale;
322 if (head_sph[3] < 0.0f || tail_sph[3] < 0.0f) {
324 if (head_sph[3] < 0.0f) {
336 ctx->
bone_buf->sphere_fill_buf.
append({inst_data.mat44, bone_col, hint_col}, sel_id);
338 if (outline_col[3] > 0.0f) {
339 ctx->
bone_buf->sphere_outline_buf.
append({inst_data.mat44, outline_col}, sel_id);
346 float fac_head = (
len - head_sph[3]) /
len;
347 float fac_tail = (
len - tail_sph[3]) /
len;
349 if (
len > (tail_sph[3] + head_sph[3]) + 1e-8f) {
357 {*
reinterpret_cast<float4 *
>(head_sph),
358 *
reinterpret_cast<float4 *
>(tail_sph),
359 *
reinterpret_cast<float3 *
>(
const_cast<float *
>(bone_col)),
360 *
reinterpret_cast<float3 *
>(
const_cast<float *
>(hint_col)),
361 *
reinterpret_cast<float3 *
>(xaxis)},
364 if (outline_col[3] > 0.0f) {
366 {*
reinterpret_cast<float4 *
>(head_sph),
367 *
reinterpret_cast<float4 *
>(tail_sph),
368 *
reinterpret_cast<float4 *
>(
const_cast<float *
>(outline_col)),
369 *
reinterpret_cast<float3 *
>(xaxis)},
375 float fac =
max_ff(fac_head, 1.0f - fac_tail);
383 ctx->
bone_buf->sphere_fill_buf.
append({inst_data.mat44, bone_col, hint_col}, sel_id);
385 if (outline_col[3] > 0.0f) {
386 ctx->
bone_buf->sphere_outline_buf.
append({inst_data.mat44, outline_col}, sel_id);
396 const float (*bone_mat)[4],
397 const float bone_color[4],
398 const float hint_color[4],
399 const float outline_color[4],
400 const float wire_width,
414 if (surf || edges || loose_edges) {
415 inst_data.mat44 = ctx->
ob->object_to_world() *
float4x4(bone_mat);
422 ctx->
bone_buf->custom_shape_fill_get_buffer(surf).
append(inst_data, select_id);
428 ctx->
bone_buf->custom_shape_outline_get_buffer(edges).
append(inst_data, select_id);
434 ctx->
bone_buf->custom_shape_wire_get_buffer(loose_edges).
append(inst_data, select_id);
443 const float (*bone_mat)[4],
444 const float color[4],
445 const float wire_width,
457 inst_data.mat44 = ctx->
ob->object_to_world() *
float4x4(bone_mat);
461 ctx->
bone_buf->custom_shape_wire_get_buffer(geom).
append(inst_data, select_id);
470 const float (*bone_mat)[4],
471 const float outline_color[4],
472 const float wire_width,
483 gpu::Batch *loose_edges =
nullptr;
493 inst_data.mat44 = ctx->
ob->object_to_world() *
float4x4(bone_mat);
497 ctx->
bone_buf->custom_shape_wire_get_buffer(loose_edges).
append(inst_data, select_id);
505 const float (*bone_mat)[4],
506 const float bone_color[4],
507 const float hint_color[4],
508 const float outline_color[4],
509 const float wire_width,
518 if (
mesh !=
nullptr) {
543 const float (*bone_mat)[4],
544 const float color[4],
545 const float wire_width,
551 if (
mesh !=
nullptr) {
569 const float (*bone_mat)[4],
570 const float color[4],
571 const float wire_width,
577 gpu::Batch *geom =
nullptr;
609 inst_data.mat44 = ctx->
ob->object_to_world() *
float4x4(bone_mat) *
614 ctx->
bone_buf->custom_shape_wire_get_buffer(geom).
append(inst_data, select_id);
619 const float (*bone_mat)[4],
620 const float bone_color[4],
621 const float hint_color[4],
622 const float outline_color[4],
630 ctx->
bone_buf->sphere_fill_buf.
append({mat, bone_color, hint_color}, sel_id);
632 if (outline_color[3] > 0.0f) {
633 ctx->
bone_buf->sphere_outline_buf.
append({mat, outline_color}, sel_id);
639 const float (*bone_mat)[4],
640 const float color[4])
653 const float start[3],
655 const float color[4])
665 const float start[3],
673 const float start[3],
681 const float start[3],
689 const float start[3],
727 r = offset + int(cp[0]);
729 g = offset + int(cp[1]);
731 b = offset + int(cp[2]);
746 uint8_t srgb_color[4] = {255, 255, 255, 255};
750 if (shade_offset != 0) {
770 if (draw_active && draw_selected) {
773 else if (draw_active) {
776 else if (draw_selected) {
784 if (draw_active && draw_selected) {
785 wire_color = is_edit ? theme.colors.bone_active : theme.colors.bone_pose_active;
787 else if (draw_active) {
788 wire_color = is_edit ? theme.colors.bone_active_unsel : theme.colors.bone_pose_active_unsel;
790 else if (draw_selected) {
791 wire_color = is_edit ? theme.colors.bone_select : theme.colors.bone_pose;
794 wire_color = is_edit ? theme.colors.wire_edit : theme.colors.wire;
822 if ((constflag & flags_to_color) == 0 ||
830 float solid_color[4];
835 constraint_color = theme.colors.bone_pose_no_target;
838 constraint_color = theme.colors.bone_pose_ik;
841 constraint_color = theme.colors.bone_pose_spline_ik;
844 constraint_color = theme.colors.bone_pose_constraint;
857 const float *locked_color = theme.colors.bone_locked;
867 return theme.colors.bone_solid;
870 static float disp_color[4];
886 return theme.colors.bone_solid;
895 static float consts_color[4];
915 static float disp_color[4];
950 hint_color[3] = 1.0f;
956 static float hint_color[4] = {0.0f, 0.0f, 0.0f, 1.0f};
994 float (*bone_mat)[4];
1024 float bone_scale[3];
1025 float (*bone_mat)[4];
1026 float (*disp_mat)[4];
1027 float (*disp_tail_mat)[4];
1028 float rot_mat[3][3];
1074 float imat[4][4], bonemat[4][4];
1077 memset(¶m, 0,
sizeof(param));
1160 param.
roll1 += prev->roll2;
1188 float s[4][4], ebmat[4][4];
1189 float length, xwidth, zwidth;
1190 float (*bone_mat)[4];
1191 short bbone_segments;
1200 xwidth = pchan_bone->
xwidth;
1201 zwidth = pchan_bone->
zwidth;
1203 bbone_segments = pchan_bone->
segments;
1217 const float3 size_vec = {xwidth,
length / bbone_segments, zwidth};
1226 if (bbone_segments > 1) {
1229 for (
int i = bbone_segments; i--; bbones_mat++) {
1242 if (bbone_segments > 1) {
1245 for (
int i = bbone_segments; i--; bbones_mat++) {
1276 float axis_mat[4][4];
1286 float disp_mat[4][4];
1296 const float col_solid[4],
1297 const int select_id)
1299 float col_wire_root[4], col_wire_tail[4];
1300 float col_hint_root[4], col_hint_tail[4];
1308 const float envelope_ignore = -1.0f;
1316 copy_v3_v3(col_wire_root, theme.colors.vert_select);
1319 copy_v3_v3(col_wire_tail, theme.colors.vert_select);
1328 const float *hint_color_shade_root = (ctx->
const_color) ?
1329 static_cast<const float *
>(theme.colors.bone_solid) :
1331 const float *hint_color_shade_tail = (ctx->
const_color) ?
1332 static_cast<const float *
>(theme.colors.bone_solid) :
1340 if (is_envelope_draw) {
1357 if (is_envelope_draw) {
1380 const int select_id)
1418 const int select_id)
1428 ctx->
bone_buf->octahedral_fill_buf.
append({bone_mat, col_solid, col_hint}, sel_id);
1430 if (col_wire[3] > 0.0f) {
1431 ctx->
bone_buf->octahedral_outline_buf.
append({bone_mat, col_wire}, sel_id);
1434 draw_points(ctx, bone, boneflag, col_solid, select_id);
1440 const int select_id)
1444 const float no_display[4] = {0.0f, 0.0f, 0.0f, 0.0f};
1445 const float *col_head = no_display;
1446 const float *col_tail = col_bone;
1449 col_wire = no_display;
1450 col_bone = col_head = col_tail = ctx->
const_color;
1456 col_tail = &theme.colors.vert_select.x;
1463 col_head = (bone.
flag() &
BONE_ROOTSEL) ? &theme.colors.vert_select.x : col_bone;
1466 col_head = col_bone;
1471 if (select_id == -1) {
1475 ctx, bone.
disp_mat(), col_wire, col_bone, col_head, col_tail, select_id);
1487 if (col_head[3] > 0.0f) {
1498 ctx, bone.
disp_mat(), col_wire, no_display, no_display, col_tail, select_id |
BONESEL_TIP);
1505 const int select_id)
1515 bbone_matrices = {
reinterpret_cast<Mat4 *
>(bone.
as_posebone()->draw_data->bbone_matrix),
1520 reinterpret_cast<Mat4 *
>(
const_cast<float (*)[4][4]
>(bone.
as_editbone()->disp_bbone_mat)),
1526 for (
const Mat4 &in_bone_mat : bbone_matrices) {
1530 ctx->
bone_buf->bbones_fill_buf.
append({bone_mat, col_solid, col_hint}, sel_id);
1532 if (col_wire[3] > 0.0f) {
1533 ctx->
bone_buf->bbones_outline_buf.
append({bone_mat, col_wire}, sel_id);
1538 draw_points(ctx, bone, boneflag, col_solid, select_id);
1545 const int select_id)
1551 const float *rad_head, *rad_tail, *
distance;
1585 draw_points(ctx, bone, boneflag, col_solid, select_id);
1591 const int select_id)
1604 bbone_matrices = {
reinterpret_cast<Mat4 *
>(bone.
as_posebone()->draw_data->bbone_matrix),
1609 reinterpret_cast<Mat4 *
>(
const_cast<float (*)[4][4]
>(bone.
as_editbone()->disp_bbone_mat)),
1613 for (
const Mat4 &in_bone_mat : bbone_matrices) {
1623 draw_points(ctx, bone, boneflag, col_solid, select_id);
1628 const bool use_custom_shape,
1632 const int select_id)
1634 if (use_custom_shape) {
1671 float tmp[4][4], posetrans[4][4];
1672 float xminmax[2], zminmax[2];
1694 tmp[1][1] = -tmp[1][1];
1698 inst_data.mat44 = ctx->
ob->object_to_world() *
float4x4(posetrans);
1705 inst_data.mat44,
float4(0.25f), xminmax[0], zminmax[0], xminmax[1], zminmax[1]);
1708 ctx->
bone_buf->degrees_of_freedom_wire_buf.
append(
data.with_color({0.0f, 0.0f, 0.0f, 1.0f}),
1713 inst_data.mat44,
float4(1.0f, 0.0f, 0.0f, 1.0f), xminmax[0], 0.0f, xminmax[1], 0.0f);
1718 inst_data.mat44,
float4(0.0f, 0.0f, 1.0f, 1.0f), 0.0f, zminmax[0], 0.0f, zminmax[1]);
1759 const bool only_temp)
1762 const float *line_start =
nullptr, *line_end =
nullptr;
1785 while (parchan->
parent) {
1787 if (segcount ==
data->rootbone || segcount > 255) {
1790 parchan = parchan->
parent;
1818 while (parchan->
parent) {
1821 if (segcount ==
data->chainlen) {
1824 parchan = parchan->
parent;
1827 if (parchan != pchan) {
1840 const float bone_head[3],
1841 const float parent_head[3],
1842 const float parent_tail[3])
1893 bone.
get(&eBone, &pchan);
1903 const float *head = is_pose ? pchan->
pose_head : eBone->
head;
1904 const float *tail = is_pose ? pchan->
pose_tail : eBone->
tail;
1910 is_pose ? pchan->
name : eBone->
name,
1911 is_pose ? strlen(pchan->
name) : strlen(eBone->
name),
1926 const bool use_custom_shape,
1930 if (use_custom_shape) {
1960 for (eBone = arm.
edbo->first(),
1970 const int select_id = is_select ?
index :
uint(-1);
1998 bone_draw(drawtype,
false, ctx, bone, boneflag, select_id);
2020 bool draw_locked_weights =
false;
2029 bool is_pose_select =
false;
2031 if (!is_from_dupli_or_set(ob)) {
2052 if (is_pose_select) {
2061 (draw_ctx->
obact !=
nullptr))
2063 draw_locked_weights =
true;
2089 pchan = pchan->next,
index += 0x10000)
2095 Bone *bone = pchan->bone_get(arm);
2096 const bool draw_dofs = !is_pose_select && ctx->
do_relations &&
2101 const int select_id = is_pose_select ?
index :
uint(-1);
2111 if (pchan->parent &&
2121 if (!draw_locked_weights) {
2126 if (!is_pose_select) {
2134 bone_draw(drawtype, use_custom_shape, ctx, bone_ptr, boneflag, select_id);
2137 if (is_pose_select) {
Functions to deal with Armatures.
C++ part of the BoneColor DNA struct.
Blender kernel action and pose functionality.
General operations, lookup, etc. for blender objects.
#define PCHAN_CUSTOM_BONE_LENGTH(pchanbone)
#define OB_MODE_ALL_WEIGHT_PAINT
Object is a sort of wrapper for general info.
#define BLI_assert_unreachable()
#define BLI_assert_msg(a, msg)
UnifiedBonePtr(bPoseChannel *pchan, Bone *bone)
void get(const EditBone **eBone, const bPoseChannel **pchan) const
UnifiedBonePtr(const UnifiedBonePtr &ptr)=default
bPoseChannel * as_posebone()
const EditBone * as_editbone() const
const f44 & disp_mat() const
const f44 & disp_tail_mat() const
const float & rad_head() const
bke::PChanBoneConst as_pchanbone() const
ePchan_ConstFlag constflag() const
const bPoseChannel * as_posebone() const
const char * name() const
UnifiedBonePtr(EditBone *eBone)
const float & rad_tail() const
const animrig::BoneColor & effective_bonecolor() const
bke::PChanBone as_pchanbone()
void get(EditBone **eBone, bPoseChannel **pchan)
const Bone * posebone_bone() const
const ThemeWireColor * effective_color() const
static void draw_armature_pose(Armatures::DrawContext *ctx)
static void draw_armature_edit(Armatures::DrawContext *ctx)
float distance(float, float) RET
float length(VecOp< float, D >) RET
float3x3 scale(float3x3 mat, float2 scale)
ccl_device_inline dual1 len(const ccl_private dual< T > &a)
bool bone_is_visible(const bArmature *armature, const Bone *bone)
PChanBoneT< bPoseChannel, Bone > PChanBone
PChanBoneT< const bPoseChannel, const Bone > PChanBoneConst
void DRW_mesh_batch_cache_validate(Mesh &mesh)
gpu::Batch * DRW_mesh_batch_cache_get_loose_edges(Mesh &mesh)
gpu::Batch * DRW_cache_text_edge_wire_get(Object *ob)
void DRW_curve_batch_cache_validate(Curve *cu)
gpu::Batch * DRW_mesh_batch_cache_get_surface(Mesh &mesh)
gpu::Batch * DRW_mesh_batch_cache_get_all_edges(Mesh &mesh)
gpu::Batch * DRW_mesh_batch_cache_get_edge_detection(Mesh &mesh, bool *r_is_manifold)
void drw_batch_cache_generate_requested_delayed(Object *ob)
gpu::Batch * DRW_cache_curve_edge_wire_get(Object *ob)
MatT from_scale(const VecBase< typename MatT::base_type, ScaleDim > &scale)
VecBase< T, 3 > transform_point(const CartesianBasis &basis, const VecBase< T, 3 > &v)
void get_color_4ubv(int colorid, unsigned char col[4])
void * MEM_new_uninitialized(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
static void edbo_compute_bbone_child(bArmature *arm)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
static void draw_bone_update_disp_matrix_default(UnifiedBonePtr bone)
static const float * get_bone_solid_color(const Armatures::DrawContext *ctx, const eBone_Flag boneflag)
static void drw_shgroup_bone_envelope(const Armatures::DrawContext *ctx, const float(*bone_mat)[4], const float bone_col[4], const float hint_col[4], const float outline_col[4], const float *radius_head, const float *radius_tail, const int select_id)
MINLINE void rgba_uchar_to_float(float r_col[4], const unsigned char col_ub[4])
static void get_pchan_color_wire(const UniformData &theme, const ThemeWireColor *bcolor, const eArmatureDrawMode draw_mode, const eBone_Flag boneflag, float r_color[4])
const ListBaseT< bDeformGroup > * BKE_object_defgroup_list(const Object *ob)
Mesh * BKE_object_get_evaluated_mesh_no_subsurf_unchecked(const Object *object)
MINLINE void copy_v3_v3(float r[3], const float a[3])
static void use_bone_color(float *r_color, const uint8_t *color_from_theme, const int shade_offset)
static void bone_draw_wire(const Armatures::DrawContext *ctx, const UnifiedBonePtr bone, const eBone_Flag boneflag, const int select_id)
static void drw_shgroup_bone_custom_mesh_wire(const Armatures::DrawContext *ctx, Mesh &mesh, const float(*bone_mat)[4], const float color[4], const float wire_width, const draw::select::ID select_id, Object &custom)
@ CONSTRAINT_TYPE_KINEMATIC
@ CONSTRAINT_TYPE_SPLINEIK
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
void interp_v4_v4v4(float r[4], const float a[4], const float b[4], float t)
float mat4_to_scale(const float mat[4][4])
void mul_v3_m4v3(float r[3], const float mat[4][4], const float vec[3])
@ BBONE_ADD_PARENT_END_ROLL
static void drw_shgroup_bone_ik_no_target_lines(const Armatures::DrawContext *ctx, const float start[3], const float end[3])
static void bone_draw_envelope(const Armatures::DrawContext *ctx, const UnifiedBonePtr bone, const eBone_Flag boneflag, const int select_id)
@ DRW_TEXT_CACHE_GLOBALSPACE
@ DRW_TEXT_CACHE_STRING_PTR
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
bool invert_m4(float mat[4][4])
MINLINE void srgb_to_linearrgb_v4(float linear[4], const float srgb[4])
void translate_m4(float mat[4][4], float Tx, float Ty, float Tz)
static void draw_points(const Armatures::DrawContext *ctx, const UnifiedBonePtr bone, const eBone_Flag boneflag, const float col_solid[4], const int select_id)
Mesh & DRW_mesh_get_for_drawing(Mesh &mesh)
MatBase< float, 4, 4 > float4x4
static float get_bone_wire_thickness(const Armatures::DrawContext *ctx, int boneflag)
static bool should_draw_relation_to_parent(const UnifiedBonePtr bone, const eBone_Flag boneflag)
static void drw_shgroup_bone_custom_wire(const Armatures::DrawContext *ctx, const float(*bone_mat)[4], const float color[4], const float wire_width, const draw::select::ID select_id, Object *custom)
static void bone_hint_color_shade(float hint_color[4], const float color[4])
static void drw_shgroup_bone_custom_empty(const Armatures::DrawContext *ctx, const float(*bone_mat)[4], const float color[4], const float wire_width, const draw::select::ID select_id, Object *custom)
static void drw_shgroup_bone_custom_solid(const Armatures::DrawContext *ctx, const float(*bone_mat)[4], const float bone_color[4], const float hint_color[4], const float outline_color[4], const float wire_width, const draw::select::ID select_id, Object *custom)
MINLINE void mul_v3_fl(float r[3], float f)
ListBaseWrapperTemplate< const ListBase, const T > ConstListBaseWrapper
static void ebone_spline_preview(EditBone *ebone, const float result_array[MAX_BBONE_SUBDIV][4][4])
MINLINE void sub_v3_v3(float r[3], const float a[3])
VecBase< float, 4 > float4
void eulO_to_mat3(float M[3][3], const float e[3], short order)
static void bone_draw_b_bone(const Armatures::DrawContext *ctx, const UnifiedBonePtr bone, const eBone_Flag boneflag, const int select_id)
static void drw_shgroup_bone_sphere(const Armatures::DrawContext *ctx, const float(*bone_mat)[4], const float bone_color[4], const float hint_color[4], const float outline_color[4], const int select_id)
void mul_m4_v3(const float M[4][4], float r[3])
static void bone_draw_line(const Armatures::DrawContext *ctx, const UnifiedBonePtr bone, const eBone_Flag boneflag, const int select_id)
static void bone_draw(const eArmature_Drawtype drawtype, const bool use_custom_shape, const Armatures::DrawContext *ctx, const UnifiedBonePtr bone, const eBone_Flag boneflag, const int select_id)
void BKE_pchan_bbone_spline_setup(bke::PChanBone pchanbone, const bArmature &armature, bool rest, bool for_deform, Mat4 *result_array)
static void drw_shgroup_bone_axes(const Armatures::DrawContext *ctx, const float(*bone_mat)[4], const float color[4])
void size_to_mat4(float R[4][4], const float size[3])
static void drw_shgroup_bone_relationship_lines_ex(const Armatures::DrawContext *ctx, const float start[3], const float end[3], const float color[4])
T & DRW_object_get_data_for_drawing(const Object &object)
ListBaseWrapperTemplate< ListBase, T > ListBaseWrapper
static void get_pchan_color_constraint(const UniformData &theme, const ThemeWireColor *bcolor, const UnifiedBonePtr bone, float r_color[4])
void mul_m4_m4m3(float R[4][4], const float A[4][4], const float B[3][3])
void DRW_text_cache_add(DRWTextStore *dt, const float co[3], const char *str, const int str_len, short xoffs, short yoffs, short flag, const uchar col[4], const bool shadow, const bool align_center)
BMesh const char void * data
int BKE_pchan_bbone_spline_compute(BBoneSplineParameters *param, bool for_deform, Mat4 *result_array)
static void drw_shgroup_bone_envelope_distance(const Armatures::DrawContext *ctx, const float(*bone_mat)[4], const float *radius_head, const float *radius_tail, const float *distance)
@ ARM_DRAW_TYPE_ARMATURE_DEFINED
static void draw_bone_degrees_of_freedom(const Armatures::DrawContext *ctx, const bPoseChannel *pchan)
void unit_m4(float m[4][4])
void ED_armature_ebone_to_mat4(EditBone *ebone, float r_mat[4][4])
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], float t)
static void drw_shgroup_bone_stick(const Armatures::DrawContext *ctx, const float(*bone_mat)[4], const float col_wire[4], const float col_bone[4], const float col_head[4], const float col_tail[4], const int select_id)
static void bone_draw_custom_shape(const Armatures::DrawContext *ctx, const UnifiedBonePtr bone, const eBone_Flag boneflag, const int select_id)
static void set_ctx_bcolor(Armatures::DrawContext *ctx, const UnifiedBonePtr bone)
const DRWContext * DRW_context_get()
MINLINE void zero_v3(float r[3])
void mul_m4_v4(const float mat[4][4], float r[4])
static void draw_bone_update_disp_matrix_bbone(UnifiedBonePtr bone, bArmature &armature)
MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f)
static void drw_shgroup_bone_ik_spline_lines(const Armatures::DrawContext *ctx, const float start[3], const float end[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
void mid_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void copy_v3_fl3(float v[3], float x, float y, float z)
T * DEG_get_original(T *id)
static void pchan_draw_ik_lines(const Armatures::DrawContext *ctx, const bPoseChannel *pchan, const bool only_temp)
MINLINE void copy_v3_fl(float r[3], float f)
static void draw_bone_relations(const Armatures::DrawContext *ctx, const UnifiedBonePtr bone, const eBone_Flag boneflag)
static void drw_shgroup_bone_relationship_lines(const Armatures::DrawContext *ctx, const float start[3], const float end[3])
MINLINE float max_ff(float a, float b)
MINLINE void copy_v3_v3_uchar(unsigned char r[3], const unsigned char a[3])
static void drw_shgroup_custom_bone_curve(const Armatures::DrawContext *ctx, Curve *curve, const float(*bone_mat)[4], const float outline_color[4], const float wire_width, const draw::select::ID select_id, Object *custom)
static void bone_draw_octa(const Armatures::DrawContext *ctx, const UnifiedBonePtr bone, const eBone_Flag boneflag, const int select_id)
void rescale_m4(float mat[4][4], const float scale[3])
static void draw_axes(const Armatures::DrawContext *ctx, const UnifiedBonePtr bone, const bArmature &arm)
static const float * get_bone_solid_with_consts_color(const Armatures::DrawContext *ctx, const UnifiedBonePtr bone, const eBone_Flag boneflag)
static void drw_shgroup_bone_custom_solid_mesh(const Armatures::DrawContext *ctx, Mesh &mesh, const float(*bone_mat)[4], const float bone_color[4], const float hint_color[4], const float outline_color[4], const float wire_width, const draw::select::ID select_id, Object &custom)
static void drw_shgroup_bone_ik_lines(const Armatures::DrawContext *ctx, const float start[3], const float end[3])
MINLINE void copy_v4_v4(float r[4], const float a[4])
static void bone_draw_update_display_matrix(const eArmature_Drawtype drawtype, const bool use_custom_shape, UnifiedBonePtr bone, bArmature &armature)
void copy_m4_m4(float m1[4][4], const float m2[4][4])
static const float * get_bone_wire_color(const Armatures::DrawContext *ctx, const eBone_Flag boneflag)
VecBase< float, 3 > float3
@ BONE_DRAW_LOCKED_WEIGHT
void scale_m4_fl(float R[4][4], float scale)
static void draw_bone_update_disp_matrix_custom_shape(UnifiedBonePtr bone)
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void mul_v3_v3v3(float r[3], const float v1[3], const float v2[3])
static void get_pchan_color_solid(const UniformData &theme, const ThemeWireColor *bcolor, float r_color[4])
bPoseChannel * BKE_pose_channel_find_name(const bPose *pose, const char *name)
static void cp_shade_color3ub(uchar cp[3], const int offset)
static void draw_bone_name(const Armatures::DrawContext *ctx, const UnifiedBonePtr bone)
static const float * get_bone_hint_color(const Armatures::DrawContext *ctx, const eBone_Flag boneflag)
static void draw_bone_bone_relationship_line(const Armatures::DrawContext *ctx, const float bone_head[3], const float parent_head[3], const float parent_tail[3])
MINLINE float clamp_f(float value, float min, float max)
static void bone_locked_color_shade(const UniformData &theme, float color[4])
static void pchan_draw_data_init(bPoseChannel *pchan, Bone &bone)
#define WIRE_WIDTH_COMPRESSION
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
float disp_bbone_mat[32][4][4]
eBone_BBoneFlag bbone_flag
eBone_BBoneHandleType bbone_next_type
eBone_BBoneHandleType bbone_prev_type
bke::ObjectRuntime * runtime
eObject_EmptyDrawType empty_drawtype
struct ToolSettings * toolsettings
ListBaseT< EditBone > * edbo
struct EditBone * act_edbone
eArmature_Drawtype drawtype
float bbone_matrix[0][4][4]
float disp_tail_mat[4][4]
float custom_scale_xyz[3]
struct bPoseChannel * parent
bPoseChannelDrawData * draw_data
ListBaseT< struct bConstraint > constraints
struct bPoseChannel * custom_tx
ePchan_ConstFlag constflag
float custom_shape_wire_width
float custom_rotation_euler[3]
float custom_translation[3]
ListBaseT< bPoseChannel > chanbase
bool draw_envelope_distance
const float * const_color
Armatures::BoneBuffers * bone_buf
bool draw_relation_from_head
eArmatureDrawMode draw_mode
const ThemeWireColor * bcolor
eArmature_Drawtype drawtype
void set_color(const float4 &bone_color)
void set_hint_color(const float4 &hint_color)
void append(const float3 &start, const float3 &end, const float4 &color, select::ID select_id=select::SelectMap::select_invalid_id())
bool is_selection() const
const ShapeCache & shapes
void append(const InstanceDataT &data, select::ID select_id)
static const ID select_invalid_id()
const ID select_id(const ObjectRef &ob_ref, uint sub_object_id=0)