Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/object/object_hook.c
| Show First 20 Lines • Show All 576 Lines • ▼ Show 20 Lines | static int add_hook_object(const bContext *C, | ||||
| if (mode == OBJECT_ADDHOOK_SELOB_BONE) { | if (mode == OBJECT_ADDHOOK_SELOB_BONE) { | ||||
| bArmature *arm = ob->data; | bArmature *arm = ob->data; | ||||
| BLI_assert(ob->type == OB_ARMATURE); | BLI_assert(ob->type == OB_ARMATURE); | ||||
| if (arm->act_bone) { | if (arm->act_bone) { | ||||
| bPoseChannel *pchan_act; | bPoseChannel *pchan_act; | ||||
| BLI_strncpy(hmd->subtarget, arm->act_bone->name, sizeof(hmd->subtarget)); | BLI_strncpy(hmd->subtarget, arm->act_bone->name, sizeof(hmd->subtarget)); | ||||
| pchan_act = BKE_pose_channel_active(ob); | pchan_act = BKE_pose_channel_active_if_layer_visible(ob); | ||||
| if (LIKELY(pchan_act)) { | if (LIKELY(pchan_act)) { | ||||
| invert_m4_m4(pose_mat, pchan_act->pose_mat); | invert_m4_m4(pose_mat, pchan_act->pose_mat); | ||||
| mul_v3_m4v3(cent, ob->obmat, pchan_act->pose_mat[3]); | mul_v3_m4v3(cent, ob->obmat, pchan_act->pose_mat[3]); | ||||
| mul_v3_m4v3(cent, obedit->imat, cent); | mul_v3_m4v3(cent, obedit->imat, cent); | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| BKE_report(reports, RPT_WARNING, "Armature has no active object bone"); | BKE_report(reports, RPT_WARNING, "Armature has no active object bone"); | ||||
| ▲ Show 20 Lines • Show All 394 Lines • Show Last 20 Lines | |||||