[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11746] trunk/blender/source/blender:
Brecht Van Lommel
brechtvanlommel at pandora.be
Mon Aug 20 19:50:04 CEST 2007
Revision: 11746
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11746
Author: blendix
Date: 2007-08-20 19:50:04 +0200 (Mon, 20 Aug 2007)
Log Message:
-----------
Add "View Selected" in the IPO editor
- Numpad dot is shortcut key, same as in other windows.
(Peach feature request)
Modified Paths:
--------------
trunk/blender/source/blender/include/BSE_editipo.h
trunk/blender/source/blender/include/blendef.h
trunk/blender/source/blender/src/drawipo.c
trunk/blender/source/blender/src/editipo.c
trunk/blender/source/blender/src/editipo_lib.c
trunk/blender/source/blender/src/header_ipo.c
trunk/blender/source/blender/src/space.c
Modified: trunk/blender/source/blender/include/BSE_editipo.h
===================================================================
--- trunk/blender/source/blender/include/BSE_editipo.h 2007-08-20 16:26:53 UTC (rev 11745)
+++ trunk/blender/source/blender/include/BSE_editipo.h 2007-08-20 17:50:04 UTC (rev 11746)
@@ -65,8 +65,8 @@
struct EditIpo *get_active_editipo(void);
-void boundbox_ipocurve(struct IpoCurve *icu);
-void boundbox_ipo(struct Ipo *ipo, struct rctf *bb);
+void boundbox_ipocurve(struct IpoCurve *icu, int selectedonly);
+void boundbox_ipo(struct Ipo *ipo, struct rctf *bb, int selectedonly);
void editipo_changed(struct SpaceIpo *si, int doredraw);
void scale_editipo(void);
Modified: trunk/blender/source/blender/include/blendef.h
===================================================================
--- trunk/blender/source/blender/include/blendef.h 2007-08-20 16:26:53 UTC (rev 11745)
+++ trunk/blender/source/blender/include/blendef.h 2007-08-20 17:50:04 UTC (rev 11746)
@@ -246,6 +246,7 @@
#define B_IPOPIN 212
#define B_IPO_ACTION_OB 213
#define B_IPO_ACTION_KEY 214
+#define B_IPOVIEWCENTER 215
/* OOPS: 250 */
Modified: trunk/blender/source/blender/src/drawipo.c
===================================================================
--- trunk/blender/source/blender/src/drawipo.c 2007-08-20 16:26:53 UTC (rev 11745)
+++ trunk/blender/source/blender/src/drawipo.c 2007-08-20 17:50:04 UTC (rev 11746)
@@ -1654,7 +1654,7 @@
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;
Modified: trunk/blender/source/blender/src/editipo.c
===================================================================
--- trunk/blender/source/blender/src/editipo.c 2007-08-20 16:26:53 UTC (rev 11745)
+++ trunk/blender/source/blender/src/editipo.c 2007-08-20 17:50:04 UTC (rev 11746)
@@ -248,7 +248,7 @@
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;
Modified: trunk/blender/source/blender/src/editipo_lib.c
===================================================================
--- trunk/blender/source/blender/src/editipo_lib.c 2007-08-20 16:26:53 UTC (rev 11745)
+++ trunk/blender/source/blender/src/editipo_lib.c 2007-08-20 17:50:04 UTC (rev 11746)
@@ -287,7 +287,7 @@
}
-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 @@
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_ipo(Ipo *ipo, rctf *bb)
+void boundbox_ipo(Ipo *ipo, rctf *bb, int selectedonly)
{
IpoCurve *icu;
int first= 1;
@@ -345,7 +350,7 @@
icu= ipo->curve.first;
while(icu) {
- boundbox_ipocurve(icu);
+ boundbox_ipocurve(icu, selectedonly);
if(first) {
*bb= icu->totrct;
Modified: trunk/blender/source/blender/src/header_ipo.c
===================================================================
--- trunk/blender/source/blender/src/header_ipo.c 2007-08-20 16:26:53 UTC (rev 11745)
+++ trunk/blender/source/blender/src/header_ipo.c 2007-08-20 17:50:04 UTC (rev 11746)
@@ -713,6 +713,9 @@
center_currframe();
scrarea_queue_winredraw(curarea);
break;
+ case 11:
+ do_ipo_buttons(B_IPOVIEWCENTER);
+ break;
}
}
@@ -748,7 +751,7 @@
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 @@
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 @@
if(curarea->win==0) return;
switch(event) {
+ case B_IPOVIEWCENTER:
case B_IPOHOME:
/* boundbox */
@@ -969,7 +977,7 @@
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;
Modified: trunk/blender/source/blender/src/space.c
===================================================================
--- trunk/blender/source/blender/src/space.c 2007-08-20 16:26:53 UTC (rev 11745)
+++ trunk/blender/source/blender/src/space.c 2007-08-20 17:50:04 UTC (rev 11746)
@@ -2739,6 +2739,10 @@
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) {
More information about the Bf-blender-cvs
mailing list