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

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--io_scene_x3d/__init__.py2
-rw-r--r--io_scene_x3d/export_x3d.py13
2 files changed, 9 insertions, 6 deletions
diff --git a/io_scene_x3d/__init__.py b/io_scene_x3d/__init__.py
index 54377704..94ed224a 100644
--- a/io_scene_x3d/__init__.py
+++ b/io_scene_x3d/__init__.py
@@ -21,7 +21,7 @@
bl_info = {
"name": "Web3D X3D/VRML2 format",
"author": "Campbell Barton, Bart, Bastien Montagne, Seva Alekseyev",
- "version": (2, 2, 0),
+ "version": (2, 2, 1),
"blender": (2, 80, 0),
"location": "File > Import-Export",
"description": "Import-Export X3D, Import VRML2",
diff --git a/io_scene_x3d/export_x3d.py b/io_scene_x3d/export_x3d.py
index 7ab832d6..ff5ec0a3 100644
--- a/io_scene_x3d/export_x3d.py
+++ b/io_scene_x3d/export_x3d.py
@@ -708,6 +708,8 @@ def export(file,
slot_uv = None
slot_col = None
+ def _tuple_from_rounded_iter(it):
+ return tuple(round(v, 5) for v in it)
if is_uv and is_col:
slot_uv = 0
@@ -715,22 +717,22 @@ def export(file,
def vertex_key(lidx):
return (
- mesh_loops_uv[lidx].uv[:],
- mesh_loops_col[lidx].color[:],
+ _tuple_from_rounded_iter(mesh_loops_uv[lidx].uv),
+ _tuple_from_rounded_iter(mesh_loops_col[lidx].color),
)
elif is_uv:
slot_uv = 0
def vertex_key(lidx):
return (
- mesh_loops_uv[lidx].uv[:],
+ _tuple_from_rounded_iter(mesh_loops_uv[lidx].uv),
)
elif is_col:
slot_col = 0
def vertex_key(lidx):
return (
- mesh_loops_col[lidx].color[:],
+ _tuple_from_rounded_iter(mesh_loops_col[lidx].color),
)
else:
# ack, not especially efficient in this case
@@ -739,7 +741,6 @@ def export(file,
# build a mesh mapping dict
vertex_hash = [{} for i in range(len(mesh.vertices))]
- # worst case every face is a quad
face_tri_list = [[None, None, None] for i in range(len(mesh.loop_triangles))]
vert_tri_list = []
totvert = 0
@@ -762,6 +763,8 @@ def export(file,
face_tri_list[totface][:] = temp_tri[:]
totface += 1
+ del vertex_key
+ del _tuple_from_rounded_iter
assert(len(face_tri_list) == len(mesh.loop_triangles))
fw(ident_step + 'index="')