Blender  V2.59
Enumerations | Functions | Variables
drawarmature.c File Reference
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "DNA_anim_types.h"
#include "DNA_armature_types.h"
#include "DNA_constraint_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_view3d_types.h"
#include "DNA_object_types.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_dlrbTree.h"
#include "BLI_utildefines.h"
#include "BKE_animsys.h"
#include "BKE_action.h"
#include "BKE_armature.h"
#include "BKE_global.h"
#include "BKE_modifier.h"
#include "BKE_nla.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
#include "ED_armature.h"
#include "ED_keyframes_draw.h"
#include "BLF_api.h"
#include "UI_resources.h"
#include "view3d_intern.h"

Go to the source code of this file.

Enumerations

enum  {
  PCHAN_COLOR_NORMAL = 0, PCHAN_COLOR_SOLID, PCHAN_COLOR_CONSTS, PCHAN_COLOR_SPHEREBONE_BASE,
  PCHAN_COLOR_SPHEREBONE_END, PCHAN_COLOR_LINEBONE
}

Functions

static void set_pchan_colorset (Object *ob, bPoseChannel *pchan)
static void cp_shade_color3ub (unsigned char cp[3], const int offset)
static short set_pchan_glColor (short colCode, int boneflag, int constflag)
static void set_ebone_glColor (const unsigned int boneflag)
static void drawsolidcube_size (float xsize, float ysize, float zsize)
static void drawcube_size (float xsize, float ysize, float zsize)
static void draw_bonevert (void)
static void draw_bonevert_solid (void)
static void draw_bone_octahedral (void)
static void draw_bone_solid_octahedral (void)
static void draw_bone_points (int dt, int armflag, unsigned int boneflag, int id)
static void draw_sphere_bone_dist (float smat[][4], float imat[][4], bPoseChannel *pchan, EditBone *ebone)
static void draw_sphere_bone_wire (float smat[][4], float imat[][4], int armflag, int boneflag, int constflag, unsigned int id, bPoseChannel *pchan, EditBone *ebone)
static void draw_sphere_bone (int dt, int armflag, int boneflag, int constflag, unsigned int id, bPoseChannel *pchan, EditBone *ebone)
static void draw_line_bone (int armflag, int boneflag, int constflag, unsigned int id, bPoseChannel *pchan, EditBone *ebone)
static void draw_b_bone_boxes (int dt, bPoseChannel *pchan, float xwidth, float length, float zwidth)
static void draw_b_bone (int dt, int armflag, int boneflag, int constflag, unsigned int id, bPoseChannel *pchan, EditBone *ebone)
static void draw_bone (int dt, int armflag, int boneflag, int constflag, unsigned int id, float length)
static void draw_custom_bone (Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob, int dt, int armflag, int boneflag, unsigned int id, float length)
static void pchan_draw_IK_root_lines (bPoseChannel *pchan, short only_temp)
static void bgl_sphere_project (float ax, float az)
static void draw_dof_ellipse (float ax, float az)
static void draw_pose_dofs (Object *ob)
static void bone_matrix_translate_y (float mat[][4], float y)
static void draw_pose_bones (Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt, const short is_ghost, const short is_outline)
static void get_matrix_editbone (EditBone *eBone, float bmat[][4])
static void draw_ebones (View3D *v3d, ARegion *ar, Object *ob, int dt)
static void draw_pose_paths (Scene *scene, View3D *v3d, ARegion *ar, Object *ob)
static void ghost_poses_tag_unselected (Object *ob, short unset)
static void draw_ghost_poses_range (Scene *scene, View3D *v3d, ARegion *ar, Base *base)
static void draw_ghost_poses_keys (Scene *scene, View3D *v3d, ARegion *ar, Base *base)
static void draw_ghost_poses (Scene *scene, View3D *v3d, ARegion *ar, Base *base)
int draw_armature (Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt, int flag, const short is_outline)

Variables

static ThemeWireColorbcolor = NULL
static float cube [8][3]
static float si [16]
static float co [16]
static GLubyte bm_dot6 [] = {0x0, 0x18, 0x3C, 0x7E, 0x7E, 0x3C, 0x18, 0x0}
static GLubyte bm_dot8 [] = {0x3C, 0x7E, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C}
static GLubyte bm_dot5 [] = {0x0, 0x0, 0x10, 0x38, 0x7c, 0x38, 0x10, 0x0}
static GLubyte bm_dot7 [] = {0x0, 0x38, 0x7C, 0xFE, 0xFE, 0xFE, 0x7C, 0x38}

Detailed Description

Definition in file drawarmature.c.


Enumeration Type Documentation

anonymous enum
Enumerator:
PCHAN_COLOR_NORMAL 
PCHAN_COLOR_SOLID 
PCHAN_COLOR_CONSTS 
PCHAN_COLOR_SPHEREBONE_BASE 
PCHAN_COLOR_SPHEREBONE_END 
PCHAN_COLOR_LINEBONE 

Definition at line 80 of file drawarmature.c.


Function Documentation

static void bgl_sphere_project ( float  ax,
float  az 
) [static]

Definition at line 1379 of file drawarmature.c.

References sqrt().

Referenced by draw_dof_ellipse().

static void bone_matrix_translate_y ( float  mat[][4],
float  y 
) [static]

Definition at line 1568 of file drawarmature.c.

References add_v3_v3(), mul_v3_fl(), and VECCOPY.

Referenced by draw_ebones(), and draw_pose_bones().

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

Definition at line 132 of file drawarmature.c.

References CLAMP(), and g.

Referenced by set_pchan_glColor().

int draw_armature ( Scene scene,
View3D v3d,
ARegion ar,
Base base,
int  dt,
int  flag,
const short  is_outline 
)
static void draw_b_bone ( int  dt,
int  armflag,
int  boneflag,
int  constflag,
unsigned int  id,
bPoseChannel pchan,
EditBone ebone 
) [static]
static void draw_b_bone_boxes ( int  dt,
bPoseChannel pchan,
float  xwidth,
float  length,
float  zwidth 
) [static]
static void draw_bone ( int  dt,
int  armflag,
int  boneflag,
int  constflag,
unsigned int  id,
float  length 
) [static]
static void draw_bone_octahedral ( void  ) [static]

Definition at line 444 of file drawarmature.c.

Referenced by draw_bone().

static void draw_bone_points ( int  dt,
int  armflag,
unsigned int  boneflag,
int  id 
) [static]
static void draw_bone_solid_octahedral ( void  ) [static]

Definition at line 488 of file drawarmature.c.

References normal_tri_v3().

Referenced by draw_bone().

static void draw_bonevert ( void  ) [static]

Definition at line 390 of file drawarmature.c.

Referenced by draw_bone_points().

static void draw_bonevert_solid ( void  ) [static]

Definition at line 421 of file drawarmature.c.

Referenced by draw_bone_points().

static void draw_custom_bone ( Scene scene,
View3D v3d,
RegionView3D rv3d,
Object ob,
int  dt,
int  armflag,
int  boneflag,
unsigned int  id,
float  length 
) [static]
static void draw_dof_ellipse ( float  ax,
float  az 
) [static]

Definition at line 1393 of file drawarmature.c.

References bgl_sphere_project(), and i.

Referenced by draw_pose_dofs().

static void draw_ebones ( View3D v3d,
ARegion ar,
Object ob,
int  dt 
) [static]
static void draw_ghost_poses ( Scene scene,
View3D v3d,
ARegion ar,
Base base 
) [static]
static void draw_ghost_poses_keys ( Scene scene,
View3D v3d,
ARegion ar,
Base base 
) [static]
static void draw_ghost_poses_range ( Scene scene,
View3D v3d,
ARegion ar,
Base base 
) [static]
static void draw_line_bone ( int  armflag,
int  boneflag,
int  constflag,
unsigned int  id,
bPoseChannel pchan,
EditBone ebone 
) [static]
static void draw_pose_bones ( Scene scene,
View3D v3d,
ARegion ar,
Base base,
int  dt,
const short  is_ghost,
const short  is_outline 
) [static]

Definition at line 1578 of file drawarmature.c.

References bArmature::act_bone, ARM_B_BONE, ARM_DRAWAXES, ARM_DRAWNAMES, ARM_EDITMODE, ARM_ENVELOPE, ARM_LINE, ARM_NO_CUSTOM, ARM_POSEMODE, BA_WAS_SEL, Scene::basact, bglPolygonOffset(), bPoseChannel::bone, BONE_CONNECTED, BONE_DRAW_ACTIVE, BONE_DRAWWIRE, BONE_HIDDEN_P, BONE_HIDDEN_PG, bone_matrix_translate_y(), BONE_NO_DEFORM, BONE_SELECTED, BONE_UNSELECTABLE, bPose::chanbase, bPoseChannel::constflag, copy_m4_m4(), bPoseChannel::custom, bPoseChannel::custom_tx, Object::data, RegionView3D::dist, draw_b_bone(), draw_bone(), draw_custom_bone(), draw_line_bone(), draw_pose_dofs(), draw_sphere_bone(), draw_sphere_bone_dist(), draw_sphere_bone_wire(), drawaxes(), bArmature::drawtype, Global::f, ListBase::first, Bone::flag, Base::flag, bArmature::flag, View3D::flag, bPoseChannel::flag, G, G_PICKSEL, glMultMatrixf, invert_m4_m4(), Bone::layer, bArmature::layer, bArmature::layer_used, len_v3(), Bone::length, mid_v3_v3v3(), mul_mat3_m4_fl(), bPoseChannel::name, bPoseChannel::next, NULL, OB_ARROWS, OB_SOLID, OB_WIRE, Base::object, Object::obmat, Bone::parent, bPoseChannel::parent, pchan_draw_IK_root_lines(), PCHAN_HAS_ACTION, PCHAN_HAS_IK, PCHAN_HAS_SPLINEIK, PCHAN_HAS_TARGET, Object::pose, bPoseChannel::pose_head, POSE_LOC, bPoseChannel::pose_mat, POSE_ROT, POSE_SIZE, bPoseChannel::pose_tail, ARegion::regiondata, rgb_float_to_byte(), Base::selcol, SELECT, set_pchan_colorset(), setlinestyle(), TH_ACTIVE, TH_SELECT, TH_TEXT, TH_TEXT_HI, TH_WIRE, UI_GetThemeColor3ubv(), UI_ThemeColor(), V3D_HIDE_HELPLINES, view3d_cached_text_draw_add(), RegionView3D::viewmatob, and View3D::zbuf.

Referenced by draw_armature(), draw_ghost_poses(), draw_ghost_poses_keys(), and draw_ghost_poses_range().

static void draw_pose_dofs ( Object ob) [static]
static void draw_pose_paths ( Scene scene,
View3D v3d,
ARegion ar,
Object ob 
) [static]
static void draw_sphere_bone ( int  dt,
int  armflag,
int  boneflag,
int  constflag,
unsigned int  id,
bPoseChannel pchan,
EditBone ebone 
) [static]
static void draw_sphere_bone_dist ( float  smat[][4],
float  imat[][4],
bPoseChannel pchan,
EditBone ebone 
) [static]
static void draw_sphere_bone_wire ( float  smat[][4],
float  imat[][4],
int  armflag,
int  boneflag,
int  constflag,
unsigned int  id,
bPoseChannel pchan,
EditBone ebone 
) [static]
static void drawcube_size ( float  xsize,
float  ysize,
float  zsize 
) [static]

Definition at line 361 of file drawarmature.c.

Referenced by draw_b_bone_boxes().

static void drawsolidcube_size ( float  xsize,
float  ysize,
float  zsize 
) [static]

Definition at line 316 of file drawarmature.c.

Referenced by draw_b_bone_boxes().

