diff options
Diffstat (limited to 'source/blender/editors/object/object_hook.c')
-rw-r--r-- | source/blender/editors/object/object_hook.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/source/blender/editors/object/object_hook.c b/source/blender/editors/object/object_hook.c index fd4581af194..ce01bef34f6 100644 --- a/source/blender/editors/object/object_hook.c +++ b/source/blender/editors/object/object_hook.c @@ -292,7 +292,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 +302,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)) { @@ -427,7 +432,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"); @@ -485,7 +490,7 @@ static int object_add_hook_selob_exec(bContext *C, wmOperator *op) CTX_DATA_END; if (!obsel) { - BKE_report(op->reports, RPT_ERROR, "Can't add hook with no other selected objects."); + BKE_report(op->reports, RPT_ERROR, "Can't add hook with no other selected objects"); return OPERATOR_CANCELLED; } @@ -608,7 +613,7 @@ void OBJECT_OT_hook_remove(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to remove."); + prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to remove"); RNA_def_enum_funcs(prop, hook_mod_itemf); ot->prop= prop; } @@ -675,7 +680,7 @@ void OBJECT_OT_hook_reset(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to assign to."); + prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to assign to"); RNA_def_enum_funcs(prop, hook_mod_itemf); } @@ -731,7 +736,7 @@ void OBJECT_OT_hook_recenter(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to assign to."); + prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to assign to"); RNA_def_enum_funcs(prop, hook_mod_itemf); } @@ -760,7 +765,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; } @@ -794,7 +799,7 @@ void OBJECT_OT_hook_assign(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to assign to."); + prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to assign to"); RNA_def_enum_funcs(prop, hook_mod_itemf); } @@ -843,7 +848,7 @@ void OBJECT_OT_hook_select(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to remove."); + prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to remove"); RNA_def_enum_funcs(prop, hook_mod_itemf); } |