diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-10-16 00:15:45 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-10-16 00:15:45 +0400 |
commit | e7f1e1aed1a9a83763baaccc26498ad5aa1b5757 (patch) | |
tree | 084946867904c80add5ee7ba16df2206af747bd1 /source/blender/blenkernel/intern/object.c | |
parent | ac602142d3a50157f91d9106dfbf2b39814ac648 (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.c | 22 |
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; |