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:
authorCampbell Barton <ideasman42@gmail.com>2011-06-27 17:28:55 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-06-27 17:28:55 +0400
commit879788ca2195d28a2e8025ebe330fc14c448b0b2 (patch)
treeee2afab240bb177be86060dd890f2f4cd29983cf /io_scene_x3d
parent06605e9179bc7a2a8bc973330a3f00a50bc89e8e (diff)
fix [#27773] X3D export with Triangulate=on sometimes doesn't share vertexes correctly
Diffstat (limited to 'io_scene_x3d')
-rw-r--r--io_scene_x3d/export_x3d.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/io_scene_x3d/export_x3d.py b/io_scene_x3d/export_x3d.py
index 7a1249a7..42334337 100644
--- a/io_scene_x3d/export_x3d.py
+++ b/io_scene_x3d/export_x3d.py
@@ -487,6 +487,10 @@ def export(file,
is_smooth = True
break
+ # UV's and VCols split verts off which effects smoothing
+ # force writing normals in this case.
+ is_force_normals = use_triangulate and is_smooth and (is_uv or is_col)
+
if use_h3d:
gpu_shader = gpu_shader_cache.get(material) # material can be 'None', uses dummy cache
if gpu_shader is None:
@@ -558,10 +562,10 @@ def export(file,
# --- Write IndexedTriangleSet Attributes (same as IndexedFaceSet)
fw('solid="%s"\n' % ('true' if mesh.show_double_sided else 'false'))
- if is_smooth:
- fw(ident_step + 'creaseAngle="%.4g"\n' % mesh.auto_smooth_angle)
+
+ # creaseAngle unsupported for IndexedTriangleSet's
- if use_normals:
+ if use_normals or is_force_normals:
# currently not optional, could be made so:
fw(ident_step + 'normalPerVertex="true"\n')
@@ -649,7 +653,7 @@ def export(file,
fw('%.6g %.6g %.6g ' % mesh_vertices[x3d_v[1]].co[:])
fw('" />\n')
- if use_normals:
+ if use_normals or is_force_normals:
fw('%s<Normal ' % ident)
fw('vector="')
for x3d_v in vert_tri_list: