[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [46095] trunk/blender/release/scripts/ startup/bl_operators/uvcalc_lightmap.py: fix [#31181] Lightmap UV unwrap still broken
Campbell Barton
ideasman42 at gmail.com
Mon Apr 30 07:45:02 CEST 2012
Revision: 46095
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=46095
Author: campbellbarton
Date: 2012-04-30 05:45:01 +0000 (Mon, 30 Apr 2012)
Log Message:
-----------
fix [#31181] Lightmap UV unwrap still broken
raised python error with triangles.
Modified Paths:
--------------
trunk/blender/release/scripts/startup/bl_operators/uvcalc_lightmap.py
Modified: trunk/blender/release/scripts/startup/bl_operators/uvcalc_lightmap.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_operators/uvcalc_lightmap.py 2012-04-29 23:34:17 UTC (rev 46094)
+++ trunk/blender/release/scripts/startup/bl_operators/uvcalc_lightmap.py 2012-04-30 05:45:01 UTC (rev 46095)
@@ -157,18 +157,17 @@
angles_co.sort()
I = [i for a, i in angles_co]
- #~ fuv = f.uv
uv_layer = f.id_data.uv_layers.active.data
- fuv = [uv_layer[i].uv for i in f.loops] # XXX25
+ fuv = [uv_layer[i].uv for i in f.loop_indices]
if self.rot:
- fuv[I[2]] = p1
- fuv[I[1]] = p2
- fuv[I[0]] = p3
+ fuv[I[2]][:] = p1
+ fuv[I[1]][:] = p2
+ fuv[I[0]][:] = p3
else:
- fuv[I[2]] = p1
- fuv[I[0]] = p2
- fuv[I[1]] = p3
+ fuv[I[2]][:] = p1
+ fuv[I[0]][:] = p2
+ fuv[I[1]][:] = p3
f, lens, lensord = uv[0]
@@ -179,10 +178,10 @@
set_uv(f, (x2, y2), (x2, y1 + margin_h), (x1 + margin_w, y2))
else: # 1 QUAD
- uv[1][0], uv[1][1] = x1, y1
- uv[2][0], uv[2][1] = x1, y2
- uv[3][0], uv[3][1] = x2, y2
- uv[0][0], uv[0][1] = x2, y1
+ uv[1][:] = x1, y1
+ uv[2][:] = x1, y2
+ uv[3][:] = x2, y2
+ uv[0][:] = x2, y1
def __hash__(self):
# None unique hash
More information about the Bf-blender-cvs
mailing list