diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-21 03:09:28 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-21 03:09:28 +0400 |
commit | b482a0d4fcfbc9051d2eb7f2ed50713bec9c175a (patch) | |
tree | 19da5bf5b4e0e340a9e3b6d2c1b1450f798a7f3c /source/blender/editors | |
parent | 303cecf1398c0049df515aba3898883d8cdc81d5 (diff) |
patch [#30602] Wiki Quick Hack: Apply Transformation To Lattices
from Justin Dailey (dail)
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/object/object_transform.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 57cc034aaaa..0f64e69d9f8 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -40,6 +40,7 @@ #include "DNA_object_types.h" #include "DNA_scene_types.h" #include "DNA_group_types.h" +#include "DNA_lattice_types.h" #include "BLI_math.h" #include "BLI_listbase.h" @@ -398,6 +399,12 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo return OPERATOR_CANCELLED; } } + else if (ob->type == OB_LATTICE) { + if(ID_REAL_USERS(ob->data) > 1) { + BKE_report(reports, RPT_ERROR, "Can't apply to a multi user lattice, doing nothing"); + return OPERATOR_CANCELLED; + } + } else if(ELEM(ob->type, OB_CURVE, OB_SURF)) { Curve *cu; @@ -487,6 +494,16 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo else if (ob->type==OB_ARMATURE) { ED_armature_apply_transform(ob, mat); } + else if (ob->type == OB_LATTICE) { + Lattice *lt = ob->data; + BPoint *bp = lt->def; + int a = lt->pntsu * lt->pntsv * lt->pntsw; + + while (a--) { + mul_m4_v3(mat, bp->vec); + bp++; + } + } else if(ELEM(ob->type, OB_CURVE, OB_SURF)) { Curve *cu= ob->data; |