static void get_matrix_editbone ( EditBone eBone,
float  bmat[][4] 
) [static]
static void ghost_poses_tag_unselected ( Object ob,
short  unset 
) [static]
static void pchan_draw_IK_root_lines ( bPoseChannel pchan,
short  only_temp 
) [static]
static void set_ebone_glColor ( const unsigned int  boneflag) [static]
static void set_pchan_colorset ( Object ob,
bPoseChannel pchan 
) [static]
static short set_pchan_glColor ( short  colCode,
int  boneflag,
int  constflag 
) [static]

Variable Documentation

ThemeWireColor* bcolor = NULL [static]

Definition at line 77 of file drawarmature.c.

GLubyte bm_dot5[] = {0x0, 0x0, 0x10, 0x38, 0x7c, 0x38, 0x10, 0x0} [static]

Definition at line 998 of file drawarmature.c.

Referenced by draw_line_bone().

GLubyte bm_dot6[] = {0x0, 0x18, 0x3C, 0x7E, 0x7E, 0x3C, 0x18, 0x0} [static]

Definition at line 995 of file drawarmature.c.

Referenced by draw_line_bone().

GLubyte bm_dot7[] = {0x0, 0x38, 0x7C, 0xFE, 0xFE, 0xFE, 0x7C, 0x38} [static]

Definition at line 999 of file drawarmature.c.

Referenced by draw_line_bone().

GLubyte bm_dot8[] = {0x3C, 0x7E, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C} [static]

Definition at line 996 of file drawarmature.c.

Referenced by draw_line_bone().

float co[16] [static]
Initial value:
{
        1.00000000f,
        0.97952994f, 0.91895781f,
        0.82076344f, 0.68896691f,
        0.52896401f, 0.34730525f,
        0.15142777f, -0.05064916f,
        -0.25065253f, -0.44039415f,
        -0.61210598f, -0.75875812f,
        -0.87434661f, -0.95413925f,
        -0.99486932f
}

Definition at line 618 of file drawarmature.c.

