[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [22991] branches/blender2.5/blender/source /blender/editors: 2.5 - Patches + Cleanups
Joshua Leung
aligorith at gmail.com
Fri Sep 4 13:19:12 CEST 2009
Revision: 22991
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=22991
Author: aligorith
Date: 2009-09-04 13:19:12 +0200 (Fri, 04 Sep 2009)
Log Message:
-----------
2.5 - Patches + Cleanups
* Some of the patches in patch #19034 - by Wolfgang W. (bender)
- outliner.patch - a small fix to make the outliner draw the last
line of the list, if the list is bigger than the window.
- scroll.patch - enables vertical scrolling in the buttons window in horizontal mode. Necessary if a panel is opened that
is higher than the buttons window.
* Also, fixed some messy comments in drivers code
Modified Paths:
--------------
branches/blender2.5/blender/source/blender/editors/animation/drivers.c
branches/blender2.5/blender/source/blender/editors/screen/area.c
branches/blender2.5/blender/source/blender/editors/space_outliner/outliner.c
Modified: branches/blender2.5/blender/source/blender/editors/animation/drivers.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/animation/drivers.c 2009-09-04 10:41:02 UTC (rev 22990)
+++ branches/blender2.5/blender/source/blender/editors/animation/drivers.c 2009-09-04 11:19:12 UTC (rev 22991)
@@ -151,33 +151,33 @@
/* create F-Curve with Driver */
fcu= verify_driver_fcurve(id, rna_path, array_index, 1);
- if(fcu && fcu->driver) {
+ if (fcu && fcu->driver) {
fcu->driver->type= type;
-
+
/* fill in current value for python */
- if(type == DRIVER_TYPE_PYTHON) {
+ if (type == DRIVER_TYPE_PYTHON) {
PropertyType proptype= RNA_property_type(prop);
int array= RNA_property_array_length(&ptr, prop);
char *expression= fcu->driver->expression;
int val, maxlen= sizeof(fcu->driver->expression);
float fval;
-
- if(proptype == PROP_BOOLEAN) {
+
+ if (proptype == PROP_BOOLEAN) {
if(!array) val= RNA_property_boolean_get(&ptr, prop);
else val= RNA_property_boolean_get_index(&ptr, prop, array_index);
-
+
BLI_strncpy(expression, (val)? "True": "False", maxlen);
}
- else if(proptype == PROP_INT) {
- if(!array) val= RNA_property_int_get(&ptr, prop);
+ else if (proptype == PROP_INT) {
+ if (!array) val= RNA_property_int_get(&ptr, prop);
else val= RNA_property_int_get_index(&ptr, prop, array_index);
-
+
BLI_snprintf(expression, maxlen, "%d", val);
}
- else if(proptype == PROP_FLOAT) {
- if(!array) fval= RNA_property_float_get(&ptr, prop);
+ else if (proptype == PROP_FLOAT) {
+ if (!array) fval= RNA_property_float_get(&ptr, prop);
else fval= RNA_property_float_get_index(&ptr, prop, array_index);
-
+
BLI_snprintf(expression, maxlen, "%.3f", fval);
}
@@ -232,7 +232,7 @@
short success= 0;
int a, index, length, all= RNA_boolean_get(op->ptr, "all");
- /* try to insert keyframe using property retrieved from UI */
+ /* try to create driver using property retrieved from UI */
memset(&ptr, 0, sizeof(PointerRNA));
uiAnimContextProperty(C, &ptr, &prop, &index);
@@ -294,7 +294,7 @@
short success= 0;
int a, index, length, all= RNA_boolean_get(op->ptr, "all");
- /* try to insert keyframe using property retrieved from UI */
+ /* try to find driver using property retrieved from UI */
memset(&ptr, 0, sizeof(PointerRNA));
uiAnimContextProperty(C, &ptr, &prop, &index);
Modified: branches/blender2.5/blender/source/blender/editors/screen/area.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/screen/area.c 2009-09-04 10:41:02 UTC (rev 22990)
+++ branches/blender2.5/blender/source/blender/editors/screen/area.c 2009-09-04 11:19:12 UTC (rev 22991)
@@ -1248,6 +1248,7 @@
/* before setting the view */
if(vertical) {
+ /* only allow scrolling in vertical direction */
v2d->keepofs |= V2D_LOCKOFS_X|V2D_KEEPOFS_Y;
v2d->keepofs &= ~(V2D_LOCKOFS_Y|V2D_KEEPOFS_X);
@@ -1258,8 +1259,12 @@
y= -y;
}
else {
- v2d->keepofs |= V2D_LOCKOFS_Y|V2D_KEEPOFS_X;
- v2d->keepofs &= ~(V2D_LOCKOFS_X|V2D_KEEPOFS_Y);
+ /* for now, allow scrolling in both directions (since layouts are optimised for vertical,
+ * they often don't fit in horizontal layout)
+ */
+ v2d->keepofs &= ~(V2D_LOCKOFS_X|V2D_LOCKOFS_Y|V2D_KEEPOFS_X|V2D_KEEPOFS_Y);
+ //v2d->keepofs |= V2D_LOCKOFS_Y|V2D_KEEPOFS_X;
+ //v2d->keepofs &= ~(V2D_LOCKOFS_X|V2D_KEEPOFS_Y);
// don't jump back when panels close or hide
if(!newcontext)
Modified: branches/blender2.5/blender/source/blender/editors/space_outliner/outliner.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_outliner/outliner.c 2009-09-04 10:41:02 UTC (rev 22990)
+++ branches/blender2.5/blender/source/blender/editors/space_outliner/outliner.c 2009-09-04 11:19:12 UTC (rev 22991)
@@ -5288,6 +5288,9 @@
sizex += OL_TOGW*3;
}
+ /* tweak to display last line (when list bigger than window) */
+ sizey += V2D_SCROLL_HEIGHT;
+
/* update size of tot-rect (extents of data/viewable area) */
UI_view2d_totRect_set(v2d, sizex, sizey);
More information about the Bf-blender-cvs
mailing list