diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index b2769e13ab0..25c23b8480b 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -2071,6 +2071,20 @@ void make_cfra_list(Ipo *ipo, ListBase *elems) icu= icu->next; } } + else { + for(icu= ipo->curve.first; icu; icu= icu->next) { + if(icu->flag & IPO_VISIBLE) { + bezt= icu->bezt; + if(bezt) { + a= icu->totvert; + while(a--) { + add_to_cfra_elem(elems, bezt); + bezt++; + } + } + } + } + } if(ipo->showkey==0) { /* deselect all keys */ diff --git a/source/blender/src/buttons_object.c b/source/blender/src/buttons_object.c index 9ff41d8ccb2..1b618f05d18 100644 --- a/source/blender/src/buttons_object.c +++ b/source/blender/src/buttons_object.c @@ -1644,18 +1644,18 @@ static void object_softbodies(Object *ob) } MEM_freeN (menustr); - uiDefButF(block, NUM, B_DIFF, "GSpring:", 10,80,150,20, &sb->goalspring, 0.0, 0.999, 10, 0, "Goal (vertex target position) Spring Constant"); - uiDefButF(block, NUM, B_DIFF, "GFrict:", 160,80,150,20, &sb->goalfrict , 0.0, 10.0, 10, 0, "Goal (vertex target position) Friction Constant"); - uiDefButF(block, NUM, B_SOFTBODY_CHANGE, "GMin:", 10,60,150,20, &sb->mingoal, 0.0, 1.0, 10, 0, "Min Goal bound"); - uiDefButF(block, NUM, B_SOFTBODY_CHANGE, "GMax:", 160,60,150,20, &sb->maxgoal, 0.0, 1.0, 10, 0, "Max Goal bound"); + uiDefButF(block, NUM, B_DIFF, "G Stiff:", 10,80,150,20, &sb->goalspring, 0.0, 0.999, 10, 0, "Goal (vertex target position) spring stiffness"); + uiDefButF(block, NUM, B_DIFF, "G Damp:", 160,80,150,20, &sb->goalfrict , 0.0, 10.0, 10, 0, "Goal (vertex target position) friction"); + uiDefButF(block, NUM, B_SOFTBODY_CHANGE, "G Min:", 10,60,150,20, &sb->mingoal, 0.0, 1.0, 10, 0, "Min Goal bound"); + uiDefButF(block, NUM, B_SOFTBODY_CHANGE, "G Max:", 160,60,150,20, &sb->maxgoal, 0.0, 1.0, 10, 0, "Max Goal bound"); uiBlockEndAlign(block); /* EDGE SPRING STUFF */ uiBlockBeginAlign(block); uiDefButBitS(block, TOG, OB_SB_EDGES, B_SOFTBODY_CHANGE, "Use Edges", 10,30,150,20, &ob->softflag, 0, 0, 0, 0, "Use Robust 2nd order solver"); uiDefButBitS(block, TOG, OB_SB_QUADS, B_SOFTBODY_CHANGE, "Stiff Quads", 160,30,150,20, &ob->softflag, 0, 0, 0, 0, "Sets object to have diagonal springs on 4-gons"); - uiDefButF(block, NUM, B_DIFF, "ESpring:", 10,10,150,20, &sb->inspring, 0.0, 0.999, 10, 0, "Edge Spring Constant"); - uiDefButF(block, NUM, B_DIFF, "EFrict:", 160,10,150,20, &sb->infrict, 0.0, 10.0, 10, 0, "Edge Friction Constant"); + uiDefButF(block, NUM, B_DIFF, "E Stiff:", 10,10,150,20, &sb->inspring, 0.0, 0.999, 10, 0, "Edge spring stiffness"); + uiDefButF(block, NUM, B_DIFF, "E Damp:", 160,10,150,20, &sb->infrict, 0.0, 10.0, 10, 0, "Edge friction"); uiBlockEndAlign(block); } } diff --git a/source/blender/src/drawtime.c b/source/blender/src/drawtime.c index a77df6243a4..a624f46b5c8 100644 --- a/source/blender/src/drawtime.c +++ b/source/blender/src/drawtime.c @@ -43,12 +43,14 @@ #include "DNA_action_types.h" #include "DNA_ipo_types.h" #include "DNA_object_types.h" +#include "DNA_material_types.h" #include "DNA_scene_types.h" #include "DNA_space_types.h" #include "DNA_screen_types.h" #include "BKE_ipo.h" #include "BKE_object.h" +#include "BKE_material.h" #include "BKE_utildefines.h" #include "BKE_global.h" @@ -200,7 +202,8 @@ static void draw_ob_keys() Object *ob; bActionChannel *achan; bAction *act; - int ipoflag; + ListBase elems; + int a; char col[3]; if (OBACT) { @@ -210,27 +213,14 @@ static void draw_ob_keys() if(ob!=G.obedit) { if(ob->ipo) { /* convert the ipo to a list of 'current frame elements' */ - ListBase elems; elems.first= elems.last= NULL; make_cfra_list(ob->ipo, &elems); - /* disable time offset for the purposes of drawing the frame ticks */ - ipoflag= ob->ipoflag; - ob->ipoflag &= ~OB_OFFS_OB; - - set_no_parent_ipo(1); - disable_speed_curve(1); - /* draw the list of current frame elements */ col[0] = 0xDD; col[1] = 0xD7; col[2] = 0x00; draw_key_list(elems, col); - set_no_parent_ipo(0); - disable_speed_curve(0); - - ob->ipoflag= ipoflag; - BLI_freelistN(&elems); } @@ -240,7 +230,6 @@ static void draw_ob_keys() /* go through each channel in the action */ for (achan=act->chanbase.first; achan; achan=achan->next){ /* convert the ipo to a list of 'current frame elements' */ - ListBase elems; elems.first= elems.last= NULL; make_cfra_list(achan->ipo, &elems); @@ -251,6 +240,21 @@ static void draw_ob_keys() BLI_freelistN(&elems); } } + + for(a=0; atotcol; a++) { + Material *ma= give_current_material(ob, a+1); + + if(ma && ma->ipo) { + elems.first= elems.last= NULL; + make_cfra_list(ma->ipo, &elems); + + col[0] = 0xDD; col[1] = 0xA7; col[2] = 0x00; + draw_key_list(elems, col); + + BLI_freelistN(&elems); + } + } + } } } diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c index c81c347b282..dadb1c2acf5 100644 --- a/source/blender/src/drawview.c +++ b/source/blender/src/drawview.c @@ -110,12 +110,13 @@ #include "BDR_editobject.h" #include "BDR_vpaint.h" -#include "BSE_view.h" #include "BSE_drawview.h" +#include "BSE_filesel.h" #include "BSE_headerbuttons.h" #include "BSE_seqaudio.h" -#include "BSE_filesel.h" #include "BSE_trans_types.h" +#include "BSE_time.h" +#include "BSE_view.h" #include "RE_renderconverter.h" @@ -2389,12 +2390,10 @@ int play_anim(int mode) while(TRUE) { - inner_play_anim_loop(0, 0); - - screen_swapbuffers(); - while(qtest()) { - + + /* we test events first because of MKEY event */ + event= extern_qread(&val); if(event==ESCKEY) break; else if(event==MIDDLEMOUSE) { @@ -2409,8 +2408,14 @@ int play_anim(int mode) else viewmove(0); } } + else if(event==MKEY) { + if(val) add_timeline_marker(CFRA-1); + } } - if(event==ESCKEY || event==SPACEKEY) break; + if(ELEM3(event, ESCKEY, SPACEKEY, RIGHTMOUSE)) break; + + inner_play_anim_loop(0, 0); + screen_swapbuffers(); if((mode > 1) && CFRA==EFRA) break; /* no replay */ } diff --git a/source/blender/src/edittime.c b/source/blender/src/edittime.c index 165ea53480b..4becd3de710 100644 --- a/source/blender/src/edittime.c +++ b/source/blender/src/edittime.c @@ -48,6 +48,7 @@ #include "DNA_action_types.h" #include "DNA_ipo_types.h" #include "DNA_object_types.h" +#include "DNA_material_types.h" #include "DNA_space_types.h" #include "DNA_screen_types.h" #include "DNA_scene_types.h" @@ -57,6 +58,7 @@ #include "BKE_utildefines.h" #include "BKE_global.h" #include "BKE_main.h" +#include "BKE_material.h" #include "BKE_library.h" #include "BIF_space.h" @@ -221,15 +223,38 @@ static int float_to_frame(float frame) return to; } +static float find_closest_cfra_elem(ListBase elems, int dir, float closest) +{ + CfraElem *ce; + + for(ce= elems.first; ce; ce= ce->next) { + if (dir==-1) { + if( float_to_frame(ce->cfra)cfra > closest) || (closest == CFRA)) { + closest= ce->cfra; + } + } + } + else { + if(float_to_frame(ce->cfra)>CFRA) { + if ((ce->cfra < closest) || (closest == CFRA)) { + closest= ce->cfra; + } + } + } + } + return closest; +} + void nextprev_timeline_key(short dir) { /*mostly copied from drawobject.c, draw_object() AND editipo.c, movekey_obipo() */ Object *ob; bActionChannel *achan; bAction *act; - CfraElem *ce; + ListBase elems; + float closest= CFRA; int a; - float toframe= CFRA; if (OBACT) { ob = OBACT; @@ -238,37 +263,12 @@ void nextprev_timeline_key(short dir) if(ob!=G.obedit) { if(ob->ipo) { /* convert the ipo to a list of 'current frame elements' */ - ListBase elems; - elems.first= elems.last= 0; + elems.first= elems.last= NULL; make_cfra_list(ob->ipo, &elems); - /* disable time offset for the purposes of drawing the frame ticks */ - /* ipoflag= ob->ipoflag; - ob->ipoflag &= ~OB_OFFS_OB; + closest= find_closest_cfra_elem(elems, dir, closest); - set_no_parent_ipo(1); - disable_speed_curve(1); */ - - /* go through the list and decide if we can find a new keyframe to visit */ - if(elems.first) { - ce= elems.first; - if (dir==-1) { - while (ce && float_to_frame(ce->cfra)cfra; - ce= ce->next; - } - } else { - while (ce && float_to_frame(ce->cfra)<=CFRA) { - ce= ce->next; - } - if (ce) toframe= ce->cfra; - } - } - /*set_no_parent_ipo(0); - disable_speed_curve(0); - - ob->ipoflag= ipoflag; */ BLI_freelistN(&elems); } @@ -277,38 +277,31 @@ void nextprev_timeline_key(short dir) /* go through each channel in the action */ for (achan=act->chanbase.first; achan; achan=achan->next){ /* convert the ipo to a list of 'current frame elements' */ - ListBase elems; - elems.first= elems.last= 0; + elems.first= elems.last= NULL; make_cfra_list(achan->ipo, &elems); - /* go through the list and decide if we can find a new keyframe to visit */ - if(elems.first) { - ce= elems.first; - if (dir==-1) { - while (ce && float_to_frame(ce->cfra)cfra > toframe) || (toframe == CFRA)) { - toframe= ce->cfra; - } - ce= ce->next; - } - } else { - while (ce && float_to_frame(ce->cfra)<=CFRA) { - ce= ce->next; - } - if (ce) { - if ((ce->cfra < toframe) || (toframe == CFRA)) - toframe= ce->cfra; - } - } - } + closest= find_closest_cfra_elem(elems, dir, closest); + + BLI_freelistN(&elems); + } + } + + for(a=0; atotcol; a++) { + Material *ma= give_current_material(ob, a+1); + if(ma && ma->ipo) { + elems.first= elems.last= NULL; + make_cfra_list(ma->ipo, &elems); + + closest= find_closest_cfra_elem(elems, dir, closest); + BLI_freelistN(&elems); } } } } - a= float_to_frame(toframe); + a= float_to_frame(closest); if (a!=CFRA) { CFRA= a; diff --git a/source/blender/src/editview.c b/source/blender/src/editview.c index 519152f89c5..18e05ed13f8 100644 --- a/source/blender/src/editview.c +++ b/source/blender/src/editview.c @@ -1170,6 +1170,7 @@ void mouse_select(void) allqueue(REDRAWBUTSOBJECT, 0); allqueue(REDRAWACTION, 0); allqueue(REDRAWNLA, 0); + allqueue(REDRAWTIME, 0); allqueue(REDRAWHEADERS, 0); /* To force display update for the posebutton */ }