Blender  V3.3
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_mesh_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_deform.h"
#include "BKE_modifier.h"
#include "BKE_object.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"
#include "draw_cache_impl.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_mesh (ArmatureDrawContext *ctx, Mesh *mesh, 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_mesh_wire (ArmatureDrawContext *ctx, Mesh *mesh, const float(*bone_mat)[4], const float color[4], Object *custom)
 
static void drw_shgroup_custom_bone_curve (ArmatureDrawContext *ctx, Curve *curve, const float(*bone_mat)[4], const float outline_color[4], Object *custom)
 
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)
 
Pose Bone Culling

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

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)
 
static bool pchan_culling_test_custom (const DRWView *view, const Object *ob, const bPoseChannel *pchan)
 
static bool pchan_culling_test_wire (const DRWView *view, const Object *ob, const bPoseChannel *pchan)
 
static bool pchan_culling_test_line (const DRWView *view, const Object *ob, const bPoseChannel *pchan)
 
static bool pchan_culling_test_envelope (const DRWView *view, const Object *ob, const bPoseChannel *pchan)
 
static bool pchan_culling_test_bbone (const DRWView *view, const Object *ob, const bPoseChannel *pchan)
 
static bool pchan_culling_test_octohedral (const DRWView *view, const Object *ob, const bPoseChannel *pchan)
 
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 45 of file overlay_armature.c.

◆ BONE_VAR

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

Definition at line 44 of file overlay_armature.c.

◆ BUF_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 47 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 884 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 2456 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_ArmatureCallBuffersInner::box_fill, OVERLAY_ArmatureCallBuffersInner::box_outline, ArmatureDrawContext::const_color, ArmatureDrawContext::const_wire, OVERLAY_ArmatureCallBuffersInner::custom_fill, ArmatureDrawContext::custom_outline, OVERLAY_ArmatureCallBuffersInner::custom_outline, ArmatureDrawContext::custom_shapes_ghash, OVERLAY_ArmatureCallBuffersInner::custom_shapes_ghash, ArmatureDrawContext::custom_solid, ArmatureDrawContext::custom_wire, OVERLAY_ArmatureCallBuffersInner::custom_wire, Object::data, OVERLAY_PrivateData::do_pose_xray, ArmatureDrawContext::do_relations, ArmatureDrawContext::dof_lines, OVERLAY_ArmatureCallBuffersInner::dof_lines, ArmatureDrawContext::dof_sphere, OVERLAY_ArmatureCallBuffersInner::dof_sphere, bArmature::drawtype, DRW_state_is_select(), Object::dt, Object::dtx, ArmatureDrawContext::envelope_distance, OVERLAY_ArmatureCallBuffersInner::envelope_distance, OVERLAY_ArmatureCallBuffersInner::envelope_fill, ArmatureDrawContext::envelope_outline, OVERLAY_ArmatureCallBuffersInner::envelope_outline, ArmatureDrawContext::envelope_solid, OVERLAY_PrivateData::extra_call_buffers, ArmatureDrawContext::extras, NULL, ArmatureDrawContext::ob, OB_DRAW_IN_FRONT, OB_SOLID, OVERLAY_ArmatureCallBuffersInner::octa_fill, OVERLAY_ArmatureCallBuffersInner::octa_outline, ArmatureDrawContext::outline, OVERLAY_ArmatureCallBuffersInner::point_fill, ArmatureDrawContext::point_outline, OVERLAY_ArmatureCallBuffersInner::point_outline, ArmatureDrawContext::point_solid, ArmatureDrawContext::show_relations, OVERLAY_PrivateData::show_relations, ArmatureDrawContext::solid, OVERLAY_ArmatureCallBuffers::solid, ArmatureDrawContext::stick, OVERLAY_ArmatureCallBuffersInner::stick, OVERLAY_ArmatureCallBuffers::transp, OVERLAY_PrivateData::transparent, OVERLAY_PrivateData::v3d_flag, V3D_SELECT_OUTLINE, ArmatureDrawContext::wire, and OVERLAY_ArmatureCallBuffersInner::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 1158 of file overlay_armature.c.

