Blender  V2.93
Classes | Macros | Typedefs | Functions
overlay_armature.c File Reference
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "DNA_armature_types.h"
#include "DNA_constraint_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_view3d_types.h"
#include "DRW_render.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BKE_action.h"
#include "BKE_armature.h"
#include "BKE_modifier.h"
#include "DEG_depsgraph_query.h"
#include "ED_armature.h"
#include "ED_view3d.h"
#include "UI_resources.h"
#include "draw_common.h"
#include "draw_manager_text.h"
#include "overlay_private.h"

Go to the source code of this file.

Classes

struct  ArmatureDrawContext
 

Macros

#define BONE_VAR(eBone, pchan, var)   ((eBone) ? (eBone->var) : (pchan->var))
 
#define BONE_FLAG(eBone, pchan)   ((eBone) ? (eBone->flag) : (pchan->bone->flag))
 
#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)
 

Typedefs

typedef struct ArmatureDrawContext ArmatureDrawContext
 

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 (ArmatureDrawContext *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 (ArmatureDrawContext *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_wire (ArmatureDrawContext *ctx, const float(*bone_mat)[4], const float color[4])
 
static void drw_shgroup_bone_stick (ArmatureDrawContext *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])
 
static void drw_shgroup_bone_envelope_distance (ArmatureDrawContext *ctx, const float(*bone_mat)[4], const float *radius_head, const float *radius_tail, const float *distance)
 
static void drw_shgroup_bone_envelope (ArmatureDrawContext *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)
 
void drw_batch_cache_validate (Object *custom)
 
void drw_batch_cache_generate_requested_delayed (Object *custom)
 
BLI_INLINE DRWCallBuffercustom_bone_instance_shgroup (ArmatureDrawContext *ctx, DRWShadingGroup *grp, struct GPUBatch *custom_geom)
 
static void drw_shgroup_bone_custom_solid (ArmatureDrawContext *ctx, const float(*bone_mat)[4], const float bone_color[4], const float hint_color[4], const float outline_color[4], Object *custom)
 
static void drw_shgroup_bone_custom_wire (ArmatureDrawContext *ctx, const float(*bone_mat)[4], const float color[4], Object *custom)
 
static void drw_shgroup_bone_custom_empty (ArmatureDrawContext *ctx, const float(*bone_mat)[4], const float color[4], Object *custom)
 
static void drw_shgroup_bone_point (ArmatureDrawContext *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_axes (ArmatureDrawContext *ctx, const float(*bone_mat)[4], const float color[4])
 
static void drw_shgroup_bone_relationship_lines_ex (ArmatureDrawContext *ctx, const float start[3], const float end[3], const float color[4])
 
static void drw_shgroup_bone_relationship_lines (ArmatureDrawContext *ctx, const float start[3], const float end[3])
 
static void drw_shgroup_bone_ik_lines (ArmatureDrawContext *ctx, const float start[3], const float end[3])
 
static void drw_shgroup_bone_ik_no_target_lines (ArmatureDrawContext *ctx, const float start[3], const float end[3])
 
static void drw_shgroup_bone_ik_spline_lines (ArmatureDrawContext *ctx, const float start[3], const float end[3])
 
Drawing Color Helpers
static void bone_locked_color_shade (float color[4])
 
static const floatget_bone_solid_color (const ArmatureDrawContext *ctx, const EditBone *UNUSED(eBone), const bPoseChannel *pchan, const bArmature *arm, const int boneflag, const short constflag)
 
static const floatget_bone_solid_with_consts_color (const ArmatureDrawContext *ctx, const EditBone *eBone, const bPoseChannel *pchan, const bArmature *arm, const int boneflag, const short constflag)
 
static float get_bone_wire_thickness (const ArmatureDrawContext *ctx, int boneflag)
 
static const floatget_bone_wire_color (const ArmatureDrawContext *ctx, const EditBone *eBone, const bPoseChannel *pchan, const bArmature *arm, const int boneflag, const short constflag)
 
static void bone_hint_color_shade (float hint_color[4], const float color[4])
 
static const floatget_bone_hint_color (const ArmatureDrawContext *ctx, const EditBone *eBone, const bPoseChannel *pchan, const bArmature *arm, const int boneflag, const short constflag)
 
Helper Utils
static void pchan_draw_data_init (bPoseChannel *pchan)
 
static void draw_bone_update_disp_matrix_default (EditBone *eBone, bPoseChannel *pchan)
 
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 (EditBone *eBone, bPoseChannel *pchan)
 
static void draw_bone_update_disp_matrix_custom (bPoseChannel *pchan)
 
static void draw_axes (ArmatureDrawContext *ctx, const EditBone *eBone, const bPoseChannel *pchan, const bArmature *arm)
 
static void draw_points (ArmatureDrawContext *ctx, const EditBone *eBone, const bPoseChannel *pchan, const bArmature *arm, const int boneflag, const short constflag, const int select_id)
 
Draw Bones
static void draw_bone_custom_shape (ArmatureDrawContext *ctx, EditBone *eBone, bPoseChannel *pchan, bArmature *arm, const int boneflag, const short constflag, const int select_id)
 
static void draw_bone_envelope (ArmatureDrawContext *ctx, EditBone *eBone, bPoseChannel *pchan, bArmature *arm, const int boneflag, const short constflag, const int select_id)
 
static void draw_bone_line (ArmatureDrawContext *ctx, EditBone *eBone, bPoseChannel *pchan, bArmature *arm, const int boneflag, const short constflag, const int select_id)
 
static void draw_bone_wire (ArmatureDrawContext *ctx, EditBone *eBone, bPoseChannel *pchan, bArmature *arm, const int boneflag, const short constflag, const int select_id)
 
static void draw_bone_box (ArmatureDrawContext *ctx, EditBone *eBone, bPoseChannel *pchan, bArmature *arm, const int boneflag, const short constflag, const int select_id)
 
static void draw_bone_octahedral (ArmatureDrawContext *ctx, EditBone *eBone, bPoseChannel *pchan, bArmature *arm, const int boneflag, const short constflag, const int select_id)
 
Draw Degrees of Freedom
static void draw_bone_degrees_of_freedom (ArmatureDrawContext *ctx, bPoseChannel *pchan)
 
Draw Relationships
static void pchan_draw_ik_lines (ArmatureDrawContext *ctx, bPoseChannel *pchan, const bool only_temp, const int constflag)
 
static void draw_bone_relations (ArmatureDrawContext *ctx, EditBone *ebone, bPoseChannel *pchan, bArmature *arm, const int boneflag, const short constflag)
 
static void draw_bone_name (ArmatureDrawContext *ctx, EditBone *eBone, bPoseChannel *pchan, bArmature *arm, const int boneflag)
 
Main Draw Loops
static void draw_armature_edit (ArmatureDrawContext *ctx)
 
static void draw_armature_pose (ArmatureDrawContext *ctx)
 
static void armature_context_setup (ArmatureDrawContext *ctx, OVERLAY_PrivateData *pd, Object *ob, const bool do_envelope_dist, const bool is_edit_mode, const bool is_pose_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)
 

Drawing Theme Helpers

Note, this section is duplicate of code in 'drawarmature.c'.

enum  { PCHAN_COLOR_NORMAL = 0 , PCHAN_COLOR_SOLID , PCHAN_COLOR_CONSTS }
 
static void set_pchan_colorset (ArmatureDrawContext *ctx, Object *ob, bPoseChannel *pchan)
 
static void cp_shade_color3ub (uchar cp[3], const int offset)
 
static bool set_pchan_color (const ArmatureDrawContext *ctx, short colCode, const int boneflag, const short constflag, float r_color[4])
 

Macro Definition Documentation

◆ BONE_FLAG

#define BONE_FLAG (   eBone,
  pchan 
)    ((eBone) ? (eBone->flag) : (pchan->bone->flag))

Definition at line 55 of file overlay_armature.c.

◆ BONE_VAR

#define BONE_VAR (   eBone,
  pchan,
  var 
)    ((eBone) ? (eBone->var) : (pchan->var))

Definition at line 54 of file overlay_armature.c.

◆ BUF_INSTANCE

#define BUF_INSTANCE   DRW_shgroup_call_buffer_instance

◆ BUF_LINE

#define BUF_LINE (   grp,
  format 
)    DRW_shgroup_call_buffer(grp, format, GPU_PRIM_LINES)

◆ 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 57 of file overlay_armature.c.

Typedef Documentation

◆ ArmatureDrawContext

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
PCHAN_COLOR_NORMAL 
PCHAN_COLOR_SOLID 
PCHAN_COLOR_CONSTS 

Definition at line 707 of file overlay_armature.c.

Function Documentation

◆ armature_context_setup()

static void armature_context_setup ( ArmatureDrawContext ctx,
OVERLAY_PrivateData pd,
Object ob,
const bool  do_envelope_dist,
const bool  is_edit_mode,
const bool  is_pose_mode,
const float const_color 
)
static

Definition at line 2119 of file overlay_armature.c.

References ARM_B_BONE, ARM_ENVELOPE, ARM_LINE, ARM_OCTA, ARM_WIRE, OVERLAY_PrivateData::armature, OVERLAY_PrivateData::armature_call_buffers, Object::base_flag, BASE_SELECTED, OVERLAY_ArmatureCallBuffers::box_outline, OVERLAY_ArmatureCallBuffers::box_solid, OVERLAY_ArmatureCallBuffers::box_transp, ArmatureDrawContext::const_color, ArmatureDrawContext::const_wire, ArmatureDrawContext::custom_outline, OVERLAY_ArmatureCallBuffers::custom_outline, ArmatureDrawContext::custom_shapes_ghash, OVERLAY_ArmatureCallBuffers::custom_shapes_ghash, OVERLAY_ArmatureCallBuffers::custom_shapes_transp_ghash, ArmatureDrawContext::custom_solid, OVERLAY_ArmatureCallBuffers::custom_solid, OVERLAY_ArmatureCallBuffers::custom_transp, ArmatureDrawContext::custom_wire, OVERLAY_ArmatureCallBuffers::custom_wire, Object::data, OVERLAY_PrivateData::do_pose_xray, ArmatureDrawContext::do_relations, ArmatureDrawContext::dof_lines, OVERLAY_ArmatureCallBuffers::dof_lines, ArmatureDrawContext::dof_sphere, OVERLAY_ArmatureCallBuffers::dof_sphere, bArmature::drawtype, DRW_state_is_select(), Object::dt, Object::dtx, ArmatureDrawContext::envelope_distance, OVERLAY_ArmatureCallBuffers::envelope_distance, ArmatureDrawContext::envelope_outline, OVERLAY_ArmatureCallBuffers::envelope_outline, ArmatureDrawContext::envelope_solid, OVERLAY_ArmatureCallBuffers::envelope_solid, OVERLAY_ArmatureCallBuffers::envelope_transp, OVERLAY_PrivateData::extra_call_buffers, ArmatureDrawContext::extras, NULL, ArmatureDrawContext::ob, OB_DRAW_IN_FRONT, OB_SOLID, OVERLAY_ArmatureCallBuffers::octa_outline, OVERLAY_ArmatureCallBuffers::octa_solid, OVERLAY_ArmatureCallBuffers::octa_transp, ArmatureDrawContext::outline, ArmatureDrawContext::point_outline, OVERLAY_ArmatureCallBuffers::point_outline, ArmatureDrawContext::point_solid, OVERLAY_ArmatureCallBuffers::point_solid, OVERLAY_ArmatureCallBuffers::point_transp, ArmatureDrawContext::show_relations, OVERLAY_PrivateData::show_relations, ArmatureDrawContext::solid, ArmatureDrawContext::stick, OVERLAY_ArmatureCallBuffers::stick, OVERLAY_PrivateData::transparent, OVERLAY_PrivateData::v3d_flag, V3D_SELECT_OUTLINE, ArmatureDrawContext::wire, and OVERLAY_ArmatureCallBuffers::wire.

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 981 of file overlay_armature.c.

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 298 of file overlay_armature.c.

