Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-01-04 11:00:16 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-01-04 11:00:16 +0300
commita735629fd17edd9c0919789dddabee71012fa6a5 (patch)
treedf1600cc3b5133df7ad4c202996a4d7f308a9652 /source
parentf71ff8639cecba62c0477790eea8159d6d75e3c5 (diff)
no need to define betz in editcurve.c, replace ob_get_key with inline check for anim filter code.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/animation/anim_filter.c18
-rw-r--r--source/blender/editors/curve/editcurve.c14
2 files changed, 6 insertions, 26 deletions
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c
index 2cbcc42efa3..791955dcfba 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -105,23 +105,7 @@ static Key *actedit_get_shapekeys (bAnimContext *ac)
//if (saction->pin) return NULL;
/* shapekey data is stored with geometry data */
- switch (ob->type) {
- case OB_MESH:
- key= ((Mesh *)ob->data)->key;
- break;
-
- case OB_LATTICE:
- key= ((Lattice *)ob->data)->key;
- break;
-
- case OB_CURVE:
- case OB_SURF:
- key= ((Curve *)ob->data)->key;
- break;
-
- default:
- return NULL;
- }
+ key= ob_get_key(ob);
if (key) {
if (key->type == KEY_RELATIVE)
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index 488ec71dde0..5dbff672db9 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -3928,7 +3928,6 @@ static int make_segment_exec(bContext *C, wmOperator *op)
Curve *cu= obedit->data;
ListBase *nubase= curve_get_editcurve(obedit);
Nurb *nu, *nu1=0, *nu2=0;
- BezTriple *bezt = NULL;
BPoint *bp;
float *fp, offset;
int a, ok= 0;
@@ -3960,12 +3959,10 @@ static int make_segment_exec(bContext *C, wmOperator *op)
for(nu= nubase->first; nu; nu= nu->next) {
if((nu->flagu & CU_NURB_CYCLIC)==0) { /* not cyclic */
if(nu->type == CU_BEZIER) {
- bezt= nu->bezt;
if(nu1==0) {
- if( BEZSELECTED_HIDDENHANDLES(cu, bezt) ) nu1= nu;
+ if( BEZSELECTED_HIDDENHANDLES(cu, nu->bezt) ) nu1= nu;
else {
- bezt= bezt+(nu->pntsu-1);
- if( BEZSELECTED_HIDDENHANDLES(cu, bezt) ) {
+ if( BEZSELECTED_HIDDENHANDLES(cu, &(nu->bezt[nu->pntsu-1])) ) {
nu1= nu;
switchdirectionNurb(nu);
keyData_switchDirectionNurb(cu, nu);
@@ -3973,14 +3970,13 @@ static int make_segment_exec(bContext *C, wmOperator *op)
}
}
else if(nu2==0) {
- if( BEZSELECTED_HIDDENHANDLES(cu, bezt) ) {
+ if( BEZSELECTED_HIDDENHANDLES(cu, nu->bezt) ) {
nu2= nu;
switchdirectionNurb(nu);
keyData_switchDirectionNurb(cu, nu);
}
else {
- bezt= bezt+(nu->pntsu-1);
- if( BEZSELECTED_HIDDENHANDLES(cu, bezt) ) {
+ if( BEZSELECTED_HIDDENHANDLES(cu, &(nu->bezt[nu->pntsu-1])) ) {
nu2= nu;
}
}
@@ -4021,7 +4017,7 @@ static int make_segment_exec(bContext *C, wmOperator *op)
if((nu1 && nu2) && (nu1!=nu2)) {
if( nu1->type==nu2->type) {
if(nu1->type == CU_BEZIER) {
- bezt =
+ BezTriple *bezt =
(BezTriple*)MEM_mallocN((nu1->pntsu+nu2->pntsu) * sizeof(BezTriple), "addsegmentN");
ED_curve_beztcpy(cu->editnurb, bezt, nu2->bezt, nu2->pntsu);
ED_curve_beztcpy(cu->editnurb, bezt+nu2->pntsu, nu1->bezt, nu1->pntsu);