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.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/editors/object/object_hook.c b/source/blender/editors/object/object_hook.c
index 88e463039a1..fefefae586c 100644
--- a/source/blender/editors/object/object_hook.c
+++ b/source/blender/editors/object/object_hook.c
@@ -45,6 +45,7 @@
#include "BKE_context.h"
#include "BKE_customdata.h"
#include "BKE_depsgraph.h"
+#include "BKE_main.h"
#include "BKE_mesh.h"
#include "BKE_modifier.h"
#include "BKE_object.h"
@@ -413,7 +414,7 @@ static Object *add_hook_object_new(Scene *scene, Object *obedit)
return ob;
}
-static void add_hook_object(Scene *scene, Object *obedit, Object *ob, int mode)
+static void add_hook_object(Main *bmain, Scene *scene, Object *obedit, Object *ob, int mode)
{
ModifierData *md=NULL;
HookModifierData *hmd = NULL;
@@ -459,11 +460,12 @@ static void add_hook_object(Scene *scene, Object *obedit, Object *ob, int mode)
mul_serie_m4(hmd->parentinv, ob->imat, obedit->obmat, NULL,
NULL, NULL, NULL, NULL, NULL);
- DAG_scene_sort(scene);
+ DAG_scene_sort(bmain, scene);
}
static int object_add_hook_selob_exec(bContext *C, wmOperator *op)
{
+ Main *bmain= CTX_data_main(C);
Scene *scene= CTX_data_scene(C);
Object *obedit = CTX_data_edit_object(C);
Object *obsel=NULL;
@@ -482,7 +484,7 @@ static int object_add_hook_selob_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- add_hook_object(scene, obedit, obsel, OBJECT_ADDHOOK_SELOB);
+ add_hook_object(bmain, scene, obedit, obsel, OBJECT_ADDHOOK_SELOB);
WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, obedit);
return OPERATOR_FINISHED;
@@ -505,10 +507,11 @@ void OBJECT_OT_hook_add_selobj(wmOperatorType *ot)
static int object_add_hook_newob_exec(bContext *C, wmOperator *op)
{
+ Main *bmain= CTX_data_main(C);
Scene *scene= CTX_data_scene(C);
Object *obedit = CTX_data_edit_object(C);
- add_hook_object(scene, obedit, NULL, OBJECT_ADDHOOK_NEWOB);
+ add_hook_object(bmain, scene, obedit, NULL, OBJECT_ADDHOOK_NEWOB);
WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, scene);
WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, obedit);