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
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2007-08-20 21:50:04 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2007-08-20 21:50:04 +0400
commit8a46c006d6b8c0ea567e8a79a729c9b15fe2a744 (patch)
tree194cd48ca34d67b91c08d8c7cf783627b8a08d92 /source/blender/src
parentb697f19cf82164e273562664c01bb9c0a97d0e9b (diff)
Add "View Selected" in the IPO editor
- Numpad dot is shortcut key, same as in other windows. (Peach feature request)
Diffstat (limited to 'source/blender/src')
-rw-r--r--source/blender/src/drawipo.c2
-rw-r--r--source/blender/src/editipo.c2
-rw-r--r--source/blender/src/editipo_lib.c33
-rw-r--r--source/blender/src/header_ipo.c12
-rw-r--r--source/blender/src/space.c4
5 files changed, 35 insertions, 18 deletions
diff --git a/source/blender/src/drawipo.c b/source/blender/src/drawipo.c
index 550e6717456..8d841956fd5 100644
--- a/source/blender/src/drawipo.c
+++ b/source/blender/src/drawipo.c
@@ -1654,7 +1654,7 @@ static void boundbox_ipo_curves(SpaceIpo *si)
if(ei->icu) {
if(ei->flag & IPO_VISIBLE) {
- boundbox_ipocurve(ei->icu);
+ boundbox_ipocurve(ei->icu, 0);
if(first) {
si->v2d.tot= ei->icu->totrct;
first= 0;
diff --git a/source/blender/src/editipo.c b/source/blender/src/editipo.c
index 08078c551f7..deb1af1efcb 100644
--- a/source/blender/src/editipo.c
+++ b/source/blender/src/editipo.c
@@ -248,7 +248,7 @@ void editipo_changed(SpaceIpo *si, int doredraw)
if(ei->flag & IPO_VISIBLE) {
- boundbox_ipocurve(ei->icu);
+ boundbox_ipocurve(ei->icu, 0);
sort_time_ipocurve(ei->icu);
if(first) {
si->v2d.tot= ei->icu->totrct;
diff --git a/source/blender/src/editipo_lib.c b/source/blender/src/editipo_lib.c
index 971d5365538..15840614d2a 100644
--- a/source/blender/src/editipo_lib.c
+++ b/source/blender/src/editipo_lib.c
@@ -287,7 +287,7 @@ char *getname_fluidsim_ei(int nr)
}
-void boundbox_ipocurve(IpoCurve *icu)
+void boundbox_ipocurve(IpoCurve *icu, int selectedonly)
{
BezTriple *bezt;
float vec[3]={0.0,0.0,0.0};
@@ -302,20 +302,25 @@ void boundbox_ipocurve(IpoCurve *icu)
bezt= icu->bezt;
while(a--) {
if(icu->vartype & IPO_BITS) {
- vec[0]= bezt->vec[1][0];
- vec[1]= 0.0;
- DO_MINMAX(vec, min, max);
-
- vec[1]= 16.0;
- DO_MINMAX(vec, min, max);
+ if((bezt->f2 & 1) || !selectedonly) {
+ vec[0]= bezt->vec[1][0];
+ vec[1]= 0.0;
+ DO_MINMAX(vec, min, max);
+
+ vec[1]= 16.0;
+ DO_MINMAX(vec, min, max);
+ }
}
else {
- if(icu->ipo==IPO_BEZ && a!=icu->totvert-1) {
- DO_MINMAX(bezt->vec[0], min, max);
+ if((bezt->f1 & 1) || !selectedonly) {
+ if(icu->ipo==IPO_BEZ && a!=icu->totvert-1)
+ DO_MINMAX(bezt->vec[0], min, max);
}
- DO_MINMAX(bezt->vec[1], min, max);
- if(icu->ipo==IPO_BEZ && a!=0) {
- DO_MINMAX(bezt->vec[2], min, max);
+ if((bezt->f2 & 1) || !selectedonly)
+ DO_MINMAX(bezt->vec[1], min, max);
+ if((bezt->f3 & 1) || !selectedonly) {
+ if(icu->ipo==IPO_BEZ && a!=0)
+ DO_MINMAX(bezt->vec[2], min, max);
}
}
@@ -337,7 +342,7 @@ void boundbox_ipocurve(IpoCurve *icu)
}
}
-void boundbox_ipo(Ipo *ipo, rctf *bb)
+void boundbox_ipo(Ipo *ipo, rctf *bb, int selectedonly)
{
IpoCurve *icu;
int first= 1;
@@ -345,7 +350,7 @@ void boundbox_ipo(Ipo *ipo, rctf *bb)
icu= ipo->curve.first;
while(icu) {
- boundbox_ipocurve(icu);
+ boundbox_ipocurve(icu, selectedonly);
if(first) {
*bb= icu->totrct;
diff --git a/source/blender/src/header_ipo.c b/source/blender/src/header_ipo.c
index c2bdaded838..a0b31fec3f2 100644
--- a/source/blender/src/header_ipo.c
+++ b/source/blender/src/header_ipo.c
@@ -713,6 +713,9 @@ static void do_ipo_viewmenu(void *arg, int event)
center_currframe();
scrarea_queue_winredraw(curarea);
break;
+ case 11:
+ do_ipo_buttons(B_IPOVIEWCENTER);
+ break;
}
}
@@ -748,7 +751,7 @@ static uiBlock *ipo_viewmenu(void *arg_unused)
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
+
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Center on Current Frame|Shift C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, "");
uiDefIconTextBut(block, BUTM, 1, (G.v2d->flag & V2D_VIEWLOCK)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT,
"Lock Time to Other Windows|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
@@ -757,6 +760,10 @@ static uiBlock *ipo_viewmenu(void *arg_unused)
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move Current Frame to Selected|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
}
+ uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
+
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View Selected|NumPad .", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
if(!curarea->full) uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0,20, "");
else uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 20, "");
@@ -951,6 +958,7 @@ void do_ipo_buttons(short event)
if(curarea->win==0) return;
switch(event) {
+ case B_IPOVIEWCENTER:
case B_IPOHOME:
/* boundbox */
@@ -969,7 +977,7 @@ void do_ipo_buttons(short event)
for(a=0; a<G.sipo->totipo; a++, ei++) {
if ISPOIN(ei, flag & IPO_VISIBLE, icu) {
- boundbox_ipocurve(ei->icu);
+ boundbox_ipocurve(ei->icu, (event==B_IPOVIEWCENTER));
if(first) {
v2d->tot= ei->icu->totrct;
diff --git a/source/blender/src/space.c b/source/blender/src/space.c
index 484dc929389..e69ed9bf70f 100644
--- a/source/blender/src/space.c
+++ b/source/blender/src/space.c
@@ -2739,6 +2739,10 @@ static void winqreadipospace(ScrArea *sa, void *spacedata, BWinEvent *evt)
if((G.qual==0))
do_ipo_buttons(B_IPOHOME);
break;
+ case PADPERIOD:
+ if((G.qual==0))
+ do_ipo_buttons(B_IPOVIEWCENTER);
+ break;
case AKEY:
if (G.qual & LR_CTRLKEY) {