53#define PT_DEFAULT_RAD 0.05f
83 "conversion to EditBone* only possible when "
84 "UnifiedBonePtr contains an edit bone");
90 "conversion to EditBone* only possible when "
91 "UnifiedBonePtr contains an edit bone");
98 "conversion to bPoseChannel* only possible when "
99 "UnifiedBonePtr contains a pose channel");
105 "conversion to bPoseChannel* only possible when "
106 "UnifiedBonePtr contains a pose channel");
214 const bool is_filled,
215 const bool do_envelope_dist)
const = 0;
220 const int select_id)
const = 0;
290 const bool use_wire_alpha = (wire_alpha < 1.0f);
303 float4 color = {0.0f, 0.0f, 0.0f, alpha};
307 color = {0.0f, 0.0f, 0.0f,
powf(alpha, 4)};
311 for (
int i = 0; i < 2; i++) {
327 DRWPass *armature_ps = *p_armature_ps;
332 DRWPass *armature_transp_ps = *p_armature_trans_ps;
334#define BUF_INSTANCE DRW_shgroup_call_buffer_instance
335#define BUF_LINE(grp, format) DRW_shgroup_call_buffer(grp, format, GPU_PRIM_LINES)
336#define BUF_POINT(grp, format) DRW_shgroup_call_buffer(grp, format, GPU_PRIM_POINTS)
373 if (use_wire_alpha) {
385 GPUTexture **depth_tex = &dtxl->
depth;
397 if (use_wire_alpha) {
419 if (use_wire_alpha) {
437 if (use_wire_alpha) {
454 if (use_wire_alpha) {
473 if (use_wire_alpha) {
509 if (use_wire_alpha) {
530 if (use_wire_alpha) {
552 if (use_wire_alpha) {
570#ifdef NO_LEGACY_OVERLAY
571# define DRW_buffer_add_entry_struct POISON
572# define DRW_select_load_id POISON
573# define OVERLAY_empty_shape POISON
574# define OVERLAY_extra_line_dashed POISON
587 data->amin_a = aminx;
588 data->amin_b = aminz;
589 data->amax_a = amaxx;
590 data->amax_b = amaxz;
596 CLAMP(a, 0.0f, 1.0f);
598 return float(
int(a * 255) | (
int(
b * 255) << 8));
615#ifndef NO_LEGACY_OVERLAY
619 const float (*bone_mat)[4],
620 const float bone_color[4],
621 const float hint_color[4],
622 const float outline_color[4])
631 if (outline_color[3] > 0.0f) {
639 const float (*bone_mat)[4],
640 const float bone_color[4],
641 const float hint_color[4],
642 const float outline_color[4])
651 if (outline_color[3] > 0.0f) {
660 const float (*bone_mat)[4],
661 const float col_wire[4],
662 const float col_bone[4],
663 const float col_head[4],
664 const float col_tail[4],
682#ifndef NO_LEGACY_OVERLAY
691 const float (*bone_mat)[4],
692 const float *radius_head,
693 const float *radius_tail,
694 const float *distance)
697 float head_sph[4] = {0.0f, 0.0f, 0.0f, 1.0f}, tail_sph[4] = {0.0f, 1.0f, 0.0f, 1.0f};
698 float xaxis[4] = {1.0f, 0.0f, 0.0f, 1.0f};
703 mul_m4_v4(ctx->
ob->object_to_world().ptr(), head_sph);
704 mul_m4_v4(ctx->
ob->object_to_world().ptr(), tail_sph);
705 mul_m4_v4(ctx->
ob->object_to_world().ptr(), xaxis);
708 head_sph[3] = *radius_head * obscale;
709 head_sph[3] += *distance * obscale;
710 tail_sph[3] = *radius_tail * obscale;
711 tail_sph[3] += *distance * obscale;
718#ifndef NO_LEGACY_OVERLAY
727 const float (*bone_mat)[4],
728 const float bone_col[4],
729 const float hint_col[4],
730 const float outline_col[4],
731 const float *radius_head,
732 const float *radius_tail,
735 float head_sph[4] = {0.0f, 0.0f, 0.0f, 1.0f}, tail_sph[4] = {0.0f, 1.0f, 0.0f, 1.0f};
736 float xaxis[4] = {1.0f, 0.0f, 0.0f, 1.0f};
741 mul_m4_v4(ctx->
ob->object_to_world().ptr(), head_sph);
742 mul_m4_v4(ctx->
ob->object_to_world().ptr(), tail_sph);
743 mul_m4_v4(ctx->
ob->object_to_world().ptr(), xaxis);
745 head_sph[3] = *radius_head * obscale;
746 tail_sph[3] = *radius_tail * obscale;
751 if (head_sph[3] < 0.0f || tail_sph[3] < 0.0f) {
753 if (head_sph[3] < 0.0f) {
768 if (outline_col[3] > 0.0f) {
772#ifndef NO_LEGACY_OVERLAY
779 if (outline_col[3] > 0.0f) {
790 float fac_head = (
len - head_sph[3]) /
len;
791 float fac_tail = (
len - tail_sph[3]) /
len;
793 if (
len > (tail_sph[3] + head_sph[3]) + 1e-8f) {
808 if (outline_col[3] > 0.0f) {
814#ifndef NO_LEGACY_OVERLAY
819 if (outline_col[3] > 0.0f) {
827 float fac =
max_ff(fac_head, 1.0f - fac_tail);
838 if (outline_col[3] > 0.0f) {
842#ifndef NO_LEGACY_OVERLAY
849 if (outline_col[3] > 0.0f) {
861#ifndef NO_LEGACY_OVERLAY
864 blender::gpu::Batch *custom_geom)
868 if (buf ==
nullptr) {
879 const float (*bone_mat)[4],
880 const float bone_color[4],
881 const float hint_color[4],
882 const float outline_color[4],
883 const float wire_width,
890 DRW_mesh_batch_cache_validate(custom, mesh);
892 blender::gpu::Batch *surf = DRW_mesh_batch_cache_get_surface(mesh);
893 blender::gpu::Batch *edges = DRW_mesh_batch_cache_get_edge_detection(mesh,
nullptr);
894 blender::gpu::Batch *loose_edges = DRW_mesh_batch_cache_get_loose_edges(mesh);
898 if (surf || edges || loose_edges) {
906 ctx->
bone_buf->custom_shape_fill_get_buffer(surf).
append(inst_data, select_id);
908#ifndef NO_LEGACY_OVERLAY
919 ctx->
bone_buf->custom_shape_outline_get_buffer(edges).
append(inst_data, select_id);
921#ifndef NO_LEGACY_OVERLAY
933 ctx->
bone_buf->custom_shape_wire_get_buffer(loose_edges).
append(inst_data, select_id);
935#ifndef NO_LEGACY_OVERLAY
949 const float (*bone_mat)[4],
950 const float color[4],
951 const float wire_width,
958 DRW_mesh_batch_cache_validate(custom, mesh);
960 blender::gpu::Batch *geom = DRW_mesh_batch_cache_get_all_edges(mesh);
968 ctx->
bone_buf->custom_shape_wire_get_buffer(geom).
append(inst_data, select_id);
970#ifndef NO_LEGACY_OVERLAY
984 const float (*bone_mat)[4],
985 const float outline_color[4],
986 const float wire_width,
993 DRW_curve_batch_cache_validate(curve);
997 blender::gpu::Batch *loose_edges =
nullptr;
1012 ctx->
bone_buf->custom_shape_wire_get_buffer(loose_edges).
append(inst_data, select_id);
1014#ifndef NO_LEGACY_OVERLAY
1027 const float (*bone_mat)[4],
1028 const float bone_color[4],
1029 const float hint_color[4],
1030 const float outline_color[4],
1031 const float wire_width,
1040 if (mesh !=
nullptr) {
1055 static_cast<Curve *
>(custom->data),
1065 const float (*bone_mat)[4],
1066 const float color[4],
1067 const float wire_width,
1073 if (mesh !=
nullptr) {
1080 ctx,
static_cast<Curve *
>(custom->data), bone_mat, color, wire_width, select_id, custom);
1085 const float (*bone_mat)[4],
1086 const float color[4],
1087 const float wire_width,
1094 gpu::Batch *geom =
nullptr;
1095 switch (custom->empty_drawtype) {
1130 ctx->
bone_buf->custom_shape_wire_get_buffer(geom).
append(inst_data, select_id);
1134#ifndef NO_LEGACY_OVERLAY
1138 switch (custom->empty_drawtype) {
1147 ctx->
extras, mat.
ptr(), custom->empty_drawsize, custom->empty_drawtype, final_color);
1157 const float (*bone_mat)[4],
1158 const float bone_color[4],
1159 const float hint_color[4],
1160 const float outline_color[4],
1161 const int select_id)
1169 ctx->
bone_buf->sphere_fill_buf.
append({mat, bone_color, hint_color}, sel_id);
1171 if (outline_color[3] > 0.0f) {
1172 ctx->
bone_buf->sphere_outline_buf.
append({mat, outline_color}, sel_id);
1177#ifndef NO_LEGACY_OVERLAY
1179 inst_data.
mat44 = mat;
1186 if (outline_color[3] > 0.0f) {
1195 const float (*bone_mat)[4],
1196 const float color[4])
1208#ifndef NO_LEGACY_OVERLAY
1215 const float start[3],
1217 const float color[4])
1226#ifndef NO_LEGACY_OVERLAY
1235 const float start[3],
1242 const float start[3],
1249 const float start[3],
1257 const float start[3],
1292 r = offset +
int(cp[0]);
1294 g = offset +
int(cp[1]);
1296 b = offset +
int(cp[2]);
1311 uint8_t srgb_color[4] = {255, 255, 255, 255};
1315 if (shade_offset != 0) {
1334 if (draw_active && draw_selected) {
1337 else if (draw_active) {
1340 else if (draw_selected) {
1348 if (draw_active && draw_selected) {
1351 else if (draw_active) {
1355 else if (draw_selected) {
1384 if ((constflag & flags_to_color) == 0 ||
1392 float solid_color[4];
1431 static float disp_color[4];
1455 static float consts_color[4];
1457 return consts_color;
1475 static float disp_color[4];
1509 hint_color[3] = 1.0f;
1515 static float hint_color[4] = {0.0f, 0.0f, 0.0f, 1.0f};
1552 float bone_scale[3];
1553 float(*bone_mat)[4];
1584 eBone->bbone_child =
nullptr;
1589 eBone->parent->bbone_child = eBone;
1599 float imat[4][4], bonemat[4][4];
1602 memset(¶m, 0,
sizeof(param));
1685 param.
roll1 += prev->roll2;
1713 float s[4][4], ebmat[4][4];
1714 float length, xwidth, zwidth;
1715 float(*bone_mat)[4];
1716 short bbone_segments;
1741 const float3 size_vec = {xwidth, length / bbone_segments, zwidth};
1750 if (bbone_segments > 1) {
1753 for (
int i = bbone_segments; i--; bbones_mat++) {
1766 if (bbone_segments > 1) {
1769 for (
int i = bbone_segments; i--; bbones_mat++) {
1799 float axis_mat[4][4];
1809 float disp_mat[4][4];
1819 const float col_solid[4],
1820 const int select_id)
1822 float col_wire_root[4], col_wire_tail[4];
1823 float col_hint_root[4], col_hint_tail[4];
1829 const float envelope_ignore = -1.0f;
1849 const float *hint_color_shade_root = (ctx->
const_color) ?
1852 const float *hint_color_shade_tail = (ctx->
const_color) ?
1861#ifndef NO_LEGACY_OVERLAY
1867 if (is_envelope_draw) {
1884#ifndef NO_LEGACY_OVERLAY
1890 if (is_envelope_draw) {
1909#ifndef NO_LEGACY_OVERLAY
1926 float tmp[4][4], posetrans[4][4];
1927 float xminmax[2], zminmax[2];
1949 tmp[1][1] = -tmp[1][1];
1961 inst_data.
mat44,
float4(0.25f), xminmax[0], zminmax[0], xminmax[1], zminmax[1]);
1964 ctx->
bone_buf->degrees_of_freedom_wire_buf.
append(data.with_color({0.0f, 0.0f, 0.0f, 1.0f}),
1967#ifndef NO_LEGACY_OVERLAY
1970 &inst_data, xminmax[0], zminmax[0], xminmax[1], zminmax[1]);
1982 inst_data.
mat44,
float4(1.0f, 0.0f, 0.0f, 1.0f), xminmax[0], 0.0f, xminmax[1], 0.0f);
1985#ifndef NO_LEGACY_OVERLAY
1996 inst_data.
mat44,
float4(0.0f, 0.0f, 1.0f, 1.0f), 0.0f, zminmax[0], 0.0f, zminmax[1]);
1999#ifndef NO_LEGACY_OVERLAY
2017 const bool only_temp)
2020 const float *line_start =
nullptr, *line_end =
nullptr;
2024 if (con->enforce == 0.0f) {
2028 switch (con->type) {
2043 while (parchan->
parent) {
2045 if (segcount == data->rootbone || segcount > 255) {
2048 parchan = parchan->
parent;
2076 while (parchan->
parent) {
2079 if (segcount == data->chainlen || segcount > 255) {
2082 parchan = parchan->
parent;
2085 if (parchan != pchan) {
2096 const float bone_head[3],
2097 const float parent_head[3],
2098 const float parent_tail[3])
2153 bone.
get(&eBone, &pchan);
2163 const float *head = is_pose ? pchan->
pose_head : eBone->
head;
2164 const float *tail = is_pose ? pchan->
pose_tail : eBone->
tail;
2170 is_pose ? pchan->
name : eBone->
name,
2171 is_pose ? strlen(pchan->
name) : strlen(eBone->
name),
2196 float min[3], max[3];
2256 const bool )
const override
2263 const int )
const override
2273 float bone_scale[3];
2274 float(*bone_mat)[4];
2275 float(*disp_mat)[4];
2276 float(*disp_tail_mat)[4];
2277 float rot_mat[3][3];
2314 const bool )
const override
2321 const int select_id)
const override
2360#ifndef NO_LEGACY_OVERLAY
2361 if (select_id != -1) {
2401 if (select_id != -1) {
2422 const float scale = 1.2f;
2428 const bool is_filled,
2429 const bool )
const override
2438 const int select_id)
const override
2450 ctx->
bone_buf->octahedral_fill_buf.
append({bone_mat, col_solid, col_hint}, sel_id);
2452 if (col_wire[3] > 0.0f) {
2453 ctx->
bone_buf->octahedral_outline_buf.
append({bone_mat, col_wire}, sel_id);
2456 draw_points(ctx, bone, boneflag, col_solid, select_id);
2460#ifndef NO_LEGACY_OVERLAY
2461 if (select_id != -1) {
2467 if (select_id != -1) {
2471 draw_points(ctx, bone, boneflag, col_solid, select_id);
2491 const float scale = 1.1f;
2498 const bool )
const override
2506 const int select_id)
const override
2510 const float no_display[4] = {0.0f, 0.0f, 0.0f, 0.0f};
2511 const float *col_head = no_display;
2512 const float *col_tail = col_bone;
2515 col_wire = no_display;
2516 col_bone = col_head = col_tail = ctx->
const_color;
2530 col_head = col_bone;
2535 if (select_id == -1) {
2538 ctx, bone.
disp_mat(), col_wire, col_bone, col_head, col_tail, select_id);
2542#ifndef NO_LEGACY_OVERLAY
2555 if (col_head[3] > 0.0f) {
2556#ifndef NO_LEGACY_OVERLAY
2570#ifndef NO_LEGACY_OVERLAY
2583#ifndef NO_LEGACY_OVERLAY
2609 for (
int i = pchan->
bone->
segments; i--; bbones_mat++) {
2624 const bool is_filled,
2625 const bool )
const override
2634 const int select_id)
const override
2657 for (
const Mat4 &in_bone_mat : bbone_matrices) {
2661 ctx->
bone_buf->bbones_fill_buf.
append({bone_mat, col_solid, col_hint}, sel_id);
2663 if (col_wire[3] > 0.0f) {
2664 ctx->
bone_buf->bbones_outline_buf.
append({bone_mat, col_wire}, sel_id);
2669 draw_points(ctx, bone, boneflag, col_solid, select_id);
2674#ifndef NO_LEGACY_OVERLAY
2675 if (select_id != -1) {
2684 for (
int i = pchan->
bone->
segments; i--; bbones_mat++) {
2690 for (
int i = 0; i < eBone->
segments; i++) {
2695 if (select_id != -1) {
2700 draw_points(ctx, bone, boneflag, col_solid, select_id);
2731 const bool is_filled,
2732 const bool do_envelope_dist)
const override
2742 const int select_id)
const override
2748 const float *rad_head, *rad_tail, *
distance;
2752 distance = &eBone->
dist;
2771#ifndef NO_LEGACY_OVERLAY
2772 if (select_id != -1) {
2786#ifndef NO_LEGACY_OVERLAY
2787 if (select_id != -1) {
2792 draw_points(ctx, bone, boneflag, col_solid, select_id);
2815 const bool )
const override
2824 const int select_id)
const override
2830#ifndef NO_LEGACY_OVERLAY
2850 for (
const Mat4 &in_bone_mat : bbone_matrices) {
2864#ifndef NO_LEGACY_OVERLAY
2872 draw_points(ctx, bone, boneflag, col_solid, select_id);
2909 return strat_b_bone;
2911 return strat_envelope;
2950 eBone = eBone->
next, index += 0x10000)
2956 const int select_id = is_select ? index :
uint(-1);
2961 boneflag &= ~BONE_CONNECTED;
2969 boneflag &= ~BONE_DRAW_LOCKED_WEIGHT;
2981 draw_strat.
draw_bone(ctx, bone, boneflag, select_id);
3004 bool draw_locked_weights =
false;
3013 bool is_pose_select =
false;
3036 if (is_pose_select) {
3045 (draw_ctx->
obact !=
nullptr))
3047 draw_locked_weights =
true;
3050 pchan->
bone->
flag &= ~BONE_DRAW_LOCKED_WEIGHT;
3080 pchan = pchan->
next, index += 0x10000)
3092 const int select_id = is_pose_select ? index :
uint(-1);
3104 boneflag &= ~BONE_CONNECTED;
3110 if (!draw_locked_weights) {
3111 boneflag &= ~BONE_DRAW_LOCKED_WEIGHT;
3117 if (!is_pose_select) {
3122 if (!is_pose_select || draw_strat.
culling_test(view, ob, pchan)) {
3123 draw_strat.
draw_bone(ctx, bone_ptr, boneflag, select_id);
3127 if (is_pose_select) {
3147 const float *const_color)
3154 const bool draw_as_wire = (ob->
dt <
OB_SOLID);
3155 const bool is_filled = (!pd->
armature.
transparent && !draw_as_wire) || is_edit_or_pose_mode;
3156 const bool is_transparent = pd->
armature.
transparent || (draw_as_wire && is_edit_or_pose_mode);
3161 static const float select_const_color[4] = {1.0f, 1.0f, 1.0f, 1.0f};
3176 is_edit_or_pose_mode;
3180 ((!is_filled || is_transparent) ? 1.0f : 0.0f));
3234 if (ob_mesh_deform) {
3261 for (
int i = 0; i < 2; i++) {
C++ functions to deal with Armature collections (i.e. the successor of bone layers).
bool ANIM_bone_is_visible(const bArmature *armature, const Bone *bone)
C++ part of the BoneColor DNA struct.
Blender kernel action and pose functionality.
bPoseChannel * BKE_pose_channel_find_name(const bPose *pose, const char *name)
void BKE_pchan_bbone_spline_setup(bPoseChannel *pchan, bool rest, bool for_deform, Mat4 *result_array)
void BKE_pchan_minmax(const Object *ob, const bPoseChannel *pchan, const bool use_empty_drawtype, float r_min[3], float r_max[3])
int BKE_pchan_bbone_spline_compute(BBoneSplineParameters *param, bool for_deform, Mat4 *result_array)
Object * BKE_modifiers_is_deformed_by_meshdeform(Object *ob)
Object * BKE_modifiers_is_deformed_by_armature(Object *ob)
General operations, lookup, etc. for blender objects.
Mesh * BKE_object_get_evaluated_mesh_no_subsurf_unchecked(const Object *object)
#define BLI_assert_unreachable()
#define BLI_assert_msg(a, msg)
GHash * BLI_ghash_ptr_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void * BLI_ghash_lookup(const GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
void BLI_ghash_insert(GHash *gh, void *key, void *val)
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
#define LISTBASE_FOREACH(type, var, list)
MINLINE float max_ff(float a, float b)
MINLINE float clamp_f(float value, float min, float max)
MINLINE void srgb_to_linearrgb_v4(float linear[4], const float srgb[4])
void rgba_uchar_to_float(float r_col[4], const unsigned char col_ub[4])
float mat4_to_scale(const float mat[4][4])
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
void mul_m4_m4m3(float R[4][4], const float A[4][4], const float B[3][3])
void unit_m4(float m[4][4])
void translate_m4(float mat[4][4], float Tx, float Ty, float Tz)
void rescale_m4(float mat[4][4], const float scale[3])
void size_to_mat4(float R[4][4], const float size[3])
void mul_m4_v3(const float M[4][4], float r[3])
void scale_m4_fl(float R[4][4], float scale)
void copy_m4_m4(float m1[4][4], const float m2[4][4])
float mat4_to_size_max_axis(const float M[4][4])
void mul_v3_m4v3(float r[3], const float mat[4][4], const float vec[3])
void mul_m4_v4(const float mat[4][4], float r[4])
bool invert_m4(float mat[4][4])
void mat4_to_size(float size[3], const float M[4][4])
void eulO_to_mat3(float M[3][3], const float e[3], short order)
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v4_fl4(float v[4], float x, float y, float z, float w)
MINLINE void sub_v3_v3(float r[3], const float a[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void copy_v3_v3_uchar(unsigned char r[3], const unsigned char a[3])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
void interp_v4_v4v4(float r[4], const float a[4], const float b[4], float t)
MINLINE void copy_v3_fl3(float v[3], float x, float y, float z)
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], float t)
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void mul_v3_v3v3(float r[3], const float v1[3], const float v2[3])
void mid_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void copy_v3_fl(float r[3], float f)
MINLINE void zero_v3(float r[3])
MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f)
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
#define INIT_MINMAX(min, max)
#define UNUSED_VARS_NDEBUG(...)
Object * DEG_get_original_object(Object *object)
#define PCHAN_CUSTOM_BONE_LENGTH(pchan)
@ BONE_DRAW_LOCKED_WEIGHT
@ ARM_DRAW_RELATION_FROM_HEAD
@ BBONE_ADD_PARENT_END_ROLL
@ CONSTRAINT_TYPE_SPLINEIK
@ CONSTRAINT_TYPE_KINEMATIC
#define OB_MODE_ALL_WEIGHT_PAINT
Object is a sort of wrapper for general info.
#define BASE_SELECTED(v3d, base)
@ USER_GPU_FLAG_OVERLAY_SMOOTH_WIRE
@ V3D_OVERLAY_BONE_SELECT
#define DRW_buffer_add_entry(buffer,...)
#define DRW_PASS_CREATE(pass, state)
#define DRW_shgroup_uniform_block(shgroup, name, ubo)
#define DRW_shgroup_call(shgroup, geom, ob)
#define EBONE_VISIBLE(arm, ebone)
#define XRAY_FLAG_ENABLED(v3d)
void GPU_framebuffer_bind(GPUFrameBuffer *framebuffer)
void GPU_framebuffer_clear_depth(GPUFrameBuffer *fb, float clear_depth)
void UI_GetThemeColor4ubv(int colorid, unsigned char col[4])
void ED_armature_ebone_to_mat4(EditBone *ebone, float r_mat[4][4])
struct GPUShader GPUShader
SIMD_FORCE_INLINE btScalar length() const
Return the length of the vector.
void draw_context_setup(Armatures::DrawContext *ctx, const OVERLAY_ArmatureCallBuffersInner *cb, const bool is_filled, const bool) const override
void update_display_matrix(UnifiedBonePtr bone) const override
void draw_bone(const Armatures::DrawContext *ctx, const UnifiedBonePtr bone, const eBone_Flag boneflag, const int select_id) const override
bool culling_test(const DRWView *view, const Object *ob, const bPoseChannel *pchan) const override
bool culling_test(const DRWView *view, const Object *ob, const bPoseChannel *pchan) const override
void draw_bone(const Armatures::DrawContext *ctx, const UnifiedBonePtr bone, const eBone_Flag boneflag, const int select_id) const override
void update_display_matrix(UnifiedBonePtr bone) const override
void draw_context_setup(Armatures::DrawContext *, const OVERLAY_ArmatureCallBuffersInner *, const bool, const bool) const override
void draw_context_setup(Armatures::DrawContext *, const OVERLAY_ArmatureCallBuffersInner *, const bool, const bool) const override
bool culling_test(const DRWView *, const Object *, const bPoseChannel *) const override
void draw_bone(const Armatures::DrawContext *, const UnifiedBonePtr, const eBone_Flag, const int) const override
void update_display_matrix(UnifiedBonePtr bone) const override
void update_display_matrix(UnifiedBonePtr bone) const override
bool culling_test(const DRWView *view, const Object *ob, const bPoseChannel *pchan) const override
void draw_context_setup(Armatures::DrawContext *ctx, const OVERLAY_ArmatureCallBuffersInner *cb, const bool is_filled, const bool do_envelope_dist) const override
void draw_bone(const Armatures::DrawContext *ctx, const UnifiedBonePtr bone, const eBone_Flag boneflag, const int select_id) const override
void draw_context_setup(Armatures::DrawContext *ctx, const OVERLAY_ArmatureCallBuffersInner *cb, const bool, const bool) const override
void draw_bone(const Armatures::DrawContext *ctx, const UnifiedBonePtr bone, const eBone_Flag boneflag, const int select_id) const override
bool culling_test(const DRWView *view, const Object *ob, const bPoseChannel *pchan) const override
void update_display_matrix(UnifiedBonePtr bone) const override
void update_display_matrix(UnifiedBonePtr bone) const override
void draw_context_setup(Armatures::DrawContext *ctx, const OVERLAY_ArmatureCallBuffersInner *cb, const bool is_filled, const bool) const override
bool culling_test(const DRWView *view, const Object *ob, const bPoseChannel *pchan) const override
void draw_bone(const Armatures::DrawContext *ctx, const UnifiedBonePtr bone, const eBone_Flag boneflag, const int select_id) const override
void draw_bone(const Armatures::DrawContext *ctx, const UnifiedBonePtr bone, const eBone_Flag boneflag, const int select_id) const override
void update_display_matrix(UnifiedBonePtr bone) const override
void draw_context_setup(Armatures::DrawContext *ctx, const OVERLAY_ArmatureCallBuffersInner *cb, const bool, const bool) const override
bool culling_test(const DRWView *view, const Object *ob, const bPoseChannel *pchan) const override
virtual void update_display_matrix(UnifiedBonePtr bone) const =0
virtual void draw_bone(const Armatures::DrawContext *ctx, const UnifiedBonePtr bone, const eBone_Flag boneflag, const int select_id) const =0
virtual bool culling_test(const DRWView *view, const Object *ob, const bPoseChannel *pchan) const =0
virtual bool should_draw_relation_to_parent(const UnifiedBonePtr bone, const eBone_Flag boneflag) const
virtual void draw_context_setup(Armatures::DrawContext *ctx, const OVERLAY_ArmatureCallBuffersInner *cb, const bool is_filled, const bool do_envelope_dist) const =0
const f44 & disp_tail_mat() const
ePchan_ConstFlag constflag() const
UnifiedBonePtr(EditBone *eBone)
bPoseChannel * as_posebone()
void get(EditBone **eBone, bPoseChannel **pchan)
const f44 & disp_mat() const
void get(const EditBone **eBone, const bPoseChannel **pchan) const
const EditBone * as_editbone() const
UnifiedBonePtr(const UnifiedBonePtr &ptr)=default
UnifiedBonePtr(bPoseChannel *pchan)
const float & rad_head() const
const float & rad_tail() const
const blender::animrig::BoneColor & effective_bonecolor() const
const char * name() const
const bPoseChannel * as_posebone() const
const ThemeWireColor * effective_color() const
static void draw_armature_pose(Armatures::DrawContext *ctx)
static void draw_armature_edit(Armatures::DrawContext *ctx)
local_group_size(16, 16) .push_constant(Type b
blender::gpu::Batch * DRW_cache_bone_point_get()
blender::gpu::Batch * DRW_cache_object_surface_get(Object *ob)
blender::gpu::Batch * DRW_cache_curve_edge_wire_get(Object *ob)
blender::gpu::Batch * DRW_cache_bone_point_wire_outline_get()
blender::gpu::Batch * DRW_cache_text_edge_wire_get(Object *ob)
blender::gpu::Batch * DRW_cache_bone_envelope_solid_get()
blender::gpu::Batch * DRW_cache_bone_octahedral_wire_get()
blender::gpu::Batch * DRW_cache_bone_octahedral_get()
void drw_batch_cache_generate_requested_delayed(Object *ob)
blender::gpu::Batch * DRW_cache_bone_envelope_outline_get()
blender::gpu::Batch * DRW_cache_bone_dof_lines_get()
blender::gpu::Batch * DRW_cache_bone_box_get()
blender::gpu::Batch * DRW_cache_bone_stick_get()
blender::gpu::Batch * DRW_cache_bone_dof_sphere_get()
blender::gpu::Batch * DRW_cache_bone_box_wire_get()
int DRW_object_wire_theme_get(Object *ob, ViewLayer *view_layer, float **r_color)
bool DRW_state_show_text()
DRWTextStore * DRW_text_cache_ensure()
DefaultTextureList * DRW_viewport_texture_list_get()
const DRWContextState * DRW_context_state_get()
bool DRW_state_is_select()
const DRWView * DRW_view_default_get()
DRWShadingGroup * DRW_shgroup_create(GPUShader *shader, DRWPass *pass)
void DRW_shgroup_uniform_float_copy(DRWShadingGroup *shgroup, const char *name, const float value)
void DRW_shgroup_state_disable(DRWShadingGroup *shgroup, DRWState state)
void DRW_buffer_add_entry_struct(DRWCallBuffer *callbuf, const void *data)
void DRW_shgroup_state_enable(DRWShadingGroup *shgroup, DRWState state)
DRWCallBuffer * DRW_shgroup_call_buffer_instance(DRWShadingGroup *shgroup, GPUVertFormat *format, blender::gpu::Batch *geom)
void DRW_shgroup_uniform_vec4_copy(DRWShadingGroup *shgroup, const char *name, const float *value)
void DRW_shgroup_uniform_texture_ref(DRWShadingGroup *shgroup, const char *name, GPUTexture **tex)
void DRW_shgroup_uniform_bool_copy(DRWShadingGroup *shgroup, const char *name, const bool value)
bool DRW_culling_sphere_test(const DRWView *view, const BoundSphere *bsphere)
void DRW_draw_pass(DRWPass *pass)
void DRW_select_load_id(uint id)
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)
@ DRW_TEXT_CACHE_GLOBALSPACE
@ DRW_TEXT_CACHE_STRING_PTR
@ DRW_STATE_IN_FRONT_SELECT
@ DRW_STATE_DEPTH_LESS_EQUAL
draw_view in_light_buf[] float
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
void *(* MEM_mallocN)(size_t len, const char *str)
VecBase< T, 3 > transform_point(const CartesianBasis &basis, const VecBase< T, 3 > &v)
MatBase< float, 4, 4 > float4x4
ListBaseWrapperTemplate< const ListBase, const T > ConstListBaseWrapper
VecBase< float, 4 > float4
ListBaseWrapperTemplate< ListBase, T > ListBaseWrapper
float distance(float a, float b)
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 const float * get_bone_solid_color(const Armatures::DrawContext *ctx, const eBone_Flag boneflag)
static void drw_shgroup_bone_relationship_lines_ex(const Armatures::DrawContext *ctx, const float start[3], const float end[3], const float color[4])
static const float * get_bone_solid_with_consts_color(const Armatures::DrawContext *ctx, const UnifiedBonePtr bone, const eBone_Flag boneflag)
static void ebone_spline_preview(EditBone *ebone, const float result_array[MAX_BBONE_SUBDIV][4][4])
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)
static void drw_shgroup_bone_ik_spline_lines(const Armatures::DrawContext *ctx, const float start[3], const float end[3])
static bool POSE_is_driven_by_active_armature(Object *ob)
void OVERLAY_armature_in_front_draw(OVERLAY_Data *vedata)
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_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)
bool OVERLAY_armature_is_pose_mode(Object *ob, const DRWContextState *draw_ctx)
static void drw_shgroup_bone_box(const Armatures::DrawContext *ctx, const float(*bone_mat)[4], const float bone_color[4], const float hint_color[4], const float outline_color[4])
void OVERLAY_edit_armature_cache_populate(OVERLAY_Data *vedata, Object *ob)
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)
static bool pchan_culling_test_with_radius_scale(const DRWView *view, const Object *ob, const bPoseChannel *pchan, const float scale)
static const float * get_bone_hint_color(const Armatures::DrawContext *ctx, const eBone_Flag boneflag)
static void pchan_culling_calc_bsphere(const Object *ob, const bPoseChannel *pchan, BoundSphere *r_bsphere)
static void draw_axes(const Armatures::DrawContext *ctx, const UnifiedBonePtr bone, const bArmature *arm)
void OVERLAY_armature_cache_finish(OVERLAY_Data *vedata)
void OVERLAY_bone_instance_data_set_color_hint(BoneInstanceData *data, const float hint_color[4])
static void use_bone_color(float *r_color, const uint8_t *color_from_theme, const int shade_offset)
void OVERLAY_armature_cache_init(OVERLAY_Data *vedata)
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])
static void draw_points(const Armatures::DrawContext *ctx, const UnifiedBonePtr bone, const eBone_Flag boneflag, const float col_solid[4], const int select_id)
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 draw_bone_degrees_of_freedom(const Armatures::DrawContext *ctx, const bPoseChannel *pchan)
static void draw_bone_relations(const Armatures::DrawContext *ctx, const ArmatureBoneDrawStrategy &draw_strategy, const UnifiedBonePtr bone, const eBone_Flag boneflag)
static void drw_shgroup_bone_axes(const Armatures::DrawContext *ctx, const float(*bone_mat)[4], const float color[4])
static void edbo_compute_bbone_child(bArmature *arm)
static void drw_shgroup_bone_ik_lines(const Armatures::DrawContext *ctx, const float start[3], const float end[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)
void OVERLAY_pose_armature_cache_populate(OVERLAY_Data *vedata, Object *ob)
static void draw_bone_name(const Armatures::DrawContext *ctx, const UnifiedBonePtr bone, const eBone_Flag boneflag)
static void bone_hint_color_shade(float hint_color[4], const float color[4])
static void draw_bone_update_disp_matrix_default(UnifiedBonePtr bone)
void OVERLAY_pose_cache_populate(OVERLAY_Data *vedata, Object *ob)
static void bone_locked_color_shade(float color[4])
static ArmatureBoneDrawStrategy & strategy_for_armature_drawtype(const eArmature_Drawtype drawtype)
void OVERLAY_armature_cache_populate(OVERLAY_Data *vedata, Object *ob)
static void draw_bone_update_disp_matrix_bbone(UnifiedBonePtr bone)
static void get_pchan_color_wire(const ThemeWireColor *bcolor, const eArmatureDrawMode draw_mode, const eBone_Flag boneflag, float r_color[4])
static float encode_2f_to_float(float a, float b)
static void get_pchan_color_solid(const ThemeWireColor *bcolor, float r_color[4])
static void armature_context_setup(Armatures::DrawContext *ctx, OVERLAY_PrivateData *pd, Object *ob, const eArmatureDrawMode draw_mode, const float *const_color)
static float get_bone_wire_thickness(const Armatures::DrawContext *ctx, int boneflag)
#define BUF_LINE(grp, format)
BLI_INLINE DRWCallBuffer * custom_bone_instance_shgroup(const Armatures::DrawContext *ctx, DRWShadingGroup *grp, blender::gpu::Batch *custom_geom)
static void bone_instance_data_set_angle_minmax(BoneInstanceData *data, const float aminx, const float aminz, const float amaxx, const float amaxz)
static void get_pchan_color_constraint(const ThemeWireColor *bcolor, const UnifiedBonePtr bone, float r_color[4])
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)
static void pchan_draw_ik_lines(const Armatures::DrawContext *ctx, const bPoseChannel *pchan, const bool only_temp)
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 pchan_draw_data_init(bPoseChannel *pchan)
void OVERLAY_pose_draw(OVERLAY_Data *vedata)
static bool pchan_culling_test_simple(const DRWView *view, const Object *ob, const bPoseChannel *pchan)
void OVERLAY_armature_draw(OVERLAY_Data *vedata)
static void drw_shgroup_bone_ik_no_target_lines(const Armatures::DrawContext *ctx, const float start[3], const float end[3])
static void set_ctx_bcolor(Armatures::DrawContext *ctx, const UnifiedBonePtr bone)
static void cp_shade_color3ub(uchar cp[3], const int offset)
static const float * get_bone_wire_color(const Armatures::DrawContext *ctx, const eBone_Flag boneflag)
static void drw_shgroup_bone_octahedral(const Armatures::DrawContext *ctx, const float(*bone_mat)[4], const float bone_color[4], const float hint_color[4], const float outline_color[4])
static void drw_shgroup_bone_relationship_lines(const Armatures::DrawContext *ctx, const float start[3], const float end[3])
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 OVERLAY_bone_instance_data_set_color(BoneInstanceData *data, const float bone_color[4])
GPUShader * OVERLAY_shader_armature_wire()
GPUShader * OVERLAY_shader_uniform_color()
GPUShader * OVERLAY_shader_armature_stick()
GPUShader * OVERLAY_shader_armature_shape(bool use_outline)
GPUShader * OVERLAY_shader_armature_sphere(bool use_outline)
GPUShader * OVERLAY_shader_armature_shape_wire()
GPUShader * OVERLAY_shader_armature_degrees_of_freedom_wire()
GPUShader * OVERLAY_shader_armature_degrees_of_freedom_solid()
GPUShader * OVERLAY_shader_armature_envelope(bool use_outline)
OVERLAY_InstanceFormats * OVERLAY_shader_instance_formats_get()
#define WIRE_WIDTH_COMPRESSION
void set_hint_color(const float4 &hint_color)
void set_color(const float4 &bone_color)
GPUUniformBuf * block_ubo
float disp_bbone_mat[32][4][4]
float disp_tail_mat[4][4]
float4 color_bone_pose_active_unsel
float4 color_vertex_select
float4 color_bone_active_unsel
float4 color_bone_ik_line_no_target
float4 color_bone_pose_no_target
float4 color_bone_pose_constraint
float4 color_bone_pose_active
float4 color_bone_pose_ik
float4 color_bone_ik_line
float4 color_bone_ik_line_spline
float4 color_bone_pose_spline_ik
DRWShadingGroup * custom_outline
GHash * custom_shapes_ghash
DRWShadingGroup * custom_fill
DRWCallBuffer * point_fill
DRWShadingGroup * custom_wire
DRWCallBuffer * envelope_distance
DRWCallBuffer * envelope_outline
DRWCallBuffer * octa_fill
DRWCallBuffer * dof_lines
DRWCallBuffer * point_outline
DRWCallBuffer * octa_outline
DRWCallBuffer * box_outline
DRWCallBuffer * envelope_fill
DRWCallBuffer * dof_sphere
OVERLAY_ArmatureCallBuffersInner transp
OVERLAY_ArmatureCallBuffersInner solid
OVERLAY_StorageList * stl
OVERLAY_FramebufferList * fbl
GPUFrameBuffer * overlay_default_fb
GPUFrameBuffer * overlay_line_in_front_fb
DRWPass * armature_bone_select_ps
DRWPass * armature_transp_ps[2]
OVERLAY_ExtraCallBuffers extra_call_buffers[2]
DRWShadingGroup * armature_bone_select_grp
struct OVERLAY_PrivateData::@234 armature
OVERLAY_ArmatureCallBuffers armature_call_buffers[2]
DRWShadingGroup * armature_bone_select_act_grp
ObjectRuntimeHandle * runtime
struct EditBone * act_edbone
float bbone_matrix[0][4][4]
float custom_scale_xyz[3]
bPoseChannelDrawData * draw_data
float custom_rotation_euler[3]
struct bPoseChannel * parent
struct bPoseChannel * custom_tx
struct bPoseChannel * next
float custom_translation[3]
float custom_shape_wire_width
float disp_tail_mat[4][4]
const c_style_mat & ptr() const
GHash * custom_shapes_ghash
DRWCallBuffer * envelope_distance
DRWCallBuffer * dof_sphere
bool draw_envelope_distance
DRWCallBuffer * envelope_outline
OVERLAY_ExtraCallBuffers * extras
bool is_overlay_next() const
DRWShadingGroup * custom_outline
const float * const_color
DRWCallBuffer * envelope_solid
DRWCallBuffer * point_outline
Armatures::BoneBuffers * bone_buf
bool draw_relation_from_head
DRWShadingGroup * custom_wire
DRWCallBuffer * point_solid
DRWShadingGroup * custom_solid
DRWCallBuffer * dof_lines
eArmatureDrawMode draw_mode
const ShapeCache * shapes
const ThemeWireColor * bcolor
eArmature_Drawtype drawtype
void append(const float3 &start, const float3 &end, const float4 &color, select::ID select_id=select::SelectMap::select_invalid_id())
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)