Revision: 17905
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17905
Author: aligorith
Date: 2008-12-17 11:25:02 +0100 (Wed, 17 Dec 2008)
Log Message:
-----------
View2D: Cleanup of presets and fixed errors in various views
Now, preset view configurations are only to be used if they define all
(scrollers not included) relevant settings for the view they are set for. This
should be less confusing than in the previous situation with
V2D_COMMONVIEW_TIMELINE stuff.
One implication of this though, is that all Animation Editors (for example),
will have to define their own version of the relatively commonly shared info.
However, given the great diversity in the range of settings each have, this
should not be too much of an issue.
Also, added a 'standard' view config for main 'window' regions. At this stage,
it is recommended that this view config should be used only as a placeholder
template on which a set of custom settings could be based. I've put it into use
for the buttons window/scripts window/info window so far.
Modified Paths:
--------------
branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c
branches/blender2.5/blender/source/blender/editors/include/UI_view2d.h
branches/blender2.5/blender/source/blender/editors/interface/view2d.c
branches/blender2.5/blender/source/blender/editors/space_action/space_action.c
branches/blender2.5/blender/source/blender/editors/space_buttons/space_buttons.c
branches/blender2.5/blender/source/blender/editors/space_file/space_file.c
branches/blender2.5/blender/source/blender/editors/space_image/space_image.c
branches/blender2.5/blender/source/blender/editors/space_info/space_info.c
branches/blender2.5/blender/source/blender/editors/space_ipo/space_ipo.c
branches/blender2.5/blender/source/blender/editors/space_nla/space_nla.c
branches/blender2.5/blender/source/blender/editors/space_node/space_node.c
branches/blender2.5/blender/source/blender/editors/space_script/space_script.c
branches/blender2.5/blender/source/blender/editors/space_sequencer/space_sequencer.c
branches/blender2.5/blender/source/blender/editors/space_sound/space_sound.c
branches/blender2.5/blender/source/blender/editors/space_text/space_text.c
branches/blender2.5/blender/source/blender/editors/space_time/space_time.c
Property Changed:
----------------
branches/blender2.5/blender/
Property changes on: branches/blender2.5/blender
___________________________________________________________________
Name: svn:ignore
- user-config.py
.*
build
install
+ user-config.py
.*
build
install
mingw-user-config.py
msvc-user-config.py
sgc.bat
smc.bat
ssenv.bat
user-config.py
Modified:
branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c
2008-12-17 09:11:16 UTC (rev 17904)
+++ branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c
2008-12-17 10:25:02 UTC (rev 17905)
@@ -5196,7 +5196,6 @@
SpaceButs *sbuts= (SpaceButs *)sl;
memcpy(&ar->v2d, &sbuts->v2d, sizeof(View2D));
ar->v2d.keepzoom |= V2D_KEEPASPECT;
- ar->v2d.flag |= V2D_IS_INITIALISED;
break;
}
//case SPACE_XXX: // FIXME... add other ones
Modified: branches/blender2.5/blender/source/blender/editors/include/UI_view2d.h
===================================================================
--- branches/blender2.5/blender/source/blender/editors/include/UI_view2d.h
2008-12-17 09:11:16 UTC (rev 17904)
+++ branches/blender2.5/blender/source/blender/editors/include/UI_view2d.h
2008-12-17 10:25:02 UTC (rev 17905)
@@ -40,18 +40,20 @@
/* generic value to use when coordinate lies out of view when converting */
#define V2D_IS_CLIPPED 12000
-/* common View2D view types */
+/* Common View2D view types
+ * NOTE: only define a type here if it completely sets all (+/- a few) of the
relevant flags
+ * and settings for a View2D region, and that set of settings is used
in more
+ * than one specific place
+ */
enum {
/* custom view type (region has defined all necessary flags
already) */
- V2D_COMMONVIEW_CUSTOM = 0,
- /* view canvas ('standard' view, view limits/restrictions still
need to be set first!) */
- V2D_COMMONVIEW_VIEWCANVAS,
+ V2D_COMMONVIEW_CUSTOM = -1,
+ /* standard (only use this when setting up a new view, as a
sensible base for most settings) */
+ V2D_COMMONVIEW_STANDARD,
/* listview (i.e. Outliner) */
V2D_COMMONVIEW_LIST,
/* headers (this is basically the same as listview, but no
y-panning) */
V2D_COMMONVIEW_HEADER,
- /* timegrid (this sets the settings for x/horizontal, but
y/vertical settings still need to be set first!) */
- V2D_COMMONVIEW_TIMELINE,
} eView2D_CommonViewTypes;
/* ---- Defines for Scroller/Grid Arguments ----- */
Modified: branches/blender2.5/blender/source/blender/editors/interface/view2d.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/interface/view2d.c
2008-12-17 09:11:16 UTC (rev 17904)
+++ branches/blender2.5/blender/source/blender/editors/interface/view2d.c
2008-12-17 10:25:02 UTC (rev 17905)
@@ -68,6 +68,88 @@
{
short tot_changed= 0;
+ /* initialise data if there is a need for such */
+ if ((v2d->flag & V2D_IS_INITIALISED) == 0) {
+ /* set initialised flag so that View2D doesn't get
reinitialised next time again */
+ v2d->flag |= V2D_IS_INITIALISED;
+
+ /* see eView2D_CommonViewTypes in UI_view2d.h for available
view presets */
+ switch (type) {
+ /* 'standard view' - optimum setup for 'standard' view
behaviour, that should be used new views as basis for their
+ * own unique View2D settings, which should be
used instead of this in most cases...
+ */
+ case V2D_COMMONVIEW_STANDARD:
+ {
+ /* for now, aspect ratio should be maintained,
and zoom is clamped within sane default limits */
+ v2d->keepzoom= (V2D_KEEPASPECT|V2D_KEEPZOOM);
+ v2d->minzoom= 0.01f;
+ v2d->maxzoom= 1000.0f;
+
+ /* tot rect and cur should be same size, and
aligned using 'standard' OpenGL coordinates for now
+ * - region can resize 'tot' later to fit
other data
+ * - keeptot is only within bounds, as
strict locking is not that critical
+ * - view is aligned for (0,0) -> (winx-1,
winy-1) setup
+ */
+ v2d->align=
(V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_NEG_Y);
+ v2d->keeptot= V2D_KEEPTOT_BOUNDS;
+
+ v2d->tot.xmin= v2d->tot.ymin= 0.0f;
+ v2d->tot.xmax= (float)(winx - 1);
+ v2d->tot.ymax= (float)(winy - 1);
+
+ v2d->cur= v2d->tot;
+
+ /* scrollers - should we have these by default?
*/
+ // XXX for now, we don't override this, or set
it either!
+ }
+ break;
+
+ /* 'list/channel view' - zoom, aspect ratio, and
alignment restrictions are set here */
+ case V2D_COMMONVIEW_LIST:
+ {
+ /* zoom + aspect ratio are locked */
+ v2d->keepzoom =
(V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_KEEPZOOM|V2D_KEEPASPECT);
+ v2d->minzoom= v2d->maxzoom= 1.0f;
+
+ /* tot rect has strictly regulated placement,
and must only occur in +/- quadrant */
+ v2d->align =
(V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_POS_Y);
+ v2d->keeptot = V2D_KEEPTOT_STRICT;
+ tot_changed= 1;
+
+ /* scroller settings are currently not set
here... that is left for regions... */
+ }
+ break;
+
+ /* 'header' regions - zoom, aspect ratio, alignment,
and panning restrictions are set here */
+ case V2D_COMMONVIEW_HEADER:
+ {
+ /* zoom + aspect ratio are locked */
+ v2d->keepzoom =
(V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_KEEPZOOM|V2D_KEEPASPECT);
+ v2d->minzoom= v2d->maxzoom= 1.0f;
+ v2d->min[0]= v2d->max[0]= winx;
+ v2d->min[1]= v2d->max[1]= winy;
+
+ /* tot rect has strictly regulated placement,
and must only occur in +/+ quadrant */
+ v2d->align =
(V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_NEG_Y);
+ v2d->keeptot = V2D_KEEPTOT_STRICT;
+ tot_changed= 1;
+
+ /* panning in y-axis is prohibited */
+ v2d->keepofs= V2D_LOCKOFS_Y;
+
+ /* absolutely no scrollers allowed */
+ v2d->scroll= 0;
+ }
+ break;
+
+ /* other view types are completely defined using their
own settings already */
+ default:
+ /* we don't do anything here, as settings
should be fine, but just make sure that rect */
+ break;
+ }
+ }
+
+
/* store view size */
v2d->winx= winx;
v2d->winy= winy;
@@ -124,91 +206,6 @@
}
}
- /* initialise data if there is a need for such */
- if ((v2d->flag & V2D_IS_INITIALISED) == 0) {
- v2d->flag |= V2D_IS_INITIALISED;
-
- /* see eView2D_CommonViewTypes in UI_view2d.h for available
view presets */
- switch (type) {
- /* 'standard view' - from (0,0) to (winx,winy), with
other restrictions defined by region already */
- case V2D_COMMONVIEW_VIEWCANVAS:
- {
- /* just set 'tot' rect alignment restictions
for now */
- v2d->align=
V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_NEG_Y;
- tot_changed= 1;
-
- // XXX... should we set min/max here too?
probably not essential yet
- }
- break;
-
- /* 'list/channel view' - zoom, aspect ratio, and
alignment restrictions are set here */
- case V2D_COMMONVIEW_LIST:
- {
- /* zoom + aspect ratio are locked */
- v2d->keepzoom =
(V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_KEEPZOOM|V2D_KEEPASPECT);
- v2d->minzoom= v2d->maxzoom= 1.0f;
-
- /* tot rect has strictly regulated placement,
and must only occur in +/- quadrant */
- v2d->align =
(V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_POS_Y);
- v2d->keeptot = V2D_KEEPTOT_STRICT;
- tot_changed= 1;
-
- /* scroller settings are currently not set
here... that is left for regions... */
- }
- break;
-
- /* 'header' regions - zoom, aspect ratio, alignment,
and panning restrictions are set here */
- case V2D_COMMONVIEW_HEADER:
- {
- /* zoom + aspect ratio are locked */
- v2d->keepzoom =
(V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_KEEPZOOM|V2D_KEEPASPECT);
- v2d->minzoom= v2d->maxzoom= 1.0f;
- v2d->min[0]= v2d->max[0]= winx;
- v2d->min[1]= v2d->max[1]= winy;
-
- /* tot rect has strictly regulated placement,
and must only occur in +/+ quadrant */
- v2d->align =
(V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_NEG_Y);
- v2d->keeptot = V2D_KEEPTOT_STRICT;
- tot_changed= 1;
-
- /* panning in y-axis is prohibited */
- v2d->keepofs= V2D_LOCKOFS_Y;
-
- /* absolutely no scrollers allowed */
- v2d->scroll= 0;
- }
- break;
-
- /* 'timeline/animeditors' - only set x-axis settings (y
axis settings have already been set by regions, so don't overwrite! */
- case V2D_COMMONVIEW_TIMELINE:
- {
- /* zoom on x-axis is free, but zoom factors are
usually standard */
- v2d->minzoom= 0.5f;
- v2d->maxzoom= 10.0f;
-
- /* size limits on x-axis are also standard */
- v2d->min[0]= 0.0f; // XXX... would 1.0f be
better?
- v2d->max[0]= MAXFRAMEF;
-
- /* scrollers for x-axis must be shown, and with
scales */
- v2d->scroll |=
(V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL);
-
- /* 'tot' rect x-axis size */
- v2d->tot.xmin= (float)(SFRA - 10);
- v2d->tot.xmax= (float)(EFRA + 10);
- v2d->cur.xmin= v2d->mask.xmin;
- v2d->cur.xmax= v2d->mask.xmax;
- tot_changed= 0; // er..
- }
- break;
-
- /* other view types are completely defined using their
own settings already */
- default:
- /* we don't do anything here, as settings
should be fine, but just make sure that rect */
- break;
- }
- }
-
/* set 'tot' rect before setting cur? */
if (tot_changed)
UI_view2d_totRect_set(v2d, winx, winy);
Modified:
branches/blender2.5/blender/source/blender/editors/space_action/space_action.c
===================================================================
---
branches/blender2.5/blender/source/blender/editors/space_action/space_action.c
2008-12-17 09:11:16 UTC (rev 17904)
+++
branches/blender2.5/blender/source/blender/editors/space_action/space_action.c
2008-12-17 10:25:02 UTC (rev 17905)
@@ -91,13 +91,23 @@
ar->v2d.tot.xmax= 1000.0f;
ar->v2d.tot.ymax= 0.0f;
- ar->v2d.min[1]= 0.0f;
- ar->v2d.max[1]= 1000.0f;
+ ar->v2d.cur.xmin= -5.0f;
+ ar->v2d.cur.ymin= -75.0f;
+ ar->v2d.cur.xmax= 65.0f;
+ ar->v2d.cur.ymax= 5.0f;
- ar->v2d.scroll = V2D_SCROLL_RIGHT;
+ ar->v2d.min[0]= 0.0f;
+ ar->v2d.min[1]= 0.0f;
- ar->v2d.align= saction->v2d.align= V2D_ALIGN_NO_POS_Y;
- ar->v2d.keepzoom= saction->v2d.keepzoom= V2D_LOCKZOOM_Y;
+ ar->v2d.max[0]= MAXFRAMEF;
+ ar->v2d.max[1]= 1000.0f;
+
+ ar->v2d.minzoom= 0.01f;
+ ar->v2d.maxzoom= 50;
+ ar->v2d.scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL);
+ ar->v2d.scroll |= (V2D_SCROLL_RIGHT);
+ ar->v2d.keepzoom= V2D_LOCKZOOM_Y;
+ ar->v2d.align= V2D_ALIGN_NO_POS_X;
/* channel list region XXX */
ar= MEM_callocN(sizeof(ARegion), "area region from do_versions");
@@ -139,7 +149,7 @@
@@ Diff output truncated at 10240 characters. @@
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs