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:
authorSeva Alekseyev <sevaa@nih.gov>2016-03-28 18:41:36 +0300
committerSeva Alekseyev <sevaa@nih.gov>2016-03-28 18:41:36 +0300
commit17103db8521357628f56c85d60a32b2f23b56cda (patch)
tree05999362c7c9f9081d2235abdf5d80dd76457114
parent872f12f7a76dd782e7f7b977047da4588e5d7f69 (diff)
When importing X3D files, mesh names are derived from X3D node DEF/USE attributes (where present). For VRML, that worked all along, for X3D it was broken,
-rw-r--r--io_scene_x3d/import_x3d.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/io_scene_x3d/import_x3d.py b/io_scene_x3d/import_x3d.py
index d5494d6b..269cc557 100644
--- a/io_scene_x3d/import_x3d.py
+++ b/io_scene_x3d/import_x3d.py
@@ -1371,10 +1371,14 @@ class x3dNode(vrmlNode):
def getSpec(self):
return self.x3dNode.tagName # should match vrml spec
+ # Used to retain object identifiers from X3D to Blender
def getDefName(self):
- data = self.x3dNode.getAttributeNode('DEF')
- if data:
- data.value # XXX, return??
+ node_id = self.x3dNode.getAttributeNode('DEF')
+ if node_id:
+ return node_id.value
+ node_id = self.x3dNode.getAttributeNode('USE')
+ if node_id:
+ return "USE_" + node_id.value
return None
# Other funcs operate from vrml, but this means we can wrap XML fields, still use nice utility funcs
@@ -2981,7 +2985,7 @@ def importShape_ProcessObject(
bpymat, has_alpha, texmtx, ancestry,
global_matrix):
- vrmlname += geom_spec
+ vrmlname += "_" + geom_spec
bpydata.name = vrmlname
if type(bpydata) == bpy.types.Mesh: