Changeset View
Changeset View
Standalone View
Standalone View
source/blender/modifiers/intern/MOD_hook.c
| Show First 20 Lines • Show All 332 Lines • ▼ Show 20 Lines | static void deformVerts_do(HookModifierData *hmd, | ||||
| else { | else { | ||||
| unit_m3(hd.mat_uniform); /* unused */ | unit_m3(hd.mat_uniform); /* unused */ | ||||
| copy_v3_v3(hd.cent, hmd->cent); | copy_v3_v3(hd.cent, hmd->cent); | ||||
| } | } | ||||
| /* get world-space matrix of target, corrected for the space the verts are in */ | /* get world-space matrix of target, corrected for the space the verts are in */ | ||||
| if (hmd->subtarget[0] && pchan) { | if (hmd->subtarget[0] && pchan) { | ||||
| /* bone target if there's a matching pose-channel */ | /* bone target if there's a matching pose-channel */ | ||||
| mul_m4_m4m4(dmat, ob_target->obmat, pchan->pose_mat); | mul_m4_m4m4(dmat, ob_target->object_to_world, pchan->pose_mat); | ||||
| } | } | ||||
| else { | else { | ||||
| /* just object target */ | /* just object target */ | ||||
| copy_m4_m4(dmat, ob_target->obmat); | copy_m4_m4(dmat, ob_target->object_to_world); | ||||
| } | } | ||||
| invert_m4_m4(ob->imat, ob->obmat); | invert_m4_m4(ob->imat, ob->object_to_world); | ||||
| mul_m4_series(hd.mat, ob->imat, dmat, hmd->parentinv); | mul_m4_series(hd.mat, ob->imat, dmat, hmd->parentinv); | ||||
| /* --- done with 'hd' init --- */ | /* --- done with 'hd' init --- */ | ||||
| /* Regarding index range checking below. | /* Regarding index range checking below. | ||||
| * | * | ||||
| * This should always be true and I don't generally like | * This should always be true and I don't generally like | ||||
| * "paranoid" style code like this, but old files can have | * "paranoid" style code like this, but old files can have | ||||
| * indices that are out of range because old blender did | * indices that are out of range because old blender did | ||||
| ▲ Show 20 Lines • Show All 220 Lines • Show Last 20 Lines | |||||