Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-10-16 00:15:45 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-10-16 00:15:45 +0400
commite7f1e1aed1a9a83763baaccc26498ad5aa1b5757 (patch)
tree084946867904c80add5ee7ba16df2206af747bd1 /source/blender/blenkernel/intern/object.c
parentac602142d3a50157f91d9106dfbf2b39814ac648 (diff)
edits to r60777 - move ED_object_hook_reset_do into BKE object (if RNA needs to call ED_* functions its a hint they might be better in BKE).
Diffstat (limited to 'source/blender/blenkernel/intern/object.c')
-rw-r--r--source/blender/blenkernel/intern/object.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 8c2475369de..94744866a17 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -194,6 +194,28 @@ void BKE_object_free_modifiers(Object *ob)
BKE_object_free_softbody(ob);
}
+void BKE_object_modifier_hook_reset(Object *ob, HookModifierData *hmd)
+{
+ /* reset functionality */
+ if (hmd->object) {
+ bPoseChannel *pchan = BKE_pose_channel_find_name(hmd->object->pose, hmd->subtarget);
+
+ if (hmd->subtarget[0] && pchan) {
+ float imat[4][4], mat[4][4];
+
+ /* calculate the world-space matrix for the pose-channel target first, then carry on as usual */
+ mul_m4_m4m4(mat, hmd->object->obmat, pchan->pose_mat);
+
+ invert_m4_m4(imat, mat);
+ mul_m4_m4m4(hmd->parentinv, imat, ob->obmat);
+ }
+ else {
+ invert_m4_m4(hmd->object->imat, hmd->object->obmat);
+ mul_m4_m4m4(hmd->parentinv, hmd->object->imat, ob->obmat);
+ }
+ }
+}
+
bool BKE_object_support_modifier_type_check(Object *ob, int modifier_type)
{
ModifierTypeInfo *mti;