[Bf-extensions-cvs] [745b87af] master: glTF importer: fix previous commit

Julien Duroure noreply at git.blender.org
Tue May 7 11:15:53 CEST 2019


Commit: 745b87af35c7c5a7f8d83c610b869c60bc4dc215
Author: Julien Duroure
Date:   Tue May 7 10:33:50 2019 +0200
Branches: master
https://developer.blender.org/rBA745b87af35c7c5a7f8d83c610b869c60bc4dc215

glTF importer: fix previous commit

===================================================================

M	io_scene_gltf2/blender/imp/gltf2_blender_scene.py

===================================================================

diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_scene.py b/io_scene_gltf2/blender/imp/gltf2_blender_scene.py
index d2d63760..400e66e4 100755
--- a/io_scene_gltf2/blender/imp/gltf2_blender_scene.py
+++ b/io_scene_gltf2/blender/imp/gltf2_blender_scene.py
@@ -159,7 +159,7 @@ class BlenderScene():
 
         # 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]
+            bpy.context.view_layer.objects.active = bpy.data.objects[gltf.data.nodes[list_nodes[0]].blender_object]
 
     @staticmethod
     def get_root_nodes(gltf):



More information about the Bf-extensions-cvs mailing list