References color, 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 399 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 934 of file overlay_armature.c.

References usdtokens::b(), CLAMP, usdtokens::g(), offset, 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 2290 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_object_defgroup_list(), 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, 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(), DRW_view_default_get(), 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_culling_test_bbone(), pchan_culling_test_custom(), pchan_culling_test_envelope(), pchan_culling_test_line(), pchan_culling_test_octohedral(), pchan_culling_test_wire(), 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, Scene::toolsettings, and view.

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

static void drw_shgroup_bone_custom_mesh_wire ( ArmatureDrawContext ctx,
Mesh mesh,
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_solid_mesh()

static void drw_shgroup_bone_custom_solid_mesh ( ArmatureDrawContext ctx,
Mesh mesh,
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

◆ drw_shgroup_custom_bone_curve()

static void drw_shgroup_custom_bone_curve ( ArmatureDrawContext ctx,
Curve curve,
const float(*)  bone_mat[4],
const float  outline_color[4],
Object custom 
)
static

◆ ebone_spline_preview()

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

Definition at line 1258 of file overlay_armature.c.

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(), EditBone::curve_in_x, BBoneSplineParameters::curve_in_x, EditBone::curve_in_z, BBoneSplineParameters::curve_in_z, EditBone::curve_out_x, BBoneSplineParameters::curve_out_x, EditBone::curve_out_z, BBoneSplineParameters::curve_out_z, 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, blender::meshintersect::prev(), BBoneSplineParameters::prev_bbone, BBoneSplineParameters::prev_h, BBoneSplineParameters::prev_mat, EditBone::roll1, BBoneSplineParameters::roll1, EditBone::roll2, BBoneSplineParameters::roll2, EditBone::scale_in, BBoneSplineParameters::scale_in, EditBone::scale_out, BBoneSplineParameters::scale_out, 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 112 of file overlay_armature.c.

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, 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_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_ArmatureCallBuffersInner::envelope_distance, OVERLAY_ArmatureCallBuffersInner::envelope_fill, OVERLAY_ArmatureCallBuffersInner::envelope_outline, 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_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, pow(), OVERLAY_Data::psl, sh, View3D::shading, OVERLAY_PrivateData::show_relations, OVERLAY_ArmatureCallBuffers::solid, state, OVERLAY_ArmatureCallBuffersInner::stick, OVERLAY_Data::stl, OVERLAY_ArmatureCallBuffers::transp, OVERLAY_PrivateData::transparent, View3DShading::type, 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()

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

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

◆ pchan_culling_test_bbone()

static bool pchan_culling_test_bbone ( const DRWView view,
const Object ob,
const bPoseChannel pchan 
)
static

◆ pchan_culling_test_custom()

static bool pchan_culling_test_custom ( const DRWView view,
const Object ob,
const bPoseChannel pchan 
)
static

Definition at line 2134 of file overlay_armature.c.

References pchan_culling_test_simple(), and view.

Referenced by draw_armature_pose().

◆ pchan_culling_test_envelope()

static bool pchan_culling_test_envelope ( const DRWView view,
const Object ob,
const bPoseChannel pchan 
)
static

◆ pchan_culling_test_line()

static bool pchan_culling_test_line ( const DRWView view,
const Object ob,
const bPoseChannel pchan 
)
static

◆ pchan_culling_test_octohedral()

static bool pchan_culling_test_octohedral ( const DRWView view,
const Object ob,
const bPoseChannel pchan 
)
static

Definition at line 2198 of file overlay_armature.c.

References pchan_culling_test_with_radius_scale(), and view.

Referenced by draw_armature_pose().

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

References DRW_culling_sphere_test(), pchan_culling_calc_bsphere(), and view.

Referenced by pchan_culling_test_custom(), and pchan_culling_test_wire().

◆ pchan_culling_test_wire()

static bool pchan_culling_test_wire ( const DRWView view,
const Object ob,
const bPoseChannel pchan 
)
static

Definition at line 2142 of file overlay_armature.c.

References ARM_WIRE, BLI_assert, Object::data, pchan_culling_test_simple(), and view.

Referenced by draw_armature_pose().

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

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