From 37e1882f2333abdece571030c28ff067c7b91d3f Mon Sep 17 00:00:00 2001
From: Campbell Barton <ideasman42@gmail.com>
Date: Wed, 16 Mar 2011 09:04:09 +0000
Subject: [PATCH] fix [#26481] Export to X3D of IndexedFaceSet should use X3D
 's DEF USE mechanism

---
 io_scene_x3d/export_x3d.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/io_scene_x3d/export_x3d.py b/io_scene_x3d/export_x3d.py
index 103476589..2dc9f638e 100644
--- a/io_scene_x3d/export_x3d.py
+++ b/io_scene_x3d/export_x3d.py
@@ -88,7 +88,7 @@ class x3d_class:
 
         self.bNav = 0
         self.nodeID = 0
-        self.namesReserved = ("Anchor", "Appearance", "Arc2D", "ArcClose2D", "AudioClip", "Background", "Billboard",
+        self.namesReserved = {"Anchor", "Appearance", "Arc2D", "ArcClose2D", "AudioClip", "Background", "Billboard",
                              "BooleanFilter", "BooleanSequencer", "BooleanToggle", "BooleanTrigger", "Box", "Circle2D",
                              "Collision", "Color", "ColorInterpolator", "ColorRGBA", "component", "Cone", "connect",
                              "Contour2D", "ContourPolyline2D", "Coordinate", "CoordinateDouble", "CoordinateInterpolator",
@@ -113,7 +113,7 @@ class x3d_class:
                              "StringSensor", "Switch", "Text", "TextureBackground", "TextureCoordinate", "TextureCoordinateGenerator",
                              "TextureTransform", "TimeSensor", "TimeTrigger", "TouchSensor", "Transform", "TransmitterPdu",
                              "TriangleFanSet", "TriangleSet", "TriangleSet2D", "TriangleStripSet", "Viewpoint", "VisibilitySensor",
-                             "WorldInfo", "X3D", "XvlShell", "VertexShader", "FragmentShader", "MultiShaderAppearance", "ShaderAppearance")
+                             "WorldInfo", "X3D", "XvlShell", "VertexShader", "FragmentShader", "MultiShaderAppearance", "ShaderAppearance"}
 
         self.namesFog = ("", "LINEAR", "EXPONENTIAL", "")
 
@@ -723,7 +723,7 @@ class x3d_class:
                 if objType == 'CAMERA':
                     self.writeViewpoint(ob, ob_mat, scene)
                 elif objType in ('MESH', 'CURVE', 'SURF', 'FONT'):
-                    if use_apply_modifiers or objType != 'MESH':
+                    if (objType != 'MESH') or (use_apply_modifiers and ob.is_modified(scene, 'PREVIEW')):
                         try:
                             me = ob.to_mesh(scene, use_apply_modifiers, 'PREVIEW')
                         except:
-- 
GitLab