diff options
author | Ton Roosendaal <ton@blender.org> | 2004-09-14 23:03:11 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2004-09-14 23:03:11 +0400 |
commit | 37f57288cbcdb54770a8b01d74a323d62251fe9e (patch) | |
tree | 6f0316050cbc80fb66408d3dfb43705c273fd2ef /source/blender/src/editcurve.c | |
parent | 807339b4a7a0be25fbdc3de32e2c264f3f0b1e5a (diff) |
Lot of code... 2 new features:
1) Curve deform
http://www.blender3d.org/cms/Curve_Deform.392.0.html
Works simple as expected, but keep track of the rotation axis
in F7 buttons (Track X Y Z)
Only Mesh deform supported now.
Code changes:
- centralized deformation calls in curve_modifiers() mesh_modifiers()
etcetera. Here also other effects can be added like wave. Now the
evaluation order is fixed, but should become optional. It also doesnt
use the Displist anymore as deform-input. That latter part is unfinished
yet.
This code also is used for Hooks and will be needed for softbody
- made convention stricter that displists are being checked on in
drawobject(), this to prevent routines to make new displists recursively
(like armature does). Now a freedisplist() is sufficient to signal that
a new displaylist should be made.
2) Object Hooks
http://www.blender3d.org/cms/Object_Hooks.391.0.html
Support for Hooks is added to Mesh, Lattice, Curve and Surface objects.
For Armatures this would require some more work & research.
Main goal for this feature is to provide quick & simple access to the
underlying geometry in Objects on Object level, supporting hierarchies and
Ipos etc.
Diffstat (limited to 'source/blender/src/editcurve.c')
-rw-r--r-- | source/blender/src/editcurve.c | 63 |
1 files changed, 37 insertions, 26 deletions
diff --git a/source/blender/src/editcurve.c b/source/blender/src/editcurve.c index f6fc8500642..1b2c202ae55 100644 --- a/source/blender/src/editcurve.c +++ b/source/blender/src/editcurve.c @@ -450,6 +450,8 @@ void separate_nurb() G.obedit= 0; /* displists behave different in edit mode */ makeDispList(OBACT); /* this is the separated one */ + + curve_changes_other_objects(oldob); G.obedit= oldob; BASACT= oldbase; @@ -1053,6 +1055,8 @@ void switchdirectionNurb2(void) } makeDispList(G.obedit); + curve_changes_other_objects(G.obedit); + allqueue(REDRAWVIEW3D, 0); } @@ -1714,6 +1718,8 @@ void subdivideNurb() makeDispList(G.obedit); + curve_changes_other_objects(G.obedit); + countall(); allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWBUTSEDIT, 0); @@ -2298,7 +2304,10 @@ void merge_nurb() countall(); lastnu= NULL; + makeDispList(G.obedit); + curve_changes_other_objects(G.obedit); + allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWBUTSEDIT, 0); } @@ -2455,6 +2464,8 @@ void addsegment_nurb() lastnu= NULL; /* for selected */ makeDispList(G.obedit); + curve_changes_other_objects(G.obedit); + countall(); allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWBUTSEDIT, 0); @@ -2653,6 +2664,24 @@ void spinNurb(float *dvec, short mode) } } +void curve_changes_other_objects(Object *ob) +{ + Base *base= FIRSTBASE; + while(base) { + if(base->lay & G.vd->lay) { + if(base->object->parent==ob && base->object->partype==PARSKEL) + freedisplist(&base->object->disp); + + if(base->object->type==OB_CURVE) { + Curve *cu= base->object->data; + if(ob==cu->bevobj || ob==cu->taperobj) + makeDispList(base->object); + } + } + base= base->next; + } +} + void addvert_Nurb(int mode) { Nurb *nu; @@ -2787,17 +2816,7 @@ void addvert_Nurb(int mode) if(mode!='e') { /* dependencies with other objects, should become event */ - Base *base= FIRSTBASE; - while(base) { - if(base->lay & G.vd->lay) { - if(base->object->type==OB_CURVE) { - Curve *cu= base->object->data; - if(G.obedit==cu->bevobj || G.obedit==cu->taperobj) - makeDispList(base->object); - } - } - base= base->next; - } + curve_changes_other_objects(G.obedit); } } @@ -2941,6 +2960,8 @@ void makecyclicNurb() nu= nu->next; } makeDispList(G.obedit); + curve_changes_other_objects(G.obedit); + } void selectconnected_nurb() @@ -3325,6 +3346,8 @@ void delNurb() countall(); makeDispList(G.obedit); + curve_changes_other_objects(G.obedit); + allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWBUTSEDIT, 0); } @@ -3880,7 +3903,8 @@ void add_primitiveCurve(int stype) BLI_addtail(&editNurb, nu); makeDispList(G.obedit); - + curve_changes_other_objects(G.obedit); + countall(); allqueue(REDRAWALL, 0); } @@ -4061,7 +4085,6 @@ void undo_push_curve(char *name) /* 1= an undo, -1 is a redo. we have to make sure 'curundo' remains at previous step */ void undo_curve_step(int step) { - Base *base; UndoElem *uel, *next; /* prevent undo to happen on wrong object */ @@ -4108,19 +4131,7 @@ void undo_curve_step(int step) lastnu= NULL; /* for selected */ makeDispList(G.obedit); - - /* dependencies with other objects */ - base= FIRSTBASE; - while(base) { - if(base->lay & G.vd->lay) { - if(base->object->type==OB_CURVE) { - Curve *cu= base->object->data; - if(G.obedit==cu->bevobj || G.obedit==cu->taperobj) - makeDispList(base->object); - } - } - base= base->next; - } + curve_changes_other_objects(G.obedit); countall(); allqueue(REDRAWVIEW3D, 0); |