[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12821] branches/pyapi_devel: merge from trunk
Campbell Barton
ideasman42 at gmail.com
Fri Dec 7 22:04:46 CET 2007
Revision: 12821
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12821
Author: campbellbarton
Date: 2007-12-07 22:04:45 +0100 (Fri, 07 Dec 2007)
Log Message:
-----------
merge from trunk
Modified Paths:
--------------
branches/pyapi_devel/release/scripts/wizard_curve2tree.py
branches/pyapi_devel/source/blender/blenkernel/intern/DerivedMesh.c
branches/pyapi_devel/source/blender/blenkernel/intern/action.c
branches/pyapi_devel/source/blender/blenloader/intern/readfile.c
branches/pyapi_devel/source/blender/src/buttons_shading.c
branches/pyapi_devel/source/blender/src/drawnla.c
branches/pyapi_devel/source/blender/src/drawtext.c
branches/pyapi_devel/source/blender/src/editnla.c
branches/pyapi_devel/source/blender/src/header_nla.c
branches/pyapi_devel/source/blender/src/interface.c
Modified: branches/pyapi_devel/release/scripts/wizard_curve2tree.py
===================================================================
--- branches/pyapi_devel/release/scripts/wizard_curve2tree.py 2007-12-07 19:48:53 UTC (rev 12820)
+++ branches/pyapi_devel/release/scripts/wizard_curve2tree.py 2007-12-07 21:04:45 UTC (rev 12821)
@@ -1416,7 +1416,18 @@
- def toMesh(self, mesh=None, do_uv=True, do_uv_keep_vproportion=True, do_uv_vnormalize=False, do_uv_uscale=False, uv_image = None, uv_x_scale=1.0, uv_y_scale=4.0, do_uv_blend_layer= False, do_cap_ends=False):
+ def toMesh(self, mesh=None,\
+ do_uv=True,\
+ do_uv_keep_vproportion=True,\
+ do_uv_vnormalize=False,\
+ do_uv_uscale=False,\
+ uv_image = None,\
+ uv_x_scale=1.0,\
+ uv_y_scale=4.0,\
+ do_uv_blend_layer= False,\
+ do_cap_ends=False,\
+ ):
+
self.mesh = freshMesh(mesh)
totverts = 0
@@ -1678,12 +1689,8 @@
uv.y *= vscale
-
# Done with UV mapping the first layer! now map the blend layers
if do_uv_blend_layer:
-
-
-
# Set up the blend UV layer - this is simply the blending for branch joints
mesh.addUVLayer( 'blend' )
mesh.activeUVLayer = 'blend'
@@ -3009,15 +3016,15 @@
new_brch.calcData()
return new_brch
-
+ '''
def toMesh(self):
pass
+ '''
-
# No GUI code above this! ------------------------------------------------------
# PREFS - These can be saved on the object's id property. use 'tree2curve' slot
@@ -3337,7 +3344,7 @@
ob_mesh.setMatrix(Matrix())
# Do we need a do_uv_blend_layer?
- if PREFS['material_stencil'].val and PREFS['material_texture'].val:
+ if PREFS['do_material'].val and PREFS['material_stencil'].val and PREFS['material_texture'].val:
do_uv_blend_layer = True
else:
do_uv_blend_layer = False
@@ -3854,7 +3861,7 @@
xtmp = x
PREFS['material_texture'] = Draw.Toggle('Texture', EVENT_UPDATE_AND_UI, xtmp, y, but_width*2, but_height, PREFS['material_texture'].val, 'Create an image texture for this material to use'); xtmp += but_width*2;
- PREFS['material_stencil'] = Draw.Toggle('Blend Joints', EVENT_UPDATE, xtmp, y, but_width*2, but_height, PREFS['material_stencil'].val, 'Use a second texture and UV layer to blend joints'); xtmp += but_width*2;
+ PREFS['material_stencil'] = Draw.Toggle('Blend Joints', EVENT_UPDATE, xtmp, y, but_width*2, but_height, PREFS['material_stencil'].val, 'Use a 2 more texture and UV layers to blend the seams between joints'); xtmp += but_width*2;
Blender.Draw.EndAlign()
y-=but_height+MARGIN
Modified: branches/pyapi_devel/source/blender/blenkernel/intern/DerivedMesh.c
===================================================================
--- branches/pyapi_devel/source/blender/blenkernel/intern/DerivedMesh.c 2007-12-07 19:48:53 UTC (rev 12820)
+++ branches/pyapi_devel/source/blender/blenkernel/intern/DerivedMesh.c 2007-12-07 21:04:45 UTC (rev 12821)
@@ -2031,8 +2031,6 @@
}
}
- if(md->type == eModifierType_ParticleSystem)
-
mti->deformVerts(md, ob, dm, deformedVerts, numVerts);
} else {
DerivedMesh *ndm;
Modified: branches/pyapi_devel/source/blender/blenkernel/intern/action.c
===================================================================
--- branches/pyapi_devel/source/blender/blenkernel/intern/action.c 2007-12-07 19:48:53 UTC (rev 12820)
+++ branches/pyapi_devel/source/blender/blenkernel/intern/action.c 2007-12-07 21:04:45 UTC (rev 12821)
@@ -443,7 +443,6 @@
length = repeat * scale * actlength;
/* invert = convert action-strip time to global time */
- // FIXME?
if (invert)
return length*(cframe - strip->actstart)/(repeat*actlength) + strip->start;
else
Modified: branches/pyapi_devel/source/blender/blenloader/intern/readfile.c
===================================================================
--- branches/pyapi_devel/source/blender/blenloader/intern/readfile.c 2007-12-07 19:48:53 UTC (rev 12820)
+++ branches/pyapi_devel/source/blender/blenloader/intern/readfile.c 2007-12-07 21:04:45 UTC (rev 12821)
@@ -7211,8 +7211,7 @@
if (length == 0.0f) length= 1.0f;
actlength = strip->actend-strip->actstart;
- // right calculation?
- strip->scale = actlength / (length * repeat);
+ strip->scale = length / (repeat * actlength);
if (strip->scale == 0.0f) strip->scale= 1.0f;
}
}
Modified: branches/pyapi_devel/source/blender/src/buttons_shading.c
===================================================================
--- branches/pyapi_devel/source/blender/src/buttons_shading.c 2007-12-07 19:48:53 UTC (rev 12820)
+++ branches/pyapi_devel/source/blender/src/buttons_shading.c 2007-12-07 21:04:45 UTC (rev 12821)
@@ -2233,20 +2233,20 @@
uiSetButLock(wrld->id.lib!=0, ERROR_LIBDATA_MESSAGE);
uiBlockSetCol(block, TH_AUTO);
+ uiBlockBeginAlign(block);
uiDefButF(block, COL, B_WORLDPRV, "", 10,150,145,19, &wrld->horr, 0, 0, 0, B_COLHOR, "");
- uiDefButF(block, COL, B_WORLDPRV, "", 160,150,145,19, &wrld->zenr, 0, 0, 0, B_COLZEN, "");
-
- uiBlockBeginAlign(block);
uiDefButF(block, NUMSLI,B_WORLDPRV,"HoR ", 10,130,145,19, &(wrld->horr), 0.0, 1.0, B_COLHOR,0, "Sets the amount of red color at the horizon");
uiDefButF(block, NUMSLI,B_WORLDPRV,"HoG ", 10,110,145,19, &(wrld->horg), 0.0, 1.0, B_COLHOR,0, "Sets the amount of green color at the horizon");
uiDefButF(block, NUMSLI,B_WORLDPRV,"HoB ", 10,90,145,19, &(wrld->horb), 0.0, 1.0, B_COLHOR,0, "Sets the amount of blue color at the horizon");
uiBlockBeginAlign(block);
+ uiDefButF(block, COL, B_WORLDPRV, "", 160,150,145,19, &wrld->zenr, 0, 0, 0, B_COLZEN, "");
uiDefButF(block, NUMSLI,B_WORLDPRV,"ZeR ", 160,130,145,19, &(wrld->zenr), 0.0, 1.0, B_COLZEN,0, "Sets the amount of red color at the zenith");
uiDefButF(block, NUMSLI,B_WORLDPRV,"ZeG ", 160,110,145,19, &(wrld->zeng), 0.0, 1.0, B_COLZEN,0, "Sets the amount of green color at the zenith");
uiDefButF(block, NUMSLI,B_WORLDPRV,"ZeB ", 160,90,145,19, &(wrld->zenb), 0.0, 1.0, B_COLZEN,0, "Sets the amount of blue color at the zenith");
uiBlockBeginAlign(block);
+ uiDefButF(block, COL, B_WORLDPRV, "", 10,70,145,19, &wrld->ambr, 0, 0, 0, 0, "");
uiDefButF(block, NUMSLI,B_WORLDPRV,"AmbR ", 10,50,145,19, &(wrld->ambr), 0.0, 1.0 ,0,0, "Sets the amount of red ambient color");
uiDefButF(block, NUMSLI,B_WORLDPRV,"AmbG ", 10,30,145,19, &(wrld->ambg), 0.0, 1.0 ,0,0, "Sets the amount of green ambient color");
uiDefButF(block, NUMSLI,B_WORLDPRV,"AmbB ", 10,10,145,19, &(wrld->ambb), 0.0, 1.0 ,0,0, "Sets the amount of blue ambient color");
Modified: branches/pyapi_devel/source/blender/src/drawnla.c
===================================================================
--- branches/pyapi_devel/source/blender/src/drawnla.c 2007-12-07 19:48:53 UTC (rev 12820)
+++ branches/pyapi_devel/source/blender/src/drawnla.c 2007-12-07 21:04:45 UTC (rev 12821)
@@ -639,7 +639,13 @@
uiBlockBeginAlign(block);
// FIXME: repeat and scale are too cramped!
uiDefButF(block, NUM, B_NLA_SCALE, "Repeat:", 160,100,75,19, &strip->repeat, 0.001, 1000.0f, 100, 0, "Number of times the action should repeat");
- uiDefButF(block, NUM, B_NLA_SCALE, "Scale:", 235,100,75,19, &strip->scale, 0.001, 10000.0f, 100, 0, "Amount the action should be scaled by");
+ if ((strip->actend - strip->actstart) < 1.0f) {
+ uiBlockSetCol(block, TH_REDALERT);
+ uiDefButF(block, NUM, B_NLA_SCALE, "Scale:", 235,100,75,19, &strip->scale, 0.001, 1000.0f, 100, 0, "Please run Alt-S to fix up this error");
+ uiBlockSetCol(block, TH_AUTO);
+ }
+ else
+ uiDefButF(block, NUM, B_NLA_SCALE, "Scale:", 235,100,75,19, &strip->scale, 0.001, 1000.0f, 100, 0, "Amount the action should be scaled by");
but= uiDefButC(block, TEX, B_NLA_PANEL, "OffsBone:", 160,80,150,19, strip->offs_bone, 0, 31.0f, 0, 0, "Name of Bone that defines offset for repeat");
uiButSetCompleteFunc(but, autocomplete_bone, (void *)ob);
uiDefButBitS(block, TOG, ACTSTRIP_HOLDLASTFRAME, B_NLA_PANEL, "Hold", 160,60,75,19, &strip->flag, 0, 0, 0, 0, "Toggles whether to continue displaying the last frame past the end of the strip");
Modified: branches/pyapi_devel/source/blender/src/drawtext.c
===================================================================
--- branches/pyapi_devel/source/blender/src/drawtext.c 2007-12-07 19:48:53 UTC (rev 12820)
+++ branches/pyapi_devel/source/blender/src/drawtext.c 2007-12-07 21:04:45 UTC (rev 12821)
@@ -725,25 +725,37 @@
static void calc_text_rcts(SpaceText *st)
{
- short barheight, barstart;
+ short barheight, barstart, blank_lines;
int lbarstart, lbarh, ltexth;
+ int pix_available, pix_top_margin, pix_bottom_margin;
lbarstart= st->top;
lbarh= st->viewlines;
- ltexth= txt_get_span(st->text->lines.first, st->text->lines.last) + st->viewlines / 2 + 2;
-
- barheight= (lbarh*(curarea->winy-4))/ltexth;
- if (barheight<20) barheight=20;
+ pix_top_margin = 8;
+ pix_bottom_margin = 4;
+ pix_available = curarea->winy - pix_top_margin - pix_bottom_margin;
+ ltexth= txt_get_span(st->text->lines.first, st->text->lines.last);
+ blank_lines = st->viewlines / 2;
- barstart= (lbarstart*(curarea->winy-4))/ltexth + 8;
+ if(ltexth + blank_lines < lbarstart + st->viewlines)
+ blank_lines = lbarstart + st->viewlines - ltexth;
+
+ ltexth += blank_lines;
+ barstart = (lbarstart*pix_available)/ltexth;
+ barheight = (lbarh*pix_available)/ltexth;
+ if (barheight<20){
+ barstart = ((pix_available + barheight - 20 )*lbarstart)/ltexth;
+ barheight=20;
+ }
+
st->txtbar.xmin= 5;
st->txtbar.xmax= 17;
- st->txtbar.ymax= curarea->winy - barstart;
+ st->txtbar.ymax= curarea->winy - pix_top_margin - barstart;
st->txtbar.ymin= st->txtbar.ymax - barheight;
- CLAMP(st->txtbar.ymin, 2, curarea->winy-2);
- CLAMP(st->txtbar.ymax, 2, curarea->winy-2);
+ CLAMP(st->txtbar.ymin, pix_bottom_margin, curarea->winy - pix_top_margin);
+ CLAMP(st->txtbar.ymax, pix_bottom_margin, curarea->winy - pix_top_margin);
st->pix_per_line= (float) ltexth/curarea->winy;
if (st->pix_per_line<.1) st->pix_per_line=.1f;
@@ -752,18 +764,18 @@
txt_get_span(st->text->lines.first, st->text->sell));
lbarh= abs(txt_get_span(st->text->lines.first, st->text->curl)-txt_get_span(st->text->lines.first, st->text->sell));
- barheight= (lbarh*(curarea->winy-4))/ltexth;
+ barheight= (lbarh*pix_available)/ltexth;
if (barheight<2) barheight=2;
- barstart= (lbarstart*(curarea->winy-4))/ltexth + 8;
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list