Blender V4.3
overlay_armature.cc File Reference
#include <cmath>
#include <cstdlib>
#include <cstring>
#include "DNA_armature_types.h"
#include "DNA_constraint_types.h"
#include "DNA_mesh_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_view3d_types.h"
#include "DRW_render.hh"
#include "BLI_listbase_wrapper.hh"
#include "BLI_math_color.h"
#include "BLI_math_matrix_types.hh"
#include "BLI_math_rotation.h"
#include "BLI_utildefines.h"
#include "BKE_action.hh"
#include "BKE_armature.hh"
#include "BKE_deform.hh"
#include "BKE_modifier.hh"
#include "BKE_object.hh"
#include "BKE_object_types.hh"
#include "DEG_depsgraph_query.hh"
#include "ED_armature.hh"
#include "ED_view3d.hh"
#include "ANIM_bone_collections.hh"
#include "ANIM_bonecolor.hh"
#include "UI_resources.hh"
#include "draw_common_c.hh"
#include "draw_manager_text.hh"
#include "overlay_next_armature.hh"
#include "overlay_private.hh"
#include "draw_cache_impl.hh"

Go to the source code of this file.

Classes

class  UnifiedBonePtr
 
class  ArmatureBoneDrawStrategy
 
class  ArmatureBoneDrawStrategyEmpty
 
class  ArmatureBoneDrawStrategyCustomShape
 
class  ArmatureBoneDrawStrategyOcta
 
class  ArmatureBoneDrawStrategyLine
 
class  ArmatureBoneDrawStrategyBBone
 
class  ArmatureBoneDrawStrategyEnvelope
 
class  ArmatureBoneDrawStrategyWire
 

Macros

#define PT_DEFAULT_RAD   0.05f /* radius of the point batch. */
 
#define BUF_INSTANCE   DRW_shgroup_call_buffer_instance
 
#define BUF_LINE(grp, format)   DRW_shgroup_call_buffer(grp, format, GPU_PRIM_LINES)
 
#define BUF_POINT(grp, format)   DRW_shgroup_call_buffer(grp, format, GPU_PRIM_POINTS)
 

Functions

bool OVERLAY_armature_is_pose_mode (Object *ob, const DRWContextState *draw_ctx)
 
void OVERLAY_armature_cache_init (OVERLAY_Data *vedata)
 
Shader Groups (DRW_shgroup)
static void bone_instance_data_set_angle_minmax (BoneInstanceData *data, const float aminx, const float aminz, const float amaxx, const float amaxz)
 
static float encode_2f_to_float (float a, float b)
 
void OVERLAY_bone_instance_data_set_color_hint (BoneInstanceData *data, const float hint_color[4])
 
void OVERLAY_bone_instance_data_set_color (BoneInstanceData *data, const float bone_color[4])
 
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_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])
 
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 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_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)
 
BLI_INLINE DRWCallBuffercustom_bone_instance_shgroup (const Armatures::DrawContext *ctx, DRWShadingGroup *grp, blender::gpu::Batch *custom_geom)
 
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_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 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 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 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 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_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)
 
static void drw_shgroup_bone_axes (const Armatures::DrawContext *ctx, const float(*bone_mat)[4], const float color[4])
 
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 void drw_shgroup_bone_relationship_lines (const Armatures::DrawContext *ctx, const float start[3], const float end[3])
 
static void drw_shgroup_bone_ik_lines (const Armatures::DrawContext *ctx, const float start[3], const float end[3])
 
static void drw_shgroup_bone_ik_no_target_lines (const Armatures::DrawContext *ctx, const float start[3], const float end[3])
 
static void drw_shgroup_bone_ik_spline_lines (const Armatures::DrawContext *ctx, const float start[3], const float end[3])
 
Drawing Theme Helpers
Note
this section is duplicate of code in 'drawarmature.c'.
static void set_ctx_bcolor (Armatures::DrawContext *ctx, const UnifiedBonePtr bone)
 
static void cp_shade_color3ub (uchar cp[3], const int offset)
 
static void use_bone_color (float *r_color, const uint8_t *color_from_theme, const int shade_offset)
 
static void get_pchan_color_wire (const ThemeWireColor *bcolor, const eArmatureDrawMode draw_mode, const eBone_Flag boneflag, float r_color[4])
 
static void get_pchan_color_solid (const ThemeWireColor *bcolor, float r_color[4])
 
static void get_pchan_color_constraint (const ThemeWireColor *bcolor, const UnifiedBonePtr bone, float r_color[4])
 