References data.

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 757 of file overlay_armature.c.

References CLAMP, and r.

Referenced by set_pchan_color().

◆ custom_bone_instance_shgroup()

BLI_INLINE DRWCallBuffer* custom_bone_instance_shgroup ( ArmatureDrawContext ctx,
DRWShadingGroup grp,
struct GPUBatch custom_geom 
)

◆ draw_armature_edit()

static void draw_armature_edit ( ArmatureDrawContext ctx)
static

◆ draw_armature_pose()

static void draw_armature_pose ( ArmatureDrawContext ctx)
static

Definition at line 1972 of file overlay_armature.c.

References bArmature::act_bone, ARM_B_BONE, ARM_DRAWAXES, ARM_DRAWNAMES, ARM_ENVELOPE, ARM_LINE, ARM_NO_CUSTOM, ARM_POSEMODE, ARM_WIRE, Object::base_flag, BASE_FROM_DUPLI, BASE_FROM_SET, BKE_pose_channel_find_name(), bPoseChannel::bone, BONE_CONNECTED, BONE_DRAW_ACTIVE, BONE_DRAW_LOCKED_WEIGHT, BONE_HIDDEN_P, BONE_HIDDEN_PG, BONE_IK_XLIMIT, BONE_IK_ZLIMIT, BONE_SELECTED, bPose::chanbase, ArmatureDrawContext::const_color, bPoseChannel::constflag, bPoseChannel::custom, Object::data, Object::defbase, DEG_get_original_object(), DG_LOCK_WEIGHT, draw_axes(), draw_bone_box(), draw_bone_custom_shape(), draw_bone_degrees_of_freedom(), draw_bone_envelope(), draw_bone_line(), draw_bone_name(), draw_bone_octahedral(), draw_bone_relations(), draw_bone_update_disp_matrix_bbone(), draw_bone_update_disp_matrix_custom(), draw_bone_update_disp_matrix_default(), draw_bone_wire(), bArmature::drawtype, DRW_context_state_get(), DRW_state_is_select(), DRW_state_show_text(), ListBase::first, bPose::flag, Bone::flag, bArmature::flag, bPoseChannel::ikflag, Bone::layer, bArmature::layer, LISTBASE_FOREACH, Object::mode, bPoseChannel::next, NULL, ArmatureDrawContext::ob, OB_MODE_ALL_WEIGHT_PAINT, OB_MODE_OBJECT, OB_MODE_POSE, DRWContextState::obact, ToolSettings::object_flag, DRWContextState::object_mode, DRWContextState::object_pose, Bone::parent, pchan_draw_data_init(), Object::pose, POSE_RECALC, Object::runtime, SCE_OBJECT_MODE_LOCK, scene, DRWContextState::scene, Object_Runtime::select_id, set_pchan_colorset(), ArmatureDrawContext::show_relations, and Scene::toolsettings.

