diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2010-07-25 15:57:36 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2010-07-25 15:57:36 +0400 |
commit | cc0f3146e798479be0758b5c152ef67ef42ea8dc (patch) | |
tree | 669704799ec2a83908777d1b0d9cc1517dfb871c /source/blender/editors/transform | |
parent | 61a09d96b1c10decb732f77a50421101e43cf401 (diff) |
Shapekeys for curves/surfeces
Fix #21498: Edit curve Shape key /252_r 27318
Added full support of shape keys for curves and nurbs surfaces including
topology changing in edit mode, undo stuff, updating relative keys when
working under basis and so on.
Diffstat (limited to 'source/blender/editors/transform')
4 files changed, 17 insertions, 8 deletions
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 44a22da60e0..dc731d7a433 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -94,6 +94,7 @@ #include "ED_mesh.h" #include "ED_types.h" #include "ED_uvedit.h" +#include "ED_curve.h" /* for ED_curve_editnurbs */ #include "UI_view2d.h" @@ -1347,12 +1348,14 @@ static void createTransCurveVerts(bContext *C, TransInfo *t) int count=0, countsel=0; int propmode = t->flag & T_PROP_EDIT; short hide_handles = (cu->drawflag & CU_HIDE_HANDLES); - + ListBase *nurbs; + /* to be sure */ if(cu->editnurb==NULL) return; /* count total of vertices, check identical as in 2nd loop for making transdata! */ - for(nu= cu->editnurb->first; nu; nu= nu->next) { + nurbs= ED_curve_editnurbs(cu); + for(nu= nurbs->first; nu; nu= nu->next) { if(nu->type == CU_BEZIER) { for(a=0, bezt= nu->bezt; a<nu->pntsu; a++, bezt++) { if(bezt->hide==0) { @@ -1388,7 +1391,7 @@ static void createTransCurveVerts(bContext *C, TransInfo *t) invert_m3_m3(smtx, mtx); td = t->data; - for(nu= cu->editnurb->first; nu; nu= nu->next) { + for(nu= nurbs->first; nu; nu= nu->next) { if(nu->type == CU_BEZIER) { TransData *head, *tail; head = tail = td; diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 98ecb07660f..8d98255d3d9 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -84,6 +84,7 @@ #include "ED_space_api.h" #include "ED_uvedit.h" #include "ED_view3d.h" +#include "ED_curve.h" /* for ED_curve_editnurbs */ //#include "BDR_unwrapper.h" @@ -636,14 +637,15 @@ void recalcData(TransInfo *t) if (t->obedit) { if ELEM(t->obedit->type, OB_CURVE, OB_SURF) { Curve *cu= t->obedit->data; - Nurb *nu= cu->editnurb->first; + ListBase *nurbs= ED_curve_editnurbs(cu); + Nurb *nu= nurbs->first; if(t->state != TRANS_CANCEL) { clipMirrorModifier(t, t->obedit); } DAG_id_flush_update(t->obedit->data, OB_RECALC_DATA); /* sets recalc flags */ - + if (t->state == TRANS_CANCEL) { while(nu) { calchandlesNurb(nu); /* Cant do testhandlesNurb here, it messes up the h1 and h2 flags */ diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index 016aca2b7ec..2a717f8b4d9 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -73,6 +73,7 @@ #include "ED_mesh.h" #include "ED_particle.h" #include "ED_view3d.h" +#include "ED_curve.h" /* for ED_curve_editnurbs */ #include "UI_resources.h" @@ -311,8 +312,9 @@ int calc_manipulator_stats(const bContext *C) Nurb *nu; BezTriple *bezt; BPoint *bp; + ListBase *nurbs= ED_curve_editnurbs(cu); - nu= cu->editnurb->first; + nu= nurbs->first; while(nu) { if(nu->type == CU_BEZIER) { bezt= nu->bezt; diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index e926762709d..8451b0c154a 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -51,6 +51,7 @@ #include "ED_armature.h" #include "ED_mesh.h" +#include "ED_curve.h" /* for ED_curve_editnurbs */ #include "RNA_define.h" @@ -740,8 +741,9 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3], Nurb *nu; BezTriple *bezt; int a; - - for (nu = cu->editnurb->first; nu; nu = nu->next) + ListBase *nurbs= ED_curve_editnurbs(cu); + + for (nu = nurbs->first; nu; nu = nu->next) { /* only bezier has a normal */ if(nu->type == CU_BEZIER) |