Drawing Color Helpers
static void bone_locked_color_shade (float color[4])
 
static const floatget_bone_solid_color (const Armatures::DrawContext *ctx, const eBone_Flag boneflag)
 
static const floatget_bone_solid_with_consts_color (const Armatures::DrawContext *ctx, const UnifiedBonePtr bone, const eBone_Flag boneflag)
 
static float get_bone_wire_thickness (const Armatures::DrawContext *ctx, int boneflag)
 
static const floatget_bone_wire_color (const Armatures::DrawContext *ctx, const eBone_Flag boneflag)
 
static void bone_hint_color_shade (float hint_color[4], const float color[4])
 
static const floatget_bone_hint_color (const Armatures::DrawContext *ctx, const eBone_Flag boneflag)
 
Helper Utils
static void pchan_draw_data_init (bPoseChannel *pchan)
 
static void draw_bone_update_disp_matrix_default (UnifiedBonePtr bone)
 
static void edbo_compute_bbone_child (bArmature *arm)
 
static void ebone_spline_preview (EditBone *ebone, const float result_array[MAX_BBONE_SUBDIV][4][4])
 
static void draw_bone_update_disp_matrix_bbone (UnifiedBonePtr bone)
 
static void draw_axes (const Armatures::DrawContext *ctx, const UnifiedBonePtr bone, const bArmature *arm)
 
static void draw_points (const Armatures::DrawContext *ctx, const UnifiedBonePtr bone, const eBone_Flag boneflag, const float col_solid[4], const int select_id)
 
Draw Degrees of Freedom
static void draw_bone_degrees_of_freedom (const Armatures::DrawContext *ctx, const bPoseChannel *pchan)
 
Draw Relationships
static void pchan_draw_ik_lines (const Armatures::DrawContext *ctx, const bPoseChannel *pchan, const bool only_temp)
 
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_bone_relations (const Armatures::DrawContext *ctx, const ArmatureBoneDrawStrategy &draw_strategy, const UnifiedBonePtr bone, const eBone_Flag boneflag)
 
static void draw_bone_name (const Armatures::DrawContext *ctx, const UnifiedBonePtr bone, const eBone_Flag boneflag)
 
Pose Bone Culling

Used for selection since drawing many bones can be slow, see: #91253.

Bounding spheres are used with margins added to ensure bones are included. An added margin is needed because BKE_pchan_minmax only returns the bounds of the bones head & tail which doesn't account for parts of the bone users may select (octahedral spheres or envelope radius for example).

static void pchan_culling_calc_bsphere (const Object *ob, const bPoseChannel *pchan, BoundSphere *r_bsphere)
 
static bool pchan_culling_test_simple (const DRWView *view, const Object *ob, const bPoseChannel *pchan)
 
static bool pchan_culling_test_with_radius_scale (const DRWView *view, const Object *ob, const bPoseChannel *pchan, const float scale)
 
Bone Drawing Strategies

Bone drawing uses a strategy pattern for the different armature drawing modes.

static ArmatureBoneDrawStrategystrategy_for_armature_drawtype (const eArmature_Drawtype drawtype)
 
Main Draw Loops
static void armature_context_setup (Armatures::DrawContext *ctx, OVERLAY_PrivateData *pd, Object *ob, const eArmatureDrawMode draw_mode, const float *const_color)
 
void OVERLAY_edit_armature_cache_populate (OVERLAY_Data *vedata, Object *ob)
 
void OVERLAY_pose_armature_cache_populate (OVERLAY_Data *vedata, Object *ob)
 
void OVERLAY_armature_cache_populate (OVERLAY_Data *vedata, Object *ob)
 
static bool POSE_is_driven_by_active_armature (Object *ob)
 
void OVERLAY_pose_cache_populate (OVERLAY_Data *vedata, Object *ob)
 
void OVERLAY_armature_cache_finish (OVERLAY_Data *vedata)
 
void OVERLAY_armature_draw (OVERLAY_Data *vedata)
 
void OVERLAY_armature_in_front_draw (OVERLAY_Data *vedata)
 
void OVERLAY_pose_draw (OVERLAY_Data *vedata)
 

Macro Definition Documentation

◆ BUF_INSTANCE

◆ BUF_LINE

◆ BUF_POINT

#define BUF_POINT ( grp,
format )   DRW_shgroup_call_buffer(grp, format, GPU_PRIM_POINTS)

◆ PT_DEFAULT_RAD

#define PT_DEFAULT_RAD   0.05f /* radius of the point batch. */

Definition at line 53 of file overlay_armature.cc.

Referenced by drw_shgroup_bone_envelope().

Function Documentation

◆ armature_context_setup()

static void armature_context_setup ( Armatures::DrawContext * ctx,
OVERLAY_PrivateData * pd,
Object * ob,
const eArmatureDrawMode draw_mode,
const float * const_color )
static

Definition at line 3143 of file overlay_armature.cc.

References blender::draw::overlay::ARM_DRAW_MODE_OBJECT, blender::draw::overlay::ARM_DRAW_MODE_POSE, ARM_DRAW_RELATION_FROM_HEAD, OVERLAY_PrivateData::armature, OVERLAY_PrivateData::armature_call_buffers, Object::base_flag, BASE_SELECTED, blender::draw::overlay::Armatures::DrawContext::const_color, blender::draw::overlay::Armatures::DrawContext::const_wire, OVERLAY_ArmatureCallBuffersInner::custom_fill, blender::draw::overlay::Armatures::DrawContext::custom_outline, OVERLAY_ArmatureCallBuffersInner::custom_outline, blender::draw::overlay::Armatures::DrawContext::custom_shapes_ghash, OVERLAY_ArmatureCallBuffersInner::custom_shapes_ghash, blender::draw::overlay::Armatures::DrawContext::custom_solid, blender::draw::overlay::Armatures::DrawContext::custom_wire, OVERLAY_ArmatureCallBuffersInner::custom_wire, Object::data, OVERLAY_PrivateData::do_pose_xray, blender::draw::overlay::Armatures::DrawContext::do_relations, blender::draw::overlay::Armatures::DrawContext::dof_lines, OVERLAY_ArmatureCallBuffersInner::dof_lines, blender::draw::overlay::Armatures::DrawContext::dof_sphere, OVERLAY_ArmatureCallBuffersInner::dof_sphere, ArmatureBoneDrawStrategy::draw_context_setup(), blender::draw::overlay::Armatures::DrawContext::draw_envelope_distance, blender::draw::overlay::Armatures::DrawContext::draw_mode, blender::draw::overlay::Armatures::DrawContext::draw_relation_from_head, bArmature::drawtype, blender::draw::overlay::Armatures::DrawContext::drawtype, DRW_state_is_select(), Object::dt, Object::dtx, OVERLAY_PrivateData::extra_call_buffers, blender::draw::overlay::Armatures::DrawContext::extras, bArmature::flag, blender::draw::overlay::Armatures::DrawContext::ob, OB_DRAW_IN_FRONT, OB_SOLID, OVERLAY_ArmatureCallBuffersInner::point_fill, blender::draw::overlay::Armatures::DrawContext::point_outline, OVERLAY_ArmatureCallBuffersInner::point_outline, blender::draw::overlay::Armatures::DrawContext::point_solid, blender::draw::overlay::Armatures::DrawContext::show_relations, OVERLAY_PrivateData::show_relations, OVERLAY_ArmatureCallBuffers::solid, strategy_for_armature_drawtype(), OVERLAY_ArmatureCallBuffers::transp, OVERLAY_PrivateData::transparent, OVERLAY_PrivateData::v3d_flag, and V3D_SELECT_OUTLINE.

Referenced by OVERLAY_armature_cache_populate(), OVERLAY_edit_armature_cache_populate(), and OVERLAY_pose_armature_cache_populate().

◆ bone_hint_color_shade()

static void bone_hint_color_shade ( float hint_color[4],
const float color[4] )
static

Definition at line 1503 of file overlay_armature.cc.

References mul_v3_fl(), and mul_v3_v3v3().

Referenced by draw_points(), and get_bone_hint_color().

◆ bone_instance_data_set_angle_minmax()

static void bone_instance_data_set_angle_minmax ( BoneInstanceData * data,
const float aminx,
const float aminz,
const float amaxx,
const float amaxz )
static

Definition at line 581 of file overlay_armature.cc.

Referenced by draw_bone_degrees_of_freedom().

◆ bone_locked_color_shade()

static void bone_locked_color_shade ( float color[4])
static

◆ cp_shade_color3ub()

static void cp_shade_color3ub ( uchar cp[3],
const int offset )
static

Definition at line 1288 of file overlay_armature.cc.

References b, CLAMP, and int.

Referenced by use_bone_color().

◆ custom_bone_instance_shgroup()

◆ draw_axes()

