Orange: Another issue with Armature layers; in NLA, the strips with a
authorTon Roosendaal <ton@blender.org>
Tue, 3 Jan 2006 22:09:25 +0000 (22:09 +0000)
committerTon Roosendaal <ton@blender.org>
Tue, 3 Jan 2006 22:09:25 +0000 (22:09 +0000)
locked length should not skip hidden channels.

source/blender/blenkernel/BKE_action.h
source/blender/blenkernel/intern/action.c
source/blender/src/drawaction.c
source/blender/src/drawarmature.c
source/blender/src/editaction.c
source/blender/src/editnla.c
source/blender/src/header_action.c

index 0189b7a2826fe60818b7cf56468416d27e85f128..9abd73d7befcb4fece1361bde86eef6161cedd61 100644 (file)
@@ -111,7 +111,7 @@ struct bAction *copy_action(struct bAction *src);
 /**
  * Some kind of bounding box operation on the action.
  */
-void calc_action_range(const struct bAction *act, float *start, float *end);
+void calc_action_range(const struct bAction *act, float *start, float *end, int incl_hidden);
 
 /**
  * Set the pose channels from the given action.
index 1aaf4c6f2c1ee3bba1376830f5e6fd66ce9db8fe..50ce4495f9ccc68306198bc5e63a83569957bc75 100644 (file)
@@ -427,7 +427,7 @@ void blend_poses(bPose *dst, bPose *src, float srcweight, short mode)
 }
 
 
-void calc_action_range(const bAction *act, float *start, float *end)
+void calc_action_range(const bAction *act, float *start, float *end, int incl_hidden)
 {
        const bActionChannel *chan;
        const bConstraintChannel *conchan;
@@ -437,7 +437,7 @@ void calc_action_range(const bAction *act, float *start, float *end)
 
        if(act) {
                for (chan=act->chanbase.first; chan; chan=chan->next) {
-                       if((chan->flag & ACHAN_HIDDEN)==0) {
+                       if(incl_hidden || (chan->flag & ACHAN_HIDDEN)==0) {
                                if(chan->ipo) {
                                        for (icu=chan->ipo->curve.first; icu; icu=icu->next) {
                                                if(icu->totvert) {
index 3fa263ffb89a3d0c12b004f545e769f0f3b34b69..0a4f52b617484bf68b9ec5e8e60fed455e41a3f9 100644 (file)
@@ -412,7 +412,7 @@ static void draw_channel_strips(SpaceAction *saction)
                map_active_strip(di, OBACT, 0);
        
        /* start and end of action itself */
-       calc_action_range(act, &sta, &end);
+       calc_action_range(act, &sta, &end, 0);
        gla2DDrawTranslatePt(di, sta, 0.0f, &act_start, &dummy);
        gla2DDrawTranslatePt(di, end, 0.0f, &act_end, &dummy);
        
index 74201b5813584f82829323a1167f608eaebeba80..c2eeae3c148f4315ab5703b3966e0d5751772a38 100644 (file)
@@ -1783,7 +1783,7 @@ static void draw_ghost_poses(Base *base)
        if(ob->action==NULL)
                return;
 
-       calc_action_range(ob->action, &start, &end);
+       calc_action_range(ob->action, &start, &end, 0);
        if(start==end)
                return;
 
index 30df91bd09232aab03d5b3cf9b90841bdeecb0a4..a54e887728a88b52d1e5087d0ff570adbf3235f2 100644 (file)
@@ -170,7 +170,7 @@ bAction* bake_action_with_client (bAction *act, Object *armob, float tolerance)
        sprintf (newname, "%s.BAKED", act->id.name+2);
        rename_id(&result->id, newname);
 
-       calc_action_range(act, &actstart, &actend);
+       calc_action_range(act, &actstart, &actend, 1);
 
        oldframe = G.scene->r.cfra;
 
index c4b7d8c97776b20e75a33729a07c2b87dc5bafc3..3a2a1d0d21c6c2ce054591f945cf3d7666795154 100644 (file)
@@ -184,7 +184,7 @@ void synchronize_action_strips(void)
                        if (strip->flag & ACTSTRIP_LOCK_ACTION) {
                                float actstart, actend;
                                
-                               calc_action_range(strip->act, &actstart, &actend);
+                               calc_action_range(strip->act, &actstart, &actend, 1);
                                
                                if(strip->actstart!=actstart || strip->actend!=actend) {
                                        float mapping= (strip->end - strip->start)/(strip->actend - strip->actstart);
@@ -210,7 +210,7 @@ void reset_action_strips(int val)
                for (strip = base->object->nlastrips.last; strip; strip=strip->prev) {
                        if (strip->flag & ACTSTRIP_SELECT) {
                                if(val==2) {
-                                       calc_action_range(strip->act, &strip->actstart, &strip->actend);
+                                       calc_action_range(strip->act, &strip->actstart, &strip->actend, 1);
                                }
                                else if(val==1) {
                                        float mapping= (strip->actend - strip->actstart)/(strip->end - strip->start);
@@ -352,7 +352,7 @@ static void convert_nla(short mval[2])
                        /* Link the action to the nstrip */
                        nstrip->act = base->object->action;
                        id_us_plus(&nstrip->act->id);
-                       calc_action_range(nstrip->act, &nstrip->actstart, &nstrip->actend);
+                       calc_action_range(nstrip->act, &nstrip->actstart, &nstrip->actend, 1);
                        nstrip->start = nstrip->actstart;
                        nstrip->end = nstrip->actend;
                        nstrip->flag = ACTSTRIP_SELECT|ACTSTRIP_LOCK_ACTION;
@@ -403,7 +403,7 @@ static void add_nla_block(short event)
        /* Link the action to the strip */
        strip->act = act;
        id_us_plus(&act->id);
-       calc_action_range(strip->act, &strip->actstart, &strip->actend);
+       calc_action_range(strip->act, &strip->actstart, &strip->actend, 1);
        strip->start = G.scene->r.cfra;         /* could be mval[0] another time... */
        strip->end = strip->start + (strip->actend-strip->actstart);
                /* simple prevention of zero strips */
@@ -1818,7 +1818,7 @@ static void add_nla_block_by_name(char name[32], Object *ob, short hold, short a
        
        /* Link the action to the strip */
        strip->act = act;
-       calc_action_range(strip->act, &strip->actstart, &strip->actend);
+       calc_action_range(strip->act, &strip->actstart, &strip->actend, 1);
        strip->start = G.scene->r.cfra;         /* could be mval[0] another time... */
        strip->end = strip->start + (strip->actend-strip->actstart);
                /* simple prevention of zero strips */
index 765f6de9820e23e86a590e61b6dc1495fa69c506..e6b4442bdd561334e5826856d90fbb4fc2fff2e7 100644 (file)
@@ -150,7 +150,7 @@ void do_action_buttons(unsigned short event)
                        else {
                                float extra;
                                
-                               calc_action_range(G.saction->action, &G.v2d->cur.xmin, &G.v2d->cur.xmax);
+                               calc_action_range(G.saction->action, &G.v2d->cur.xmin, &G.v2d->cur.xmax, 0);
                                if(G.saction->pin==0 && ob) {
                                        G.v2d->cur.xmin= get_action_frame_inv(ob, G.v2d->cur.xmin);
                                        G.v2d->cur.xmax= get_action_frame_inv(ob, G.v2d->cur.xmax);