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.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/source/blender/editors/object/object_hook.c b/source/blender/editors/object/object_hook.c
index bb32869469a..266556773f0 100644
--- a/source/blender/editors/object/object_hook.c
+++ b/source/blender/editors/object/object_hook.c
@@ -64,6 +64,7 @@
#include "ED_curve.h"
#include "ED_mesh.h"
+#include "ED_lattice.h"
#include "ED_screen.h"
#include "WM_types.h"
@@ -292,7 +293,7 @@ static int return_editcurve_indexar(Object *obedit, int *tot, int **indexar, flo
return totvert;
}
-static int object_hook_index_array(Object *obedit, int *tot, int **indexar, char *name, float *cent_r)
+static int object_hook_index_array(Scene *scene, Object *obedit, int *tot, int **indexar, char *name, float *cent_r)
{
*indexar= NULL;
*tot= 0;
@@ -302,7 +303,12 @@ static int object_hook_index_array(Object *obedit, int *tot, int **indexar, char
case OB_MESH:
{
Mesh *me= obedit->data;
- EditMesh *em = BKE_mesh_get_editmesh(me);
+ EditMesh *em;
+
+ load_editMesh(scene, obedit);
+ make_editMesh(scene, obedit);
+
+ em = BKE_mesh_get_editmesh(me);
/* check selected vertices first */
if( return_editmesh_indexar(em, tot, indexar, cent_r)) {
@@ -316,10 +322,17 @@ static int object_hook_index_array(Object *obedit, int *tot, int **indexar, char
}
case OB_CURVE:
case OB_SURF:
+ load_editNurb(obedit);
+ make_editNurb(obedit);
+
return return_editcurve_indexar(obedit, tot, indexar, cent_r);
case OB_LATTICE:
{
Lattice *lt= obedit->data;
+
+ load_editLatt(obedit);
+ make_editLatt(obedit);
+
return return_editlattice_indexar(lt->editlatt->latt, tot, indexar, cent_r);
}
default:
@@ -427,7 +440,7 @@ static void add_hook_object(Main *bmain, Scene *scene, Object *obedit, Object *o
int tot, ok, *indexar;
char name[32];
- ok = object_hook_index_array(obedit, &tot, &indexar, name, cent);
+ ok = object_hook_index_array(scene, obedit, &tot, &indexar, name, cent);
if (!ok) return; // XXX error("Requires selected vertices or active Vertex Group");
@@ -760,7 +773,7 @@ static int object_hook_assign_exec(bContext *C, wmOperator *op)
/* assign functionality */
- if(!object_hook_index_array(ob, &tot, &indexar, name, cent)) {
+ if(!object_hook_index_array(CTX_data_scene(C), ob, &tot, &indexar, name, cent)) {
BKE_report(op->reports, RPT_WARNING, "Requires selected vertices or active vertex group");
return OPERATOR_CANCELLED;
}