|
|
@@ -7,7 +7,7 @@ bl_info = {
|
|
|
"blender": (3, 0, 0),
|
|
|
"location": "File > Import-Export > Chair Mesh (.chr)",
|
|
|
# Same as the crate version
|
|
|
- "version": (0, 1, 1),
|
|
|
+ "version": (0, 1, 2),
|
|
|
"category": "Import-Export"
|
|
|
}
|
|
|
|
|
|
@@ -173,6 +173,10 @@ def write_model(path, objects, indices, export_colours, export_normals, export_u
|
|
|
if export_colours:
|
|
|
f.write((1).to_bytes(2, "little"))
|
|
|
f.write(bytes([255, 255, 255, 255]))
|
|
|
+ if 1 > 255:
|
|
|
+ colour_size = 2
|
|
|
+ else:
|
|
|
+ colour_size = 1
|
|
|
|
|
|
# TODO: export texture names
|
|
|
if export_uvs:
|
|
|
@@ -202,14 +206,12 @@ def write_model(path, objects, indices, export_colours, export_normals, export_u
|
|
|
|
|
|
if export_uvs:
|
|
|
# TODO: actual texture index
|
|
|
- f.write(bytes([0]))
|
|
|
+ f.write((0).to_bytes(colour_size, "little"))
|
|
|
if short_uvs:
|
|
|
write_uvs = write_vec2_byte
|
|
|
else:
|
|
|
write_uvs = write_vec2_float
|
|
|
|
|
|
- # TODO: texture name index
|
|
|
-
|
|
|
# Write data
|
|
|
for v in obj[0]:
|
|
|
write_pos(f, v[0])
|