patch from michael williamson, export multiple UV layers to lightwave
[#18575] remove unused local variables
This commit is contained in:
@@ -351,23 +351,28 @@ def generate_vmad_vc(mesh):
|
|||||||
# === Generate Per-Face UV Coords (VMAD Chunk) ===
|
# === Generate Per-Face UV Coords (VMAD Chunk) ===
|
||||||
# ================================================
|
# ================================================
|
||||||
def generate_vmad_uv(mesh):
|
def generate_vmad_uv(mesh):
|
||||||
data = cStringIO.StringIO()
|
layers = mesh.getUVLayerNames()
|
||||||
data.write("TXUV") # type
|
org_uv = mesh.activeUVLayer
|
||||||
data.write(struct.pack(">H", 2)) # dimension
|
for l in layers:
|
||||||
data.write(generate_nstring("Blender's UV Coordinates")) # name
|
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):
|
mesh.activeUVLayer = org_uv
|
||||||
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))
|
|
||||||
return data.getvalue()
|
return data.getvalue()
|
||||||
|
|
||||||
# ======================================
|
# ======================================
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ static bNodeSocketType outputs[]= {
|
|||||||
static void valuefn(float *out, float *coord, bNode *node, bNodeStack **in, short thread)
|
static void valuefn(float *out, float *coord, bNode *node, bNodeStack **in, short thread)
|
||||||
{
|
{
|
||||||
float coord1[3], coord2[3];
|
float coord1[3], coord2[3];
|
||||||
float x, y, z;
|
|
||||||
|
|
||||||
tex_input_vec(coord1, in[0], coord, thread);
|
tex_input_vec(coord1, in[0], coord, thread);
|
||||||
tex_input_vec(coord2, in[1], coord, thread);
|
tex_input_vec(coord2, in[1], coord, thread);
|
||||||
|
|||||||
Reference in New Issue
Block a user