Referenced by OVERLAY_armature_cache_populate(), and OVERLAY_pose_armature_cache_populate().

◆ draw_axes()

static void draw_axes ( ArmatureDrawContext ctx,
const EditBone eBone,
const bPoseChannel pchan,
const bArmature arm 
)
static

◆ draw_bone_box()

static void draw_bone_box ( ArmatureDrawContext ctx,
EditBone eBone,
bPoseChannel pchan,
bArmature arm,
const int  boneflag,
const short  constflag,
const int  select_id 
)
static

◆ draw_bone_custom_shape()

static void draw_bone_custom_shape ( ArmatureDrawContext ctx,
EditBone eBone,
bPoseChannel pchan,
bArmature arm,
const int  boneflag,
const short  constflag,
const int  select_id 
)
static

◆ draw_bone_degrees_of_freedom()

static void draw_bone_degrees_of_freedom ( ArmatureDrawContext ctx,
bPoseChannel pchan 
)
static

◆ draw_bone_envelope()

static void draw_bone_envelope ( ArmatureDrawContext ctx,
EditBone eBone,
bPoseChannel pchan,
bArmature arm,
const int  boneflag,
const short  constflag,
const int  select_id 
)
static

◆ draw_bone_line()

static void draw_bone_line ( ArmatureDrawContext ctx,
EditBone eBone,
bPoseChannel pchan,
bArmature arm,
const int  boneflag,
const short  constflag,
const int  select_id 
)
static

◆ draw_bone_name()

static void draw_bone_name ( ArmatureDrawContext ctx,
EditBone eBone,
bPoseChannel pchan,
bArmature arm,
const int  boneflag 
)
static

◆ draw_bone_octahedral()

static void draw_bone_octahedral ( ArmatureDrawContext ctx,
EditBone eBone,
bPoseChannel pchan,
bArmature arm,
const int  boneflag,
const short  constflag,
const int  select_id 
)
static

◆ draw_bone_relations()

static void draw_bone_relations ( ArmatureDrawContext ctx,
EditBone ebone,
bPoseChannel pchan,
bArmature arm,
const int  boneflag,
const short  constflag 
)
static

◆ draw_bone_update_disp_matrix_bbone()

static void draw_bone_update_disp_matrix_bbone ( EditBone eBone,
bPoseChannel pchan 
)
static

◆ draw_bone_update_disp_matrix_custom()

static void draw_bone_update_disp_matrix_custom ( bPoseChannel pchan)
static

◆ draw_bone_update_disp_matrix_default()

static void draw_bone_update_disp_matrix_default ( EditBone eBone,
bPoseChannel pchan 
)
static

◆ draw_bone_wire()

static void draw_bone_wire ( ArmatureDrawContext ctx,
EditBone eBone,
bPoseChannel pchan,
bArmature arm,
const int  boneflag,
const short  constflag,
const int  select_id 
)
static

◆ draw_points()

static void draw_points ( ArmatureDrawContext ctx,
const EditBone eBone,
const bPoseChannel pchan,
const bArmature arm,
const int  boneflag,
const short  constflag,
const int  select_id 
)
static

◆ drw_batch_cache_generate_requested_delayed()

void drw_batch_cache_generate_requested_delayed ( Object custom)

◆ drw_batch_cache_validate()

void drw_batch_cache_validate ( Object custom)

◆ drw_shgroup_bone_axes()

static void drw_shgroup_bone_axes ( ArmatureDrawContext ctx,
const float(*)  bone_mat[4],
const float  color[4] 
)
static

◆ drw_shgroup_bone_box()

static void drw_shgroup_bone_box ( ArmatureDrawContext ctx,
const float(*)  bone_mat[4],
const float  bone_color[4],
const float  hint_color[4],
const float  outline_color[4] 
)
static

◆ drw_shgroup_bone_custom_empty()

static void drw_shgroup_bone_custom_empty ( ArmatureDrawContext ctx,
const float(*)  bone_mat[4],
const float  color[4],
Object custom 
)
static

◆ drw_shgroup_bone_custom_solid()

static void drw_shgroup_bone_custom_solid ( ArmatureDrawContext ctx,
const float(*)  bone_mat[4],
const float  bone_color[4],
const float  hint_color[4],
const float  outline_color[4],
Object custom 
)
static

◆ drw_shgroup_bone_custom_wire()

static void drw_shgroup_bone_custom_wire ( ArmatureDrawContext ctx,
const float(*)  bone_mat[4],
const float  color[4],
Object custom 
)
static

◆ drw_shgroup_bone_envelope()

static void drw_shgroup_bone_envelope ( ArmatureDrawContext 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 
)
static

◆ drw_shgroup_bone_envelope_distance()

static void drw_shgroup_bone_envelope_distance ( ArmatureDrawContext ctx,
const float(*)  bone_mat[4],
const float radius_head,
const float radius_tail,
const float distance 
)
static

◆ drw_shgroup_bone_ik_lines()

static void drw_shgroup_bone_ik_lines ( ArmatureDrawContext 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 ( ArmatureDrawContext ctx,
const float  start[3],
const float  end[3] 
)
static

◆ drw_shgroup_bone_ik_spline_lines()

static void drw_shgroup_bone_ik_spline_lines ( ArmatureDrawContext ctx,
const float  start[3],
const float  end[3] 
)
static

◆ drw_shgroup_bone_octahedral()

static void drw_shgroup_bone_octahedral ( ArmatureDrawContext ctx,
const float(*)  bone_mat[4],
const float  bone_color[4],
const float  hint_color[4],
const float  outline_color[4] 
)
static

◆ drw_shgroup_bone_point()

static void drw_shgroup_bone_point ( ArmatureDrawContext ctx,
const float(*)  bone_mat[4],
const float  bone_color[4],
const float  hint_color[4],
const float  outline_color[4] 
)
static

◆ drw_shgroup_bone_relationship_lines()

static void drw_shgroup_bone_relationship_lines ( ArmatureDrawContext ctx,
const float  start[3],
const float  end[3] 
)
static

◆ drw_shgroup_bone_relationship_lines_ex()

static void drw_shgroup_bone_relationship_lines_ex ( ArmatureDrawContext ctx,
const float  start[3],
const float  end[3],
const float  color[4] 
)
static

◆ drw_shgroup_bone_stick()

static void drw_shgroup_bone_stick ( ArmatureDrawContext 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] 
)
static

