diff options
author | Ove Murberg Henriksen <sorayasilvermoon@hotmail.com> | 2012-05-08 02:28:59 +0400 |
---|---|---|
committer | Ove Murberg Henriksen <sorayasilvermoon@hotmail.com> | 2012-05-08 02:28:59 +0400 |
commit | 1d5440350d36ef8891063464733cc6d6a434898f (patch) | |
tree | fbbd888ebce98696e913401139244c9fd3fe43b8 /source/blender/editors/object | |
parent | bc86c410f773aabeb4526679dd0d4c6aba66e793 (diff) | |
parent | 364388b9f2a2ddc838f8182537c1ddf3f0ea0f0b (diff) |
svn merge ^/trunk/blender -r46330:46335
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r-- | source/blender/editors/object/object_add.c | 6 | ||||
-rw-r--r-- | source/blender/editors/object/object_edit.c | 42 | ||||
-rw-r--r-- | source/blender/editors/object/object_intern.h | 1 | ||||
-rw-r--r-- | source/blender/editors/object/object_ops.c | 1 | ||||
-rw-r--r-- | source/blender/editors/object/object_transform.c | 8 |
5 files changed, 47 insertions, 11 deletions
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index b9aff50d243..42aa2af11f1 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1241,7 +1241,7 @@ static void curvetomesh(Scene *scene, Object *ob) if (ob->disp.first == NULL) makeDispListCurveTypes(scene, ob, 0); /* force creation */ - nurbs_to_mesh(ob); /* also does users */ + BKE_mesh_from_nurbs(ob); /* also does users */ if (ob->type == OB_MESH) BKE_object_free_modifiers(ob); @@ -1347,7 +1347,7 @@ static int convert_exec(bContext *C, wmOperator *op) newob = ob; } - mesh_to_curve(scene, newob); + BKE_mesh_from_curve(scene, newob); if (newob->type == OB_CURVE) BKE_object_free_modifiers(newob); /* after derivedmesh calls! */ @@ -1509,7 +1509,7 @@ static int convert_exec(bContext *C, wmOperator *op) for (a = 0; a < newob->totcol; a++) id_us_plus((ID *)me->mat[a]); } - mball_to_mesh(&baseob->disp, newob->data); + BKE_mesh_from_metaball(&baseob->disp, newob->data); if (obact->type == OB_MBALL) { basact = basen; diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index d6d7342f900..96099d51dc9 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -749,10 +749,10 @@ static void copy_texture_space(Object *to, Object *ob) /* pass */ } else if (to->type == OB_MBALL) { - BKE_metaball_tex_space_calc(to); + BKE_metaball_texspace_calc(to); } else { - BKE_curve_tex_space_calc(to->data); + BKE_curve_texspace_calc(to->data); } } @@ -1125,6 +1125,7 @@ void ED_objects_recalculate_paths(bContext *C, Scene *scene) BLI_freelistN(&targets); } + /* show popup to determine settings */ static int object_calculate_paths_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) { @@ -1200,6 +1201,39 @@ void OBJECT_OT_paths_calculate(wmOperatorType *ot) /* --------- */ +static int object_update_paths_exec(bContext *C, wmOperator *UNUSED(op)) +{ + Scene *scene = CTX_data_scene(C); + + if (scene == NULL) + return OPERATOR_CANCELLED; + + /* calculate the paths for objects that have them (and are tagged to get refreshed) */ + ED_objects_recalculate_paths(C, scene); + + /* notifiers for updates */ + WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_paths_update(wmOperatorType *ot) +{ + /* identifiers */ + ot->name = "Update Object Paths"; + ot->idname = "OBJECT_OT_paths_update"; + ot->description = "Recalculate paths for selected objects"; + + /* api callbakcs */ + ot->exec = object_update_paths_exec; + ot->poll = ED_operator_object_active_editable; /* TODO: this should probably check for existing paths */ + + /* flags */ + ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/* --------- */ + /* Clear motion paths for selected objects only */ void ED_objects_clear_paths(bContext *C) { @@ -1256,7 +1290,7 @@ static int shade_smooth_exec(bContext *C, wmOperator *op) { if (ob->type == OB_MESH) { - mesh_set_smooth_flag(ob, !clear); + BKE_mesh_smooth_flag_set(ob, !clear); DAG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); @@ -1350,7 +1384,7 @@ static void UNUSED_FUNCTION(image_aspect) (Scene * scene, View3D * v3d) space = 1.0; if (ob->type == OB_MESH) { float size[3]; - mesh_get_texspace(ob->data, NULL, NULL, size); + BKE_mesh_texspace_get(ob->data, NULL, NULL, size); space = size[0] / size[1]; } else if (ELEM3(ob->type, OB_CURVE, OB_FONT, OB_SURF)) { diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h index 28de0b4b33f..e29ab687fff 100644 --- a/source/blender/editors/object/object_intern.h +++ b/source/blender/editors/object/object_intern.h @@ -84,6 +84,7 @@ void OBJECT_OT_proxy_make(struct wmOperatorType *ot); void OBJECT_OT_shade_smooth(struct wmOperatorType *ot); void OBJECT_OT_shade_flat(struct wmOperatorType *ot); void OBJECT_OT_paths_calculate(struct wmOperatorType *ot); +void OBJECT_OT_paths_update(struct wmOperatorType *ot); void OBJECT_OT_paths_clear(struct wmOperatorType *ot); void OBJECT_OT_forcefield_toggle(struct wmOperatorType *ot); diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index 311240d189f..9f5ae7e255f 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -77,6 +77,7 @@ void ED_operatortypes_object(void) WM_operatortype_append(OBJECT_OT_shade_smooth); WM_operatortype_append(OBJECT_OT_shade_flat); WM_operatortype_append(OBJECT_OT_paths_calculate); + WM_operatortype_append(OBJECT_OT_paths_update); WM_operatortype_append(OBJECT_OT_paths_clear); WM_operatortype_append(OBJECT_OT_forcefield_toggle); diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 785b9c0a9b7..4825697f8c3 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -491,7 +491,7 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo } /* update normals */ - mesh_calc_normals_mapping(me->mvert, me->totvert, me->mloop, me->mpoly, me->totloop, me->totpoly, NULL, NULL, 0, NULL, NULL); + BKE_mesh_calc_normals_mapping(me->mvert, me->totvert, me->mloop, me->mpoly, me->totloop, me->totpoly, NULL, NULL, 0, NULL, NULL); } else if (ob->type == OB_ARMATURE) { ED_armature_apply_transform(ob, mat); @@ -772,11 +772,11 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) Mesh *me = ob->data; if (centermode == ORIGIN_TO_CURSOR) { /* done */ } - else if (around == V3D_CENTROID) { mesh_center_median(me, cent); } - else { mesh_center_bounds(me, cent); } + else if (around == V3D_CENTROID) { BKE_mesh_center_median(me, cent); } + else { BKE_mesh_center_bounds(me, cent); } negate_v3_v3(cent_neg, cent); - mesh_translate(me, cent_neg, 1); + BKE_mesh_translate(me, cent_neg, 1); tot_change++; me->id.flag |= LIB_DOIT; |