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:
Diffstat (limited to 'source/blender/editors/object/object_hook.c')
-rw-r--r--source/blender/editors/object/object_hook.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/source/blender/editors/object/object_hook.c b/source/blender/editors/object/object_hook.c
index 707489d588a..15c5ea40991 100644
--- a/source/blender/editors/object/object_hook.c
+++ b/source/blender/editors/object/object_hook.c
@@ -528,7 +528,7 @@ static int add_hook_object(const bContext *C,
int mode,
ReportList *reports)
{
- Depsgraph *depsgraph = CTX_data_depsgraph(C);
+ Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
ModifierData *md = NULL;
HookModifierData *hmd = NULL;
float cent[3];
@@ -603,13 +603,14 @@ static int add_hook_object(const bContext *C,
/* matrix calculus */
/* vert x (obmat x hook->imat) x hook->obmat x ob->imat */
/* (parentinv ) */
- Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob);
- BKE_object_transform_copy(ob_eval, ob);
- BKE_object_where_is_calc(depsgraph, scene, ob_eval);
+ Scene *scene_eval = DEG_get_evaluated_scene(depsgraph);
+ Object *object_eval = DEG_get_evaluated_object(depsgraph, ob);
+ BKE_object_transform_copy(object_eval, ob);
+ BKE_object_where_is_calc(depsgraph, scene_eval, object_eval);
- invert_m4_m4(ob_eval->imat, ob_eval->obmat);
+ invert_m4_m4(object_eval->imat, object_eval->obmat);
/* apparently this call goes from right to left... */
- mul_m4_series(hmd->parentinv, pose_mat, ob_eval->imat, obedit->obmat);
+ mul_m4_series(hmd->parentinv, pose_mat, object_eval->imat, obedit->obmat);
DEG_relations_tag_update(bmain);