◆ drw_shgroup_bone_wire()

static void drw_shgroup_bone_wire ( ArmatureDrawContext ctx,
const float(*)  bone_mat[4],
const float  color[4] 
)
static

◆ ebone_spline_preview()

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

Definition at line 1081 of file overlay_armature.c.

References add_v3_v3v3(), EditBone::bbone_child, BBONE_HANDLE_AUTO, BBONE_HANDLE_RELATIVE, BBONE_HANDLE_TANGENT, EditBone::bbone_next, EditBone::bbone_next_type, EditBone::bbone_prev, EditBone::bbone_prev_type, BKE_pchan_bbone_spline_compute(), BONE_ADD_PARENT_END_ROLL, BONE_CONNECTED, copy_v3_fl3(), EditBone::curve_in_x, BBoneSplineParameters::curve_in_x, EditBone::curve_in_y, BBoneSplineParameters::curve_in_y, EditBone::curve_out_x, BBoneSplineParameters::curve_out_x, EditBone::curve_out_y, BBoneSplineParameters::curve_out_y, EditBone::ease1, BBoneSplineParameters::ease1, EditBone::ease2, BBoneSplineParameters::ease2, ED_armature_ebone_to_mat4(), EditBone::flag, EditBone::head, invert_m4(), EditBone::length, BBoneSplineParameters::length, mul_m4_m4m4(), mul_v3_m4v3(), next, BBoneSplineParameters::next_bbone, BBoneSplineParameters::next_h, BBoneSplineParameters::next_mat, NULL, EditBone::parent, BBoneSplineParameters::prev_bbone, BBoneSplineParameters::prev_h, BBoneSplineParameters::prev_mat, EditBone::roll1, BBoneSplineParameters::roll1, EditBone::roll2, BBoneSplineParameters::roll2, EditBone::scale_in_x, BBoneSplineParameters::scale_in_x, EditBone::scale_in_y, BBoneSplineParameters::scale_in_y, EditBone::scale_out_x, BBoneSplineParameters::scale_out_x, EditBone::scale_out_y, BBoneSplineParameters::scale_out_y, EditBone::segments, BBoneSplineParameters::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()

static const float* get_bone_hint_color ( const ArmatureDrawContext ctx,
const EditBone eBone,
const bPoseChannel pchan,
const bArmature arm,
const int  boneflag,
const short  constflag 
)
static

◆ get_bone_solid_color()

static const float* get_bone_solid_color ( const ArmatureDrawContext ctx,
const EditBone UNUSEDeBone,
const bPoseChannel pchan,
const bArmature arm,
const int  boneflag,
const short  constflag 
)
static

◆ get_bone_solid_with_consts_color()

static const float* get_bone_solid_with_consts_color ( const ArmatureDrawContext ctx,
const EditBone eBone,
const bPoseChannel pchan,
const bArmature arm,
const int  boneflag,
const short  constflag 
)
static

◆ get_bone_wire_color()

static const float* get_bone_wire_color ( const ArmatureDrawContext ctx,
const EditBone eBone,
const bPoseChannel pchan,
const bArmature arm,
const int  boneflag,
const short  constflag 
)
static

◆ get_bone_wire_thickness()

static float get_bone_wire_thickness ( const ArmatureDrawContext ctx,
int  boneflag 
)
static

◆ OVERLAY_armature_cache_finish()

void OVERLAY_armature_cache_finish ( OVERLAY_Data vedata)

◆ OVERLAY_armature_cache_init()

void OVERLAY_armature_cache_init ( OVERLAY_Data vedata)

