[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11344] branches/2-44-stable/blender: branches/2-44-stable
Diego Borghetti (Plumiferos)
bdiego at gmail.com
Mon Jul 23 05:53:34 CEST 2007
Revision: 11344
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11344
Author: bdiego
Date: 2007-07-23 05:53:33 +0200 (Mon, 23 Jul 2007)
Log Message:
-----------
branches/2-44-stable
Merge from trunk:
revision 11339 (BugFix #6946)
revision 11340 (BugFix #6875)
revision 11343 (Rendering bugfix)
Revision Links:
--------------
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11339
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11340
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11343
Modified Paths:
--------------
branches/2-44-stable/blender/release/scripts/uv_export.py
branches/2-44-stable/blender/source/blender/render/intern/source/shadeoutput.c
branches/2-44-stable/blender/source/blender/src/transform.c
Modified: branches/2-44-stable/blender/release/scripts/uv_export.py
===================================================================
--- branches/2-44-stable/blender/release/scripts/uv_export.py 2007-07-23 02:28:47 UTC (rev 11343)
+++ branches/2-44-stable/blender/release/scripts/uv_export.py 2007-07-23 03:53:33 UTC (rev 11344)
@@ -9,7 +9,7 @@
__author__ = "Martin 'theeth' Poirier"
__url__ = ("http://www.blender.org", "http://blenderartists.org/")
-__version__ = "2.4"
+__version__ = "2.5"
__bpydoc__ = """\
This script exports the UV face layout of the selected mesh object to
@@ -96,6 +96,11 @@
# Version 2.4
# Port from NMesh to Mesh by Daniel Salazar (zanqdo)
# --------------------------
+# Version 2.5
+# Fixed some old off by one rasterizing errors (didn't render points at 1.0 in the UV scale properly).
+# Fixed wire drawing for non 1 wire size (didn't wrap or stretch properly
+# and would often raise exceptions)
+# --------------------------
FullPython = False
@@ -322,7 +327,7 @@
step = 0
- img = Buffer(size+1,size+1)
+ img = Buffer(size,size)
if wrap:
wrapSize = size
@@ -333,15 +338,16 @@
for f in vList:
for v in f:
x = int(v[0] * size)
- maxx = max (x, maxx)
- minx = min (x, minx)
+ maxx = max (x + wsize - 1, maxx)
+ minx = min (x - wsize + 1, minx)
y = int(v[1] * size)
- maxy = max (y, maxy)
- miny = min (y, miny)
+ maxy = max (y + wsize - 1, maxy)
+ miny = min (y - wsize + 1, miny)
wrapSize = max (maxx - minx + 1, maxy - miny + 1)
scale = float (size) / float (wrapSize)
+ max_index = size - 1 # max index of the buffer (height or width)
fnum = 0
fcnt = len (vList)
@@ -361,31 +367,31 @@
if step:
try:
for t in xrange(step):
- x = int(floor((co1[0] + t*(co2[0]-co1[0])/step) * size))
- y = int(floor((co1[1] + t*(co2[1]-co1[1])/step) * size))
+ x = int(floor((co1[0] + t*(co2[0]-co1[0])/step) * max_index))
+ y = int(floor((co1[1] + t*(co2[1]-co1[1])/step) * max_index))
- if wrap:
- x = x % wrapSize
- y = y % wrapSize
- else:
- x = int ((x - minx) * scale)
- y = int ((y - miny) * scale)
-
- co = x * 1 + y * 1 * size;
-
- img[co] = 0
- if wsize > 1:
- for x in range(-1*wsize + 1,wsize):
- for y in range(-1*wsize,wsize):
- img[co + 1 * x + y * 1 * size] = 0
+ for dx in range(-1*wsize + 1, wsize):
+ if wrap:
+ wx = (x + dx) % wrapSize
+ else:
+ wx = int ((x - minx + dx) * scale)
+
+ for dy in range(-1*wsize + 1, wsize):
+ if wrap:
+ wy = (y + dy) % wrapSize
+ else:
+ wy = int ((y - miny + dy) * scale)
+
+ co = wx * 1 + wy * 1 * size
+ img[co] = 0
except OverflowError:
if not extreme_warning:
print "Skipping extremely long UV edges, check your layout for excentric values"
extreme_warning = True
for v in f:
- x = int(v[0] * size)
- y = int(v[1] * size)
+ x = int(v[0] * max_index)
+ y = int(v[1] * max_index)
if wrap:
x = x % wrapSize
Modified: branches/2-44-stable/blender/source/blender/render/intern/source/shadeoutput.c
===================================================================
--- branches/2-44-stable/blender/source/blender/render/intern/source/shadeoutput.c 2007-07-23 02:28:47 UTC (rev 11343)
+++ branches/2-44-stable/blender/source/blender/render/intern/source/shadeoutput.c 2007-07-23 03:53:33 UTC (rev 11344)
@@ -1235,7 +1235,7 @@
/* shadow and spec, (visifac==0 outside spot) */
if(visifac> 0.0f) {
- if(i>0.0f && (R.r.mode & R_SHADOW)) {
+ if((R.r.mode & R_SHADOW)) {
if(ma->mode & MA_SHADOW) {
if(lar->shb || (lar->mode & LA_SHAD_RAY)) {
@@ -1259,7 +1259,7 @@
}
}
- /* in case 'no diffuse' we still do most calculus, spec can be in shadow */
+ /* in case 'no diffuse' we still do most calculus, spec can be in shadow.*/
if(!(lar->mode & LA_NO_DIFF)) {
if(i>0.0f) {
if(ma->mode & MA_SHADOW_TRA)
Modified: branches/2-44-stable/blender/source/blender/src/transform.c
===================================================================
--- branches/2-44-stable/blender/source/blender/src/transform.c 2007-07-23 02:28:47 UTC (rev 11343)
+++ branches/2-44-stable/blender/source/blender/src/transform.c 2007-07-23 03:53:33 UTC (rev 11344)
@@ -1506,7 +1506,7 @@
if (td->ext) {
float fsize[3];
- if (t->flag & (T_OBJECT|T_TEXTURE)) {
+ if (t->flag & (T_OBJECT|T_TEXTURE|T_POSE)) {
float obsizemat[3][3];
// Reorient the size mat to fit the oriented object.
Mat3MulMat3(obsizemat, tmat, td->axismtx);
@@ -1520,7 +1520,7 @@
protectedSizeBits(td->protectflag, fsize);
- if ((t->flag & T_V3D_ALIGN)==0) { // align mode doesn't rotate objects itself
+ if ((t->flag & T_V3D_ALIGN)==0) { // align mode doesn't resize objects itself
/* handle ipokeys? */
if(td->tdi) {
TransDataIpokey *tdi= td->tdi;
@@ -1726,6 +1726,7 @@
VecAddf(td->loc, t->center, vec);
}
+
recalcData(t);
More information about the Bf-blender-cvs
mailing list