Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/drawarmature.c
| Show First 20 Lines • Show All 1,606 Lines • ▼ Show 20 Lines | else | ||||
| UI_GetThemeColor4fv(TH_BONE_SOLID, fcolor); | UI_GetThemeColor4fv(TH_BONE_SOLID, fcolor); | ||||
| draw_bone_solid_octahedral(); | draw_bone_solid_octahedral(); | ||||
| } | } | ||||
| } | } | ||||
| static void draw_custom_bone( | static void draw_custom_bone( | ||||
| const struct EvaluationContext *eval_ctx, | const struct EvaluationContext *eval_ctx, | ||||
| Scene *scene, SceneLayer *sl, View3D *v3d, RegionView3D *rv3d, Object *ob, | Scene *scene, ViewLayer *sl, View3D *v3d, RegionView3D *rv3d, Object *ob, | ||||
| const short dt, int armflag, int boneflag, unsigned int id, float length) | const short dt, int armflag, int boneflag, unsigned int id, float length) | ||||
| { | { | ||||
| if (ob == NULL) return; | if (ob == NULL) return; | ||||
| gpuScaleUniform(length); | gpuScaleUniform(length); | ||||
| /* colors for posemode */ | /* colors for posemode */ | ||||
| if (armflag & ARM_POSEMODE) { | if (armflag & ARM_POSEMODE) { | ||||
| ▲ Show 20 Lines • Show All 304 Lines • ▼ Show 20 Lines | static void bone_matrix_translate_y(float mat[4][4], float y) | ||||
| copy_v3_v3(trans, mat[1]); | copy_v3_v3(trans, mat[1]); | ||||
| mul_v3_fl(trans, y); | mul_v3_fl(trans, y); | ||||
| add_v3_v3(mat[3], trans); | add_v3_v3(mat[3], trans); | ||||
| } | } | ||||
| /* assumes object is Armature with pose */ | /* assumes object is Armature with pose */ | ||||
| static void draw_pose_bones( | static void draw_pose_bones( | ||||
| const struct EvaluationContext *eval_ctx, Scene *scene, SceneLayer *sl, View3D *v3d, ARegion *ar, Base *base, | const struct EvaluationContext *eval_ctx, Scene *scene, ViewLayer *sl, View3D *v3d, ARegion *ar, Base *base, | ||||
| const short dt, const unsigned char ob_wire_col[4], | const short dt, const unsigned char ob_wire_col[4], | ||||
| const bool do_const_color, const bool is_outline) | const bool do_const_color, const bool is_outline) | ||||
| { | { | ||||
| RegionView3D *rv3d = ar->regiondata; | RegionView3D *rv3d = ar->regiondata; | ||||
| Object *ob = base->object; | Object *ob = base->object; | ||||
| bArmature *arm = ob->data; | bArmature *arm = ob->data; | ||||
| bPoseChannel *pchan; | bPoseChannel *pchan; | ||||
| Bone *bone; | Bone *bone; | ||||
| ▲ Show 20 Lines • Show All 717 Lines • ▼ Show 20 Lines | for (pchan = pose->chanbase.first; pchan; pchan = pchan->next) { | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* draw ghosts that occur within a frame range | /* draw ghosts that occur within a frame range | ||||
| * note: object should be in posemode | * note: object should be in posemode | ||||
| */ | */ | ||||
| static void draw_ghost_poses_range( | static void draw_ghost_poses_range( | ||||
| const EvaluationContext *eval_ctx, Scene *scene, SceneLayer *sl, View3D *v3d, ARegion *ar, Base *base) | const EvaluationContext *eval_ctx, Scene *scene, ViewLayer *sl, View3D *v3d, ARegion *ar, Base *base) | ||||
| { | { | ||||
| Object *ob = base->object; | Object *ob = base->object; | ||||
| AnimData *adt = BKE_animdata_from_id(&ob->id); | AnimData *adt = BKE_animdata_from_id(&ob->id); | ||||
| bArmature *arm = ob->data; | bArmature *arm = ob->data; | ||||
| bPose *posen, *poseo; | bPose *posen, *poseo; | ||||
| float start, end, stepsize, range, colfac; | float start, end, stepsize, range, colfac; | ||||
| int cfrao, flago; | int cfrao, flago; | ||||
| unsigned char col[4]; | unsigned char col[4]; | ||||
| ▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | static void draw_ghost_poses_range( | ||||
| arm->flag = flago; | arm->flag = flago; | ||||
| ob->mode |= OB_MODE_POSE; | ob->mode |= OB_MODE_POSE; | ||||
| } | } | ||||
| /* draw ghosts on keyframes in action within range | /* draw ghosts on keyframes in action within range | ||||
| * - object should be in posemode | * - object should be in posemode | ||||
| */ | */ | ||||
| static void draw_ghost_poses_keys( | static void draw_ghost_poses_keys( | ||||
| const struct EvaluationContext *eval_ctx, Scene *scene, SceneLayer *sl, | const struct EvaluationContext *eval_ctx, Scene *scene, ViewLayer *sl, | ||||
| View3D *v3d, ARegion *ar, Base *base) | View3D *v3d, ARegion *ar, Base *base) | ||||
| { | { | ||||
| Object *ob = base->object; | Object *ob = base->object; | ||||
| AnimData *adt = BKE_animdata_from_id(&ob->id); | AnimData *adt = BKE_animdata_from_id(&ob->id); | ||||
| bAction *act = (adt) ? adt->action : NULL; | bAction *act = (adt) ? adt->action : NULL; | ||||
| bArmature *arm = ob->data; | bArmature *arm = ob->data; | ||||
| bPose *posen, *poseo; | bPose *posen, *poseo; | ||||
| DLRBT_Tree keys; | DLRBT_Tree keys; | ||||
| ▲ Show 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | static void draw_ghost_poses_keys( | ||||
| arm->flag = flago; | arm->flag = flago; | ||||
| ob->mode |= OB_MODE_POSE; | ob->mode |= OB_MODE_POSE; | ||||
| } | } | ||||
| /* draw ghosts around current frame | /* draw ghosts around current frame | ||||
| * - object is supposed to be armature in posemode | * - object is supposed to be armature in posemode | ||||
| */ | */ | ||||
| static void draw_ghost_poses( | static void draw_ghost_poses( | ||||
| const struct EvaluationContext *eval_ctx, Scene *scene, SceneLayer *sl, | const struct EvaluationContext *eval_ctx, Scene *scene, ViewLayer *sl, | ||||
| View3D *v3d, ARegion *ar, Base *base) | View3D *v3d, ARegion *ar, Base *base) | ||||
| { | { | ||||
| Object *ob = base->object; | Object *ob = base->object; | ||||
| AnimData *adt = BKE_animdata_from_id(&ob->id); | AnimData *adt = BKE_animdata_from_id(&ob->id); | ||||
| bArmature *arm = ob->data; | bArmature *arm = ob->data; | ||||
| bPose *posen, *poseo; | bPose *posen, *poseo; | ||||
| float cur, start, end, stepsize, range, colfac, actframe, ctime; | float cur, start, end, stepsize, range, colfac, actframe, ctime; | ||||
| int cfrao, flago; | int cfrao, flago; | ||||
| ▲ Show 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | static void draw_ghost_poses( | ||||
| ob->mode |= OB_MODE_POSE; | ob->mode |= OB_MODE_POSE; | ||||
| } | } | ||||
| /* ********************************** Armature Drawing - Main ************************* */ | /* ********************************** Armature Drawing - Main ************************* */ | ||||
| /* called from drawobject.c, return true if nothing was drawn | /* called from drawobject.c, return true if nothing was drawn | ||||
| * (ob_wire_col == NULL) when drawing ghost */ | * (ob_wire_col == NULL) when drawing ghost */ | ||||
| bool draw_armature( | bool draw_armature( | ||||
| const EvaluationContext *eval_ctx, Scene *scene, SceneLayer *sl, View3D *v3d, ARegion *ar, Base *base, | const EvaluationContext *eval_ctx, Scene *scene, ViewLayer *sl, View3D *v3d, ARegion *ar, Base *base, | ||||
| const short dt, const short dflag, const unsigned char ob_wire_col[4], | const short dt, const short dflag, const unsigned char ob_wire_col[4], | ||||
| const bool is_outline) | const bool is_outline) | ||||
| { | { | ||||
| Object *ob = base->object; | Object *ob = base->object; | ||||
| bArmature *arm = ob->data; | bArmature *arm = ob->data; | ||||
| bool retval = false; | bool retval = false; | ||||
| if (v3d->flag2 & V3D_RENDER_OVERRIDE) | if (v3d->flag2 & V3D_RENDER_OVERRIDE) | ||||
| ▲ Show 20 Lines • Show All 83 Lines • Show Last 20 Lines | |||||