Definition at line 125 of file overlay_armature.c.

References alpha, 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, OVERLAY_ArmatureCallBuffers::box_outline, OVERLAY_ArmatureCallBuffers::box_solid, OVERLAY_ArmatureCallBuffers::box_transp, BUF_INSTANCE, BUF_LINE, OVERLAY_PrivateData::clipping_state, OVERLAY_ArmatureCallBuffers::custom_outline, OVERLAY_ArmatureCallBuffers::custom_shapes_ghash, OVERLAY_ArmatureCallBuffers::custom_shapes_transp_ghash, OVERLAY_ArmatureCallBuffers::custom_solid, OVERLAY_ArmatureCallBuffers::custom_transp, OVERLAY_ArmatureCallBuffers::custom_wire, OVERLAY_PrivateData::do_pose_fade_geom, OVERLAY_PrivateData::do_pose_xray, OVERLAY_ArmatureCallBuffers::dof_lines, OVERLAY_ArmatureCallBuffers::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_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, OVERLAY_ArmatureCallBuffers::envelope_distance, OVERLAY_ArmatureCallBuffers::envelope_outline, OVERLAY_ArmatureCallBuffers::envelope_solid, OVERLAY_ArmatureCallBuffers::envelope_transp, View3DOverlay::flag, View3D::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, NULL, OB_MODE_WEIGHT_PAINT, OB_WIRE, DRWContextState::object_mode, DRWContextState::object_pose, OVERLAY_ArmatureCallBuffers::octa_outline, OVERLAY_ArmatureCallBuffers::octa_solid, OVERLAY_ArmatureCallBuffers::octa_transp, 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_ArmatureCallBuffers::point_outline, OVERLAY_ArmatureCallBuffers::point_solid, OVERLAY_ArmatureCallBuffers::point_transp, OVERLAY_InstanceFormats::pos_color, KDL::pow(), OVERLAY_Data::psl, View3D::shading, OVERLAY_PrivateData::show_relations, state, OVERLAY_ArmatureCallBuffers::stick, OVERLAY_Data::stl, OVERLAY_PrivateData::transparent, View3DShading::type, DRWContextState::v3d, V3D_HIDE_HELPLINES, V3D_OVERLAY_BONE_SELECT, OVERLAY_ArmatureCallBuffers::wire, View3DOverlay::xray_alpha_bone, and XRAY_FLAG_ENABLED.

Referenced by OVERLAY_cache_init().

◆ OVERLAY_armature_cache_populate()

void OVERLAY_armature_cache_populate ( OVERLAY_Data vedata,
Object ob 
)

◆ OVERLAY_armature_draw()

void OVERLAY_armature_draw ( OVERLAY_Data vedata)

◆ OVERLAY_armature_in_front_draw()

void OVERLAY_armature_in_front_draw ( OVERLAY_Data vedata)

◆ 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()

void OVERLAY_edit_armature_cache_populate ( OVERLAY_Data vedata,
Object ob 
)

◆ OVERLAY_pose_armature_cache_populate()

void OVERLAY_pose_armature_cache_populate ( OVERLAY_Data vedata,
Object ob 
)

◆ OVERLAY_pose_cache_populate()

void OVERLAY_pose_cache_populate ( OVERLAY_Data vedata,
Object ob 
)

◆ OVERLAY_pose_draw()

void OVERLAY_pose_draw ( OVERLAY_Data vedata)

◆ pchan_draw_data_init()

static void pchan_draw_data_init ( bPoseChannel pchan)
static

◆ pchan_draw_ik_lines()

static void pchan_draw_ik_lines ( ArmatureDrawContext ctx,
bPoseChannel pchan,
const bool  only_temp,
const int  constflag 
)
static

◆ POSE_is_driven_by_active_armature()

static bool POSE_is_driven_by_active_armature ( Object ob)
static

◆ set_pchan_color()

static bool set_pchan_color ( const ArmatureDrawContext ctx,
short  colCode,
const int  boneflag,
const short  constflag,
float  r_color[4] 
)
static

◆ set_pchan_colorset()

static void set_pchan_colorset ( ArmatureDrawContext ctx,
Object ob,
bPoseChannel pchan 
)
static