")
# Vertex Array
- self.writel(S_GEOM, 3, '')
+ self.writel(S_GEOM, 3, "".format(meshid))
float_values = ""
for v in vertices:
- float_values += " {} {} {}".format(v.vertex.x, v.vertex.y, v.vertex.z)
- self.writel(S_GEOM, 4, '' + float_values +
- '')
- self.writel(S_GEOM, 4, '')
- self.writel(S_GEOM, 4, '')
- self.writel(S_GEOM, 5, '')
- self.writel(S_GEOM, 5, '')
- self.writel(S_GEOM, 5, '')
- self.writel(S_GEOM, 4, '')
- self.writel(S_GEOM, 4, '')
- self.writel(S_GEOM, 3, '')
+ float_values += " {} {} {}".format(
+ v.vertex.x, v.vertex.y, v.vertex.z)
+ self.writel(
+ S_GEOM, 4, "{}".format(
+ meshid, len(vertices) * 3, float_values))
+ self.writel(S_GEOM, 4, "")
+ self.writel(
+ S_GEOM, 4, "".format(meshid, len(vertices)))
+ self.writel(S_GEOM, 5, "")
+ self.writel(S_GEOM, 5, "")
+ self.writel(S_GEOM, 5, "")
+ self.writel(S_GEOM, 4, "")
+ self.writel(S_GEOM, 4, "")
+ self.writel(S_GEOM, 3, "")
# Normal Array
- self.writel(S_GEOM, 3, '')
+ self.writel(S_GEOM, 3, "".format(meshid))
float_values = ""
for v in vertices:
- float_values += " {} {} {}".format(v.normal.x, v.normal.y, v.normal.z)
- self.writel(S_GEOM, 4, '' + float_values +
- '')
- self.writel(S_GEOM, 4, '')
- self.writel(S_GEOM, 4, '')
- self.writel(S_GEOM, 5, '')
- self.writel(S_GEOM, 5, '')
- self.writel(S_GEOM, 5, '')
- self.writel(S_GEOM, 4, '')
- self.writel(S_GEOM, 4, '')
- self.writel(S_GEOM, 3, '')
+ float_values += " {} {} {}".format(
+ v.normal.x, v.normal.y, v.normal.z)
+ self.writel(
+ S_GEOM, 4, "{}".format(
+ meshid, len(vertices) * 3, float_values))
+ self.writel(S_GEOM, 4, "")
+ self.writel(
+ S_GEOM, 4, "".format(meshid, len(vertices)))
+ self.writel(S_GEOM, 5, "")
+ self.writel(S_GEOM, 5, "")
+ self.writel(S_GEOM, 5, "")
+ self.writel(S_GEOM, 4, "")
+ self.writel(S_GEOM, 4, "")
+ self.writel(S_GEOM, 3, "")
if (has_tangents):
- self.writel(S_GEOM, 3, '')
+ self.writel(
+ S_GEOM, 3, "".format(meshid))
float_values = ""
for v in vertices:
- float_values += " {} {} {}".format(v.tangent.x, v.tangent.y, v.tangent.z)
- self.writel(S_GEOM, 4, '' + float_values +
- '')
- self.writel(S_GEOM, 4, '')
- self.writel(S_GEOM, 4, '')
- self.writel(S_GEOM, 5, '')
- self.writel(S_GEOM, 5, '')
- self.writel(S_GEOM, 5, '')
- self.writel(S_GEOM, 4, '')
- self.writel(S_GEOM, 4, '')
- self.writel(S_GEOM, 3, '')
+ float_values += " {} {} {}".format(
+ v.tangent.x, v.tangent.y, v.tangent.z)
+ self.writel(
+ S_GEOM, 4, "{}".format(
+ meshid, len(vertices) * 3, float_values))
+ self.writel(S_GEOM, 4, "")
+ self.writel(
+ S_GEOM, 4, "".format(meshid, len(vertices)))
+ self.writel(S_GEOM, 5, "")
+ self.writel(S_GEOM, 5, "")
+ self.writel(S_GEOM, 5, "")
+ self.writel(S_GEOM, 4, "")
+ self.writel(S_GEOM, 4, "")
+ self.writel(S_GEOM, 3, "")
- self.writel(S_GEOM, 3, '')
+ self.writel(S_GEOM, 3, "".format(
+ meshid))
float_values = ""
for v in vertices:
- float_values += " {} {} {}".format(v.bitangent.x, v.bitangent.y, v.bitangent.z)
- self.writel(S_GEOM, 4, '' + float_values +
- '')
- self.writel(S_GEOM, 4, '')
- self.writel(S_GEOM, 4, '')
- self.writel(S_GEOM, 5, '')
- self.writel(S_GEOM, 5, '')
- self.writel(S_GEOM, 5, '')
- self.writel(S_GEOM, 4, '')
- self.writel(S_GEOM, 4, '')
- self.writel(S_GEOM, 3, '')
+ float_values += " {} {} {}".format(
+ v.bitangent.x, v.bitangent.y, v.bitangent.z)
+ self.writel(
+ S_GEOM, 4, "{}".format(
+ meshid, len(vertices) * 3, float_values))
+ self.writel(S_GEOM, 4, "")
+ self.writel(
+ S_GEOM, 4, "".format(meshid, len(vertices)))
+ self.writel(S_GEOM, 5, "")
+ self.writel(S_GEOM, 5, "")
+ self.writel(S_GEOM, 5, "")
+ self.writel(S_GEOM, 4, "")
+ self.writel(S_GEOM, 4, "")
+ self.writel(S_GEOM, 3, "")
# UV Arrays
for uvi in range(uv_layer_count):
- self.writel(S_GEOM, 3, '')
+ self.writel(S_GEOM, 3, "".format(
+ meshid, uvi))
float_values = ""
for v in vertices:
try:
float_values += " {} {}".format(v.uv[uvi].x, v.uv[uvi].y)
except:
- # I don't understand this weird multi-uv-layer API, but
+ # I don"t understand this weird multi-uv-layer API, but
# with this it seems to works
float_values += " 0 0 "
- self.writel(S_GEOM, 4, '' +
- float_values + '')
- self.writel(S_GEOM, 4, '')
- self.writel(S_GEOM, 4, '')
- self.writel(S_GEOM, 5, '')
- self.writel(S_GEOM, 5, '')
- self.writel(S_GEOM, 4, '')
- self.writel(S_GEOM, 4, '')
- self.writel(S_GEOM, 3, '')
+ self.writel(
+ S_GEOM, 4, "{}".format(
+ meshid, uvi, len(vertices) * 2, float_values))
+ self.writel(S_GEOM, 4, "")
+ self.writel(
+ S_GEOM, 4, "".format(
+ meshid, uvi, len(vertices)))
+ self.writel(S_GEOM, 5, "")
+ self.writel(S_GEOM, 5, "")
+ self.writel(S_GEOM, 4, "")
+ self.writel(S_GEOM, 4, "")
+ self.writel(S_GEOM, 3, "")
# Color Arrays
if (has_colors):
- self.writel(S_GEOM, 3, '')
+ self.writel(S_GEOM, 3, "".format(meshid))
float_values = ""
for v in vertices:
- float_values += " {} {} {}".format(v.color.x, v.color.y, v.color.z)
- self.writel(S_GEOM, 4, '' + float_values +
- '')
- self.writel(S_GEOM, 4, '')
- self.writel(S_GEOM, 4, '')
- self.writel(S_GEOM, 5, '')
- self.writel(S_GEOM, 5, '')
- self.writel(S_GEOM, 5, '')
- self.writel(S_GEOM, 4, '')
- self.writel(S_GEOM, 4, '')
- self.writel(S_GEOM, 3, '')
+ float_values += " {} {} {}".format(
+ v.color.x, v.color.y, v.color.z)
+ self.writel(
+ S_GEOM, 4, "{}".format(
+ meshid, len(vertices) * 3, float_values))
+ self.writel(S_GEOM, 4, "")
+ self.writel(
+ S_GEOM, 4, "".format(meshid, len(vertices)))
+ self.writel(S_GEOM, 5, "")
+ self.writel(S_GEOM, 5, "")
+ self.writel(S_GEOM, 5, "")
+ self.writel(S_GEOM, 4, "")
+ self.writel(S_GEOM, 4, "")
+ self.writel(S_GEOM, 3, "")
# Triangle Lists
- self.writel(S_GEOM, 3, '')
+ self.writel(S_GEOM, 3, "".format(meshid))
self.writel(
- S_GEOM, 4, '')
- self.writel(S_GEOM, 3, '')
+ S_GEOM, 4,
+ "".format(
+ meshid))
+ self.writel(S_GEOM, 3, "")
prim_type = ""
if (triangulate):
@@ -857,35 +877,38 @@ class DaeExporter:
if (mat is not None):
matref = self.new_id("trimat")
- self.writel(S_GEOM, 3, '<' + prim_type + ' count="' + str(
- int(len(indices))) + '" material="' + matref +
- '">') # todo material
+ self.writel(
+ S_GEOM, 3, "<{} count=\"{}\" material=\"{}\">".format(
+ prim_type, int(len(indices)), matref)) # todo material
mat_assign.append((mat, matref))
else:
- self.writel(S_GEOM, 3, '<' + prim_type + ' count="' +
- str(int(len(indices))) + '">') # todo material
+ self.writel(S_GEOM, 3, "<{} count=\"{}\">".format(
+ prim_type, int(len(indices)))) # todo material
- self.writel(S_GEOM, 4, '')
- self.writel(S_GEOM, 4, '')
+ self.writel(
+ S_GEOM, 4, "".format(meshid))
+ self.writel(
+ S_GEOM, 4, "".format(meshid))
for uvi in range(uv_layer_count):
- self.writel(S_GEOM, 4, '')
+ self.writel(
+ S_GEOM, 4,
+ "".format(meshid, uvi, uvi))
if (has_colors):
- self.writel(S_GEOM, 4, '')
+ self.writel(
+ S_GEOM, 4, "".format(meshid))
if (has_tangents):
- self.writel(S_GEOM, 4,
- '')
- self.writel(S_GEOM, 4,
- '')
+ self.writel(
+ S_GEOM, 4, "".format(meshid))
+ self.writel(
+ S_GEOM, 4, "".format(meshid))
if (triangulate):
int_values = ""
@@ -902,10 +925,10 @@ class DaeExporter:
int_values += "
"
self.writel(S_GEOM, 4, int_values)
- self.writel(S_GEOM, 3, '' + prim_type + '>')
+ self.writel(S_GEOM, 3, "{}>".format(prim_type))
- self.writel(S_GEOM, 2, '')
- self.writel(S_GEOM, 1, '