Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2009-04-25 21:52:04 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-04-25 21:52:04 +0400
commitdd21e9b62691daab1464dda0a0ab44d107480dec (patch)
treea554ec2f44c85fa231bce82fb4460127957932e5
parent113b438dce15061d57539ab694e30e115bb1418e (diff)
patch from michael williamson, export multiple UV layers to lightwave
[#18575] remove unused local variables
-rw-r--r--release/scripts/lightwave_export.py37
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_distance.c1
2 files changed, 21 insertions, 17 deletions
diff --git a/release/scripts/lightwave_export.py b/release/scripts/lightwave_export.py
index 9235af12f7e..115761ec3e0 100644
--- a/release/scripts/lightwave_export.py
+++ b/release/scripts/lightwave_export.py
@@ -351,23 +351,28 @@ def generate_vmad_vc(mesh):
# === Generate Per-Face UV Coords (VMAD Chunk) ===
# ================================================
def generate_vmad_uv(mesh):
- data = cStringIO.StringIO()
- data.write("TXUV") # type
- data.write(struct.pack(">H", 2)) # dimension
- data.write(generate_nstring("Blender's UV Coordinates")) # name
+ layers = mesh.getUVLayerNames()
+ org_uv = mesh.activeUVLayer
+ for l in layers:
+ mesh.activeUVLayer = l
+ data = cStringIO.StringIO()
+ data.write("TXUV") # type
+ data.write(struct.pack(">H", 2)) # dimension
+ data.write(generate_nstring(l)) # name
+ for i, f in enumerate(mesh.faces):
+ if not i%100:
+ Blender.Window.DrawProgressBar(float(i)/len(mesh.faces), "Writing UV Coordinates")
+
+ uv = f.uv
+ f_v = f.v
+ for j in xrange(len(f)-1, -1, -1): # Reverse order
+ U,V = uv[j]
+ v = f_v[j].index
+ data.write(struct.pack(">H", v)) # vertex index
+ data.write(struct.pack(">H", i)) # face index
+ data.write(struct.pack(">ff", U, V))
- for i, f in enumerate(mesh.faces):
- if not i%100:
- Blender.Window.DrawProgressBar(float(i)/len(mesh.faces), "Writing UV Coordinates")
-
- uv = f.uv
- f_v = f.v
- for j in xrange(len(f)-1, -1, -1): # Reverse order
- U,V = uv[j]
- v = f_v[j].index
- data.write(struct.pack(">H", v)) # vertex index
- data.write(struct.pack(">H", i)) # face index
- data.write(struct.pack(">ff", U, V))
+ mesh.activeUVLayer = org_uv
return data.getvalue()
# ======================================
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_distance.c b/source/blender/nodes/intern/TEX_nodes/TEX_distance.c
index ff9ec4db76b..d23eb6bc589 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_distance.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_distance.c
@@ -44,7 +44,6 @@ static bNodeSocketType outputs[]= {
static void valuefn(float *out, float *coord, bNode *node, bNodeStack **in, short thread)
{
float coord1[3], coord2[3];
- float x, y, z;
tex_input_vec(coord1, in[0], coord, thread);
tex_input_vec(coord2, in[1], coord, thread);