Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/draw_armature.c
| Show First 20 Lines • Show All 1,076 Lines • ▼ Show 20 Lines | static void draw_bone_update_disp_matrix_bbone(EditBone *eBone, bPoseChannel *pchan) | ||||
| size_to_mat4(s, (const float[3]){xwidth, length / bbone_segments, zwidth}); | size_to_mat4(s, (const float[3]){xwidth, length / bbone_segments, zwidth}); | ||||
| /* Compute BBones segment matrices... */ | /* Compute BBones segment matrices... */ | ||||
| /* Note that we need this even for one-segment bones, because box drawing need specific weirdo matrix for the box, | /* Note that we need this even for one-segment bones, because box drawing need specific weirdo matrix for the box, | ||||
| * that we cannot use to draw end points & co. */ | * that we cannot use to draw end points & co. */ | ||||
| if (pchan) { | if (pchan) { | ||||
| Mat4 *bbones_mat = (Mat4 *)pchan->draw_data->bbone_matrix; | Mat4 *bbones_mat = (Mat4 *)pchan->draw_data->bbone_matrix; | ||||
| if (bbone_segments > 1) { | if (bbone_segments > 1) { | ||||
| if (bbone_segments == pchan->runtime.bbone_segments) { | |||||
| memcpy(bbones_mat, pchan->runtime.bbone_pose_mats, sizeof(Mat4) * bbone_segments); | |||||
| } | |||||
| else { | |||||
| b_bone_spline_setup(pchan, false, bbones_mat); | b_bone_spline_setup(pchan, false, bbones_mat); | ||||
| } | |||||
| for (int i = bbone_segments; i--; bbones_mat++) { | for (int i = bbone_segments; i--; bbones_mat++) { | ||||
| mul_m4_m4m4(bbones_mat->mat, bbones_mat->mat, s); | mul_m4_m4m4(bbones_mat->mat, bbones_mat->mat, s); | ||||
| mul_m4_m4m4(bbones_mat->mat, bone_mat, bbones_mat->mat); | mul_m4_m4m4(bbones_mat->mat, bone_mat, bbones_mat->mat); | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| mul_m4_m4m4(bbones_mat->mat, bone_mat, s); | mul_m4_m4m4(bbones_mat->mat, bone_mat, s); | ||||
| ▲ Show 20 Lines • Show All 817 Lines • Show Last 20 Lines | |||||