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:
authorMichalis Kamburelis <kambi>2020-03-27 02:40:33 +0300
committerBrecht Van Lommel <brecht@blender.org>2020-03-27 02:41:07 +0300
commit6c3fbd669d233452d9970cb95b2695c45d78e626 (patch)
tree23936b7d82d808f3edb6c1992f8ee21d3c1d8006 /io_scene_x3d
parent91733dfff1bec689745209cc33fe458b65d9f19a (diff)
Fix T74934: exporting object with modifiers to X3D fails
The mesh name should be read-only. Differential Revision: https://developer.blender.org/D7183
Diffstat (limited to 'io_scene_x3d')
-rw-r--r--io_scene_x3d/export_x3d.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/io_scene_x3d/export_x3d.py b/io_scene_x3d/export_x3d.py
index a9d694d6..517146cb 100644
--- a/io_scene_x3d/export_x3d.py
+++ b/io_scene_x3d/export_x3d.py
@@ -499,9 +499,9 @@ def export(file,
fw(ident_step + 'location="%.4f %.4f %.4f"\n' % location)
fw(ident_step + '/>\n')
- def writeIndexedFaceSet(ident, obj, mesh, matrix, world):
+ def writeIndexedFaceSet(ident, obj, mesh, mesh_name, matrix, world):
obj_id = quoteattr(unique_name(obj, OB_ + obj.name, uuid_cache_object, clean_func=clean_def, sep="_"))
- mesh_id = quoteattr(unique_name(mesh, ME_ + mesh.name, uuid_cache_mesh, clean_func=clean_def, sep="_"))
+ mesh_id = quoteattr(unique_name(mesh, ME_ + mesh_name, uuid_cache_mesh, clean_func=clean_def, sep="_"))
mesh_id_group = prefix_quoted_str(mesh_id, group_)
mesh_id_coords = prefix_quoted_str(mesh_id, 'coords_')
mesh_id_normals = prefix_quoted_str(mesh_id, 'normals_')
@@ -1436,20 +1436,21 @@ def export(file,
# ensure unique name, we could also do this by
# postponing mesh removal, but clearing data - TODO
if do_remove:
- me.name = obj.name.rstrip("1234567890").rstrip(".")
- me_name_new = me_name_org = me.name
+ me_name_new = me_name_original = obj.name.rstrip("1234567890").rstrip(".")
count = 0
while me_name_new in mesh_name_set:
- me.name = "%.17s.%03d" % (me_name_org, count)
- me_name_new = me.name
+ me_name_new = "%.17s.%03d" % (me_name_original, count)
count += 1
mesh_name_set.add(me_name_new)
- del me_name_new, me_name_org, count
+ mesh_name = me_name_new
+ del me_name_new, me_name_original, count
+ else:
+ mesh_name = me.name
# done
- writeIndexedFaceSet(ident, obj, me, obj_matrix, world)
+ writeIndexedFaceSet(ident, obj, me, mesh_name, obj_matrix, world)
- # free mesh created with create_mesh()
+ # free mesh created with to_mesh()
if do_remove:
obj_for_mesh.to_mesh_clear()