Referenced by add_orco_dm(), addedgeface_mesh(), applyModifier(), armature_deform_verts(), arrayModifier_doArray(), ATTRIBUTE_ALIGNED16(), axis_angle_to_mat3(), BKE_text_to_curve(), BLI_bvhtree_find_nearest(), BLI_bvhtree_range_query(), BLI_pbvh_build_grids(), BLI_pbvh_get_vertCos(), BLI_pbvh_node_raycast(), brush_add(), brush_gen_texture_cache(), brush_puff(), brush_sample_tex(), buildchar(), bvhselftree_build_from_cloth(), bvhselftree_update_from_cloth(), bvhtree_build_from_cloth(), bvhtree_build_from_mvert(), bvhtree_from_mesh_edges(), bvhtree_from_mesh_faces(), bvhtree_from_mesh_verts(), bvhtree_update_from_cloth(), bvhtree_update_from_mvert(), cache_strand_surface(), CalcSnapGeometry(), calcTriangleDivs(), ccgDM_copyFinalVertArray(), ccgDM_drawEdges(), ccgDM_drawFacesColored(), ccgDM_drawFacesSolid(), ccgDM_drawFacesTex_common(), ccgDM_drawLooseEdges(), ccgDM_drawMappedEdges(), ccgDM_drawMappedEdgesInterp(), ccgDM_drawMappedFaces(), ccgDM_drawMappedFacesGLSL(), ccgDM_foreachMappedEdge(), ccgDM_getMinMax(), ccgSubSurf__calcSubdivLevel(), ccgSubSurf__sync(), circle_draw(), cloth_to_object(), collision_response(), colorfn(), connect_hair(), construct_param_handle(), contarget_get_lattice_mat(), contarget_get_mesh_mat(), create_octree_node(), createArc(), createFacepa(), createSlideVerts(), GeometryExporter::createVertsSource(), curve_applyVertexCos(), curve_getKeyVertexCos(), curve_getVertexCos(), deformVerts(), dfs_range_query(), distribute_threads_init_data(), do_bake_shade(), do_lamp_tex(), do_material_tex(), do_multires_smooth_brush(), do_path_effectors(), do_projectpaint_thread(), do_sky_tex(), do_volume_tex(), doMirrorOnAxis(), draw_filled_lasso(), draw_motion_path_instance(), draw_sphere_bone_dist(), drawcursor(), edgering_sel(), exec_strandsurface_sample(), face_duplilist(), fill_quad_double_adj_inner(), fill_scs_points(), fluid_get_bb(), flushTransParticles(), get_texture_coords(), GetPosition(), give_parvert(), global_bounds_obi(), gp_draw_stroke_point(), gp_stroke_simplify(), GPU_buffer_copy_vertex(), GPU_draw_buffers(), GPU_update_grid_buffers(), grid_tangent(), imapaint_pick_uv(), init_camera_inside_volumes(), init_latt_deform(), initElbeemMesh(), integrate_particle(), interp_bilinear_grid(), InterpCSGFace(), intersect_dm_quad_weights(), MT_Matrix3x3::inverse(), btMatrix3x3::inverse(), RAS_MeshSlot::Join(), kdtree_balance(), key_block_get_data(), key_to_vertcos(), laplacian_add_vertex(), lattice_draw_verts(), lattice_foreachScreenVert(), layerInterp_msticky(), make_editMesh(), mat3_to_quat_is_ok(), meshdeform_dynamic_bind(), meshdeform_intersect(), meshdeformModifier_do(), mul_fac_qt_fl(), multires_apply_smat(), multires_copy_dm_grid(), multires_load_old_dm(), multiresModifier_disp_run(), multiresModifier_update(), my_boundbox_mesh(), normal_projection_project_vertex(), normalfn(), ntreeTexExecTree(), occ_compute_bounces(), occ_compute_passes(), occ_lookup(), offset_to_key(), p_vert_add(), paint_get_tex_pixel(), pe_deflect_emitter(), pe_iterate_lengths(), PE_lasso_select(), PE_minmax(), PE_update_mirror_cache(), pointdensity_cache_object(), pointdensitytex(), project_paint_uvpixel_init(), psys_find_parents(), psys_get_particle_on_path(), psys_get_texture(), psys_interpolate_particle(), psys_origspace_to_w(), psys_render_projected_area(), psys_thread_create_path(), psys_uv_to_w(), ptcache_cloth_interpolate(), ptcache_particle_interpolate(), ptcache_softbody_interpolate(), ray_shadow_qmc(), remove_doubles_exec(), render_new_particle_system(), resizelattice(), rule_fight(), sb_detect_face_pointCached(), scatter_tree_new(), sculpt_undo_restore(), select_exec(), select_invoke(), select_linked_internal(), select_loop_exec(), select_loop_invoke(), set_subsurf_uv(), shadeHaloFloat(), shadow_halo(), shrinkwrap_calc_nearest_surface_point(), shrinkwrap_calc_nearest_vertex(), shrinkwrap_calc_normal_projection(), shrinkwrap_get_tarmat(), SimpleDeformModifier_do(), smokeModifier_init(), sph_force_cb(), spotvolume(), sss_add_points(), sss_create_tree_mat(), subdivide_edge_addvert(), subsurf_calculate_limit_positions(), transform_mesh_orco_verts(), tri_to_quat(), ui_draw_but_HSVCIRCLE(), UI_view2d_mouse_in_scrollers(), update_velocities(), uvprojectModifier_do(), vec_rot_to_mat3(), vec_to_quat(), vertcos_to_key(), vol_precache_part(), voxeldatatex(), vpaint_blend(), Warp(), warpModifier_do(), wavemod_get_texture_coords(), waveModifier_do(), weight_sample_invoke(), ArmatureImporter::write_controller(), zbuffer_strands_abuf(), and zbufshade_sss_tile().

float cube[8][3] [static]
Initial value:
 {
{-1.0,  0.0, -1.0},
{-1.0,  0.0,  1.0},
{-1.0,  1.0,  1.0},
{-1.0,  1.0, -1.0},
{ 1.0,  0.0, -1.0},
{ 1.0,  0.0,  1.0},
{ 1.0,  1.0,  1.0},
{ 1.0,  1.0, -1.0},
}

Definition at line 305 of file drawarmature.c.

float si[16] [static]