use dummy object (data=None) for the Scene Root

This commit is contained in:
joric 2018-01-20 02:04:46 +05:00
parent a30640e861
commit 64650f56f3

View File

@ -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)