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/space_view3d | |
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/space_view3d')
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 7 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_buttons.c | 11 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_snap.c | 13 |
3 files changed, 20 insertions, 11 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index f5a14079682..981c11114b2 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -86,6 +86,7 @@ #include "ED_screen.h" #include "ED_sculpt.h" #include "ED_types.h" +#include "ED_curve.h" /* for ED_curve_editnurbs */ #include "UI_resources.h" @@ -1610,10 +1611,11 @@ void nurbs_foreachScreenVert(ViewContext *vc, void (*func)(void *userData, Nurb short s[2] = {IS_CLIPPED, 0}; Nurb *nu; int i; + ListBase *nurbs= ED_curve_editnurbs(cu); ED_view3d_local_clipping(vc->rv3d, vc->obedit->obmat); /* for local clipping lookups */ - for (nu= cu->editnurb->first; nu; nu=nu->next) { + for (nu= nurbs->first; nu; nu=nu->next) { if(nu->type == CU_BEZIER) { for (i=0; i<nu->pntsu; i++) { BezTriple *bezt = &nu->bezt[i]; @@ -5882,7 +5884,8 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) cu= ob->data; if(cu->editnurb) { - drawnurb(scene, v3d, rv3d, base, cu->editnurb->first, dt); + ListBase *nurbs= ED_curve_editnurbs(cu); + drawnurb(scene, v3d, rv3d, base, nurbs->first, dt); } else if(dt==OB_BOUNDBOX) { if((v3d->flag2 & V3D_RENDER_OVERRIDE && v3d->drawtype >= OB_WIRE)==0) diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index c75b785aa11..19aaff2cea9 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -73,6 +73,7 @@ #include "ED_mesh.h" #include "ED_screen.h" #include "ED_transform.h" +#include "ED_curve.h" #include "UI_interface.h" #include "UI_resources.h" @@ -205,8 +206,9 @@ static void v3d_editvertex_buts(const bContext *C, uiLayout *layout, View3D *v3d BPoint *bp; BezTriple *bezt; int a; - - nu= cu->editnurb->first; + ListBase *nurbs= ED_curve_editnurbs(cu); + + nu= nurbs->first; while(nu) { if(nu->type == CU_BEZIER) { bezt= nu->bezt; @@ -410,8 +412,9 @@ static void v3d_editvertex_buts(const bContext *C, uiLayout *layout, View3D *v3d BPoint *bp; BezTriple *bezt; int a; - - nu= cu->editnurb->first; + ListBase *nurbs= ED_curve_editnurbs(cu); + + nu= nurbs->first; while(nu) { if(nu->type == CU_BEZIER) { bezt= nu->bezt; diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c index ff716a640d8..160306ef300 100644 --- a/source/blender/editors/space_view3d/view3d_snap.c +++ b/source/blender/editors/space_view3d/view3d_snap.c @@ -66,6 +66,7 @@ #include "ED_armature.h" #include "ED_mesh.h" #include "ED_screen.h" +#include "ED_curve.h" /* for ED_curve_editnurbs */ #include "view3d_intern.h" @@ -100,8 +101,9 @@ static void special_transvert_update(Scene *scene, Object *obedit) } else if (ELEM(obedit->type, OB_CURVE, OB_SURF)) { Curve *cu= obedit->data; - Nurb *nu= cu->editnurb->first; - + ListBase *nurbs= ED_curve_editnurbs(cu); + Nurb *nu= nurbs->first; + while(nu) { test2DNurb(nu); testhandlesNurb(nu); /* test for bezier too */ @@ -288,8 +290,9 @@ static void make_trans_verts(Object *obedit, float *min, float *max, int mode) else if (ELEM(obedit->type, OB_CURVE, OB_SURF)) { Curve *cu= obedit->data; int totmalloc= 0; - - for(nu= cu->editnurb->first; nu; nu= nu->next) { + ListBase *nurbs= ED_curve_editnurbs(cu); + + for(nu= nurbs->first; nu; nu= nu->next) { if(nu->type == CU_BEZIER) totmalloc += 3*nu->pntsu; else @@ -297,7 +300,7 @@ static void make_trans_verts(Object *obedit, float *min, float *max, int mode) } tv=transvmain= MEM_callocN(totmalloc*sizeof(TransVert), "maketransverts curve"); - nu= cu->editnurb->first; + nu= nurbs->first; while(nu) { if(nu->type == CU_BEZIER) { a= nu->pntsu; |