diff --git a/io_scene_b3d/import_b3d.py b/io_scene_b3d/import_b3d.py index 93a6f67..36908b2 100644 --- a/io_scene_b3d/import_b3d.py +++ b/io_scene_b3d/import_b3d.py @@ -487,14 +487,6 @@ def import_node(node, parent): objects = [] - if node['meshes']==[]: - mesh = bpy.data.meshes.new(objName) - ob = bpy.data.objects.new(objName, mesh) - objects.append(ob) - if parent: ob.parent = parent - ctx.scene.objects.link(ob) - root = ob - # walk through faces and collect vertices for m in node['meshes']: objIndex += 1 @@ -575,6 +567,13 @@ def import_node(node, parent): ops.object.select_all(action="SELECT") ops.object.shade_smooth() + if not objects: + ob = bpy.data.objects.new(objName, None) + objects.append(ob) + if parent: ob.parent = parent + ctx.scene.objects.link(ob) + root = ob + for ob in objects: ob.rotation_mode='QUATERNION' ob.rotation_quaternion = flip(rot)