◆ draw_bone_bone_relationship_line()

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

◆ draw_bone_degrees_of_freedom()

◆ draw_bone_name()

◆ draw_bone_relations()

◆ draw_bone_update_disp_matrix_bbone()

◆ draw_bone_update_disp_matrix_default()

◆ draw_points()

◆ drw_shgroup_bone_axes()

◆ drw_shgroup_bone_box()

◆ drw_shgroup_bone_custom_empty()

◆ drw_shgroup_bone_custom_mesh_wire()

◆ drw_shgroup_bone_custom_solid()

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

◆ drw_shgroup_bone_custom_solid_mesh()

◆ drw_shgroup_bone_custom_wire()

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

◆ drw_shgroup_bone_envelope()

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 )
static

◆ drw_shgroup_bone_envelope_distance()

◆ drw_shgroup_bone_ik_lines()

static void drw_shgroup_bone_ik_lines ( const Armatures::DrawContext * ctx,
const float start[3],
const float end[3] )
static

◆ drw_shgroup_bone_ik_no_target_lines()

static void drw_shgroup_bone_ik_no_target_lines ( const Armatures::DrawContext * ctx,
const float start[3],
const float end[3] )
static

◆ drw_shgroup_bone_ik_spline_lines()

static void drw_shgroup_bone_ik_spline_lines ( const Armatures::DrawContext * ctx,
const float start[3],
const float end[3] )
static

◆ drw_shgroup_bone_octahedral()

◆ drw_shgroup_bone_relationship_lines()

static void drw_shgroup_bone_relationship_lines ( const Armatures::DrawContext * ctx,
const float start[3],
const float end[3] )
static

◆ drw_shgroup_bone_relationship_lines_ex()

◆ drw_shgroup_bone_sphere()

◆ drw_shgroup_bone_stick()

◆ drw_shgroup_custom_bone_curve()

◆ ebone_spline_preview()

static void ebone_spline_preview ( EditBone * ebone,
const float result_array[MAX_BBONE_SUBDIV][4][4] )
static

Definition at line 1595 of file overlay_armature.cc.

References add_v3_v3v3(), BBONE_ADD_PARENT_END_ROLL, EditBone::bbone_child, EditBone::bbone_flag, BBONE_HANDLE_AUTO, BBONE_HANDLE_RELATIVE, BBONE_HANDLE_TANGENT, EditBone::bbone_next, EditBone::bbone_next_type, EditBone::bbone_prev, EditBone::bbone_prev_type, BBONE_SCALE_EASING, BKE_pchan_bbone_spline_compute(), BONE_CONNECTED, copy_v3_fl3(), copy_v3_v3(), BBoneSplineParameters::curve_in_x, EditBone::curve_in_x, BBoneSplineParameters::curve_in_z, EditBone::curve_in_z, BBoneSplineParameters::curve_out_x, EditBone::curve_out_x, BBoneSplineParameters::curve_out_z, EditBone::curve_out_z, BBoneSplineParameters::ease1, EditBone::ease1, BBoneSplineParameters::ease2, EditBone::ease2, ED_armature_ebone_to_mat4(), EditBone::flag, EditBone::head, invert_m4(), BBoneSplineParameters::length, EditBone::length, mul_m4_m4m4(), mul_v3_m4v3(), next, BBoneSplineParameters::next_bbone, BBoneSplineParameters::next_h, BBoneSplineParameters::next_mat, EditBone::parent, BBoneSplineParameters::prev_bbone, BBoneSplineParameters::prev_h, BBoneSplineParameters::prev_mat, BBoneSplineParameters::roll1, EditBone::roll1, BBoneSplineParameters::roll2, EditBone::roll2, BBoneSplineParameters::scale_in, EditBone::scale_in, BBoneSplineParameters::scale_out, EditBone::scale_out, BBoneSplineParameters::segments, EditBone::segments, sub_v3_v3v3(), EditBone::tail, BBoneSplineParameters::use_next, BBoneSplineParameters::use_prev, and zero_v3().

Referenced by draw_bone_update_disp_matrix_bbone().

◆ edbo_compute_bbone_child()

static void edbo_compute_bbone_child ( bArmature * arm)
static

◆ encode_2f_to_float()

static float encode_2f_to_float ( float a,
float b )
static

◆ get_bone_hint_color()

◆ get_bone_solid_color()

◆ get_bone_solid_with_consts_color()

◆ get_bone_wire_color()

◆ get_bone_wire_thickness()

◆ get_pchan_color_constraint()

◆ get_pchan_color_solid()

static void get_pchan_color_solid ( const ThemeWireColor * bcolor,
float r_color[4] )
static

◆ get_pchan_color_wire()

◆ OVERLAY_armature_cache_finish()

◆ OVERLAY_armature_cache_init()

void OVERLAY_armature_cache_init ( OVERLAY_Data * vedata)

Definition at line 273 of file overlay_armature.cc.

References OVERLAY_PrivateData::armature, OVERLAY_PrivateData::armature_bone_select_act_grp, OVERLAY_PrivateData::armature_bone_select_grp, OVERLAY_PassList::armature_bone_select_ps, OVERLAY_PrivateData::armature_call_buffers, OVERLAY_PassList::armature_ps, OVERLAY_PassList::armature_transp_ps, BLI_ghash_ptr_new(), DRW_Global::block_ubo, View3DOverlay::bone_wire_alpha, OVERLAY_ArmatureCallBuffersInner::box_fill, OVERLAY_ArmatureCallBuffersInner::box_outline, BUF_INSTANCE, BUF_LINE, OVERLAY_PrivateData::clipping_state, OVERLAY_ArmatureCallBuffersInner::custom_fill, OVERLAY_ArmatureCallBuffersInner::custom_outline, OVERLAY_ArmatureCallBuffersInner::custom_shapes_ghash, OVERLAY_ArmatureCallBuffersInner::custom_wire, DefaultTextureList::depth, OVERLAY_PrivateData::do_pose_fade_geom, OVERLAY_PrivateData::do_pose_xray, OVERLAY_ArmatureCallBuffersInner::dof_lines, OVERLAY_ArmatureCallBuffersInner::dof_sphere, DRW_cache_bone_box_get(), DRW_cache_bone_box_wire_get(), DRW_cache_bone_dof_lines_get(), DRW_cache_bone_dof_sphere_get(), DRW_cache_bone_envelope_outline_get(), DRW_cache_bone_envelope_solid_get(), DRW_cache_bone_octahedral_get(), DRW_cache_bone_octahedral_wire_get(), DRW_cache_bone_point_get(), DRW_cache_bone_point_wire_outline_get(), DRW_cache_bone_stick_get(), DRW_context_state_get(), DRW_PASS_CREATE, DRW_shgroup_create(), DRW_shgroup_state_disable(), DRW_shgroup_state_enable(), DRW_shgroup_uniform_block, DRW_shgroup_uniform_bool_copy(), DRW_shgroup_uniform_float_copy(), DRW_shgroup_uniform_texture_ref(), DRW_shgroup_uniform_vec4_copy(), DRW_STATE_BLEND_ADD, DRW_STATE_BLEND_ALPHA, DRW_STATE_CULL_BACK, DRW_STATE_CULL_FRONT, DRW_STATE_DEPTH_EQUAL, DRW_STATE_DEPTH_LESS_EQUAL, DRW_STATE_IN_FRONT_SELECT, DRW_state_is_select(), DRW_STATE_WRITE_COLOR, DRW_STATE_WRITE_DEPTH, DRW_viewport_texture_list_get(), OVERLAY_ArmatureCallBuffersInner::envelope_distance, OVERLAY_ArmatureCallBuffersInner::envelope_fill, OVERLAY_ArmatureCallBuffersInner::envelope_outline, View3D::flag, View3DOverlay::flag, G_draw, OVERLAY_InstanceFormats::instance_bone, OVERLAY_InstanceFormats::instance_bone_envelope, OVERLAY_InstanceFormats::instance_bone_envelope_distance, OVERLAY_InstanceFormats::instance_bone_envelope_outline, OVERLAY_InstanceFormats::instance_bone_stick, OVERLAY_InstanceFormats::instance_extra, OB_MODE_WEIGHT_PAINT, OB_WIRE, DRWContextState::object_mode, DRWContextState::object_pose, OVERLAY_ArmatureCallBuffersInner::octa_fill, OVERLAY_ArmatureCallBuffersInner::octa_outline, OVERLAY_PrivateData::overlay, OVERLAY_shader_armature_degrees_of_freedom_solid(), OVERLAY_shader_armature_degrees_of_freedom_wire(), OVERLAY_shader_armature_envelope(), OVERLAY_shader_armature_shape(), OVERLAY_shader_armature_shape_wire(), OVERLAY_shader_armature_sphere(), OVERLAY_shader_armature_stick(), OVERLAY_shader_armature_wire(), OVERLAY_shader_instance_formats_get(), OVERLAY_shader_uniform_color(), OVERLAY_StorageList::pd, OVERLAY_ArmatureCallBuffersInner::point_fill, OVERLAY_ArmatureCallBuffersInner::point_outline, OVERLAY_InstanceFormats::pos_color, powf, OVERLAY_Data::psl, View3D::shading, OVERLAY_PrivateData::show_relations, OVERLAY_ArmatureCallBuffers::solid, state, OVERLAY_ArmatureCallBuffersInner::stick, OVERLAY_Data::stl, OVERLAY_ArmatureCallBuffers::transp, OVERLAY_PrivateData::transparent, View3DShading::type, USER_GPU_FLAG_OVERLAY_SMOOTH_WIRE, DRWContextState::v3d, V3D_HIDE_HELPLINES, V3D_OVERLAY_BONE_SELECT, OVERLAY_ArmatureCallBuffersInner::wire, View3DOverlay::xray_alpha_bone, and XRAY_FLAG_ENABLED.

Referenced by OVERLAY_cache_init().

◆ OVERLAY_armature_cache_populate()

◆ OVERLAY_armature_draw()

void OVERLAY_armature_draw ( OVERLAY_Data * vedata)

◆ OVERLAY_armature_in_front_draw()

◆ OVERLAY_armature_is_pose_mode()

bool OVERLAY_armature_is_pose_mode ( Object * ob,
const DRWContextState * draw_ctx )

◆ OVERLAY_bone_instance_data_set_color()

void OVERLAY_bone_instance_data_set_color ( BoneInstanceData * data,
const float bone_color[4] )

◆ OVERLAY_bone_instance_data_set_color_hint()

void OVERLAY_bone_instance_data_set_color_hint ( BoneInstanceData * data,
const float hint_color[4] )

◆ OVERLAY_edit_armature_cache_populate()

◆ OVERLAY_pose_armature_cache_populate()

◆ OVERLAY_pose_cache_populate()

◆ OVERLAY_pose_draw()

◆ pchan_culling_calc_bsphere()

static void pchan_culling_calc_bsphere ( const Object * ob,
const bPoseChannel * pchan,
BoundSphere * r_bsphere )
static

◆ pchan_culling_test_simple()

static bool pchan_culling_test_simple ( const DRWView * view,
const Object * ob,
const bPoseChannel * pchan )
static
Returns
true when bounding sphere from pchan intersect the view. (same for other "test" functions defined here).

Definition at line 2207 of file overlay_armature.cc.

References DRW_culling_sphere_test(), and pchan_culling_calc_bsphere().

Referenced by ArmatureBoneDrawStrategyCustomShape::culling_test(), and ArmatureBoneDrawStrategyWire::culling_test().

◆ pchan_culling_test_with_radius_scale()

static bool pchan_culling_test_with_radius_scale ( const DRWView * view,
const Object * ob,
const bPoseChannel * pchan,
const float scale )
static

◆ pchan_draw_data_init()

◆ pchan_draw_ik_lines()

◆ POSE_is_driven_by_active_armature()

◆ set_ctx_bcolor()

◆ strategy_for_armature_drawtype()

static ArmatureBoneDrawStrategy & strategy_for_armature_drawtype ( const eArmature_Drawtype drawtype)
static

Return the armature bone drawing strategy for the given draw type.

Note that this does not consider custom bone shapes, as those can be set per bone. For those occasions just instance a ArmatureBoneDrawStrategyCustomShape and use that.

Definition at line 2901 of file overlay_armature.cc.

References ARM_B_BONE, ARM_ENVELOPE, ARM_LINE, ARM_OCTA, ARM_WIRE, and BLI_assert_unreachable.

Referenced by armature_context_setup(), blender::draw::overlay::Armatures::draw_armature_edit(), and blender::draw::overlay::Armatures::draw_armature_pose().

◆ use_bone_color()

static void use_bone_color ( float * r_color,
const uint8_t * color_from_theme,
const int shade_offset )
static

Utility function to use a shaded version of one of the colors in 'bcolor'.

The r_color parameter is put first for consistency with copy_v4_v4(dest, src).

Definition at line 1309 of file overlay_armature.cc.

References copy_v3_v3_uchar(), cp_shade_color3ub(), rgba_uchar_to_float(), and srgb_to_linearrgb_v4().

Referenced by get_pchan_color_solid(), and get_pchan_color_wire().