glTF importer: Make the first root node the active object at end of import process

This commit is contained in:
Julien Duroure 2019-05-07 10:20:18 +02:00
parent 447abeb9be
commit b82ea71146
1 changed files with 4 additions and 0 deletions

View File

@ -157,6 +157,10 @@ class BlenderScene():
bpy.data.collections[gltf.blender_active_collection].hide_viewport = gltf.collection_hide_viewport
# TODO restore visibility when expose in bpy
# Make first root object the new active one
if list_nodes is not None:
bpy.context.scene.objects.active = bpy.data.objects[gltf.data.nodes[list_nodes[0]].blender_object]
@staticmethod
def get_root_nodes(gltf):
if gltf.data.nodes is None: