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:
authorTon Roosendaal <ton@blender.org>2005-10-10 21:42:48 +0400
committerTon Roosendaal <ton@blender.org>2005-10-10 21:42:48 +0400
commit87365d8d407d5cfddcfa48f1dc3902f7f1a3fa5b (patch)
treea43ae94a544511409f44b9d08e828a6eedfcf123 /source/blender/src/drawipo.c
parentad915277a0d7be10889cf8d00ce392b4800ca0d5 (diff)
Stage two of the giant animation recode project; Ipo/Action/NLA cleanup
-> Note; added 2 new c files (split editipo.c). MSVC needs upgrade. Impatient people can check the goodies in CMS: http://www.blender3d.org/cms/Action_and_NLA_editor.706.0.html Most work was on trying to unwind the spaghetti for editing ipos. Too much history and bad design got added here. Most evident changes: - made generic 'context' for detecting which Ipo is being edited, or to assign ipos or to retrieve ipo curves. - made generic insertkey() for all ipo types, including actions - shuffled a lot of code around to make things more logical. Also made sure local functions are not exported It is far from ready... when action/nla was added in Blender, a lot of duplicate code was generated. That's for another time. Now the goodies; - made Actions to allow any Ipo type - made NLA to define active actions, for Action window too - corrected timing for active action, so it shows the 'real time', as defined in NLA editor. I did update python code, but that would require testing. Testing is needed for this commit in general, too many changes happened on all levels of the animation system. :) Will keep track of all reports this evening, hopefully it doesnt break the pre-release schedule!
Diffstat (limited to 'source/blender/src/drawipo.c')
-rw-r--r--source/blender/src/drawipo.c55
1 files changed, 42 insertions, 13 deletions
diff --git a/source/blender/src/drawipo.c b/source/blender/src/drawipo.c
index f4e416e4fb5..f7870fda239 100644
--- a/source/blender/src/drawipo.c
+++ b/source/blender/src/drawipo.c
@@ -92,14 +92,15 @@
#define ISPOIN4(a, b, c, d, e) ( (a->b) && (a->c) && (a->d) && (a->e) )
#define IPOBUTX 65
-#define IPOSTEP 35 /* minimum pixels per gridstep */
+ /* minimum pixels per gridstep */
+#define IPOSTEP 35
static float ipogrid_dx, ipogrid_dy, ipogrid_startx, ipogrid_starty;
static int ipomachtx, ipomachty;
-static int vertymin, vertymax, horxmin, horxmax; /* globals om LEFTMOUSE op scrollbar te testen */
+static int vertymin, vertymax, horxmin, horxmax; /* globals to test LEFTMOUSE for scrollbar */
-extern short ACTWIDTH;
+extern short ACTWIDTH; /* this is ugly! */
static void scroll_prstr(float x, float y, float val, char dir, int disptype)
{
@@ -313,7 +314,7 @@ void draw_ipogrid(void)
glRectf(0.0, 0.0, 100.0, 1.0);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
}
- else if(ELEM(G.sipo->blocktype, ID_CU, IPO_CO)) {
+ else if(ELEM(G.sipo->blocktype, ID_CU, ID_CO)) {
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
glRectf(0.0, 1.0, G.v2d->cur.xmax, 1.0);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
@@ -594,12 +595,16 @@ void calc_scrollrcts(ScrArea *sa, View2D *v2d, int winx, int winy)
v2d->mask.ymax= winy;
if(sa->spacetype==SPACE_ACTION) {
- v2d->mask.xmin+= ACTWIDTH;
- v2d->hor.xmin+=ACTWIDTH;
+ if(sa->winx > ACTWIDTH+50) {
+ v2d->mask.xmin+= ACTWIDTH;
+ v2d->hor.xmin+=ACTWIDTH;
+ }
}
else if(sa->spacetype==SPACE_NLA){
- v2d->mask.xmin+= NLAWIDTH;
- v2d->hor.xmin+=NLAWIDTH;
+ if(sa->winx > NLAWIDTH+50) {
+ v2d->mask.xmin+= NLAWIDTH;
+ v2d->hor.xmin+=NLAWIDTH;
+ }
}
else if(sa->spacetype==SPACE_IPO) {
v2d->mask.xmax-= IPOBUTX;
@@ -1688,7 +1693,7 @@ void do_ipobuts(unsigned short event)
ei= get_active_editipo();
if(ei) {
if(ei->icu==NULL) {
- ei->icu= get_ipocurve(G.sipo->from, G.sipo->blocktype, ei->adrcode, NULL);
+ ei->icu= verify_ipocurve(G.sipo->from, G.sipo->blocktype, G.sipo->actname, G.sipo->constname, ei->adrcode);
ei->flag |= IPO_SELECT;
ei->icu->flag= ei->flag;
}
@@ -2040,6 +2045,8 @@ int view2dzoom(unsigned short event)
areawinset(curarea->win); /* from buttons */
curarea->head_swap= 0;
getmouseco_areawin(mvalo);
+ mval[0]= mvalo[0];
+ mval[1]= mvalo[1];
while( (get_mbut()&(L_MOUSE|M_MOUSE)) || (event==WHEELUPMOUSE) || (event==WHEELDOWNMOUSE) ) {
@@ -2130,11 +2137,23 @@ int view2dzoom(unsigned short event)
mvalo[1]= mval[1];
}
- G.v2d->cur.xmin+= dx;
- G.v2d->cur.xmax-= dx;
-
- if ELEM5(curarea->spacetype, SPACE_SEQ, SPACE_SOUND, SPACE_ACTION, SPACE_NLA, SPACE_TIME);
+ if( ELEM(curarea->spacetype, SPACE_NLA, SPACE_ACTION) ) {
+ if(mvalo[0] < G.v2d->mask.xmin) {
+ G.v2d->cur.ymin+= dy;
+ G.v2d->cur.ymax-= dy;
+ }
+ else {
+ G.v2d->cur.xmin+= dx;
+ G.v2d->cur.xmax-= dx;
+ }
+ }
+ else if (ELEM3(curarea->spacetype, SPACE_SEQ, SPACE_SOUND, SPACE_TIME)) {
+ G.v2d->cur.xmin+= dx;
+ G.v2d->cur.xmax-= dx;
+ }
else {
+ G.v2d->cur.xmin+= dx;
+ G.v2d->cur.xmax-= dx;
G.v2d->cur.ymin+= dy;
G.v2d->cur.ymax-= dy;
}
@@ -2214,10 +2233,20 @@ int view2dmove(unsigned short event)
if ELEM7(curarea->spacetype, SPACE_IPO, SPACE_SEQ, SPACE_OOPS, SPACE_SOUND, SPACE_ACTION, SPACE_NLA, SPACE_TIME)
{
+
if( BLI_in_rcti(&G.v2d->mask, (int)mvalo[0], (int)mvalo[1]) ) {
facx= (G.v2d->cur.xmax-G.v2d->cur.xmin)/(float)(G.v2d->mask.xmax-G.v2d->mask.xmin);
facy= (G.v2d->cur.ymax-G.v2d->cur.ymin)/(float)(G.v2d->mask.ymax-G.v2d->mask.ymin);
}
+ /* stoopid exception to allow scroll in lefthand side */
+ else if(curarea->spacetype==SPACE_ACTION && BLI_in_rcti(&G.v2d->mask, ACTWIDTH+(int)mvalo[0], (int)mvalo[1]) ) {
+ facx= 0.0f;
+ facy= (G.v2d->cur.ymax-G.v2d->cur.ymin)/(float)(G.v2d->mask.ymax-G.v2d->mask.ymin);
+ }
+ else if(curarea->spacetype==SPACE_NLA && BLI_in_rcti(&G.v2d->mask, NLAWIDTH+(int)mvalo[0], (int)mvalo[1]) ) {
+ facx= 0.0f;
+ facy= (G.v2d->cur.ymax-G.v2d->cur.ymin)/(float)(G.v2d->mask.ymax-G.v2d->mask.ymin);
+ }
else if(IN_2D_VERT_SCROLL((int)mvalo)) {
facy= -(G.v2d->tot.ymax-G.v2d->tot.ymin)/(float)(G.v2d->mask.ymax-G.v2d->mask.ymin);
if(get_mbut() & mousebut) {