glTF importer: Keep user render engine (cycles or Eevee) when importing
Note that node tree can't be created when render engine is Workbench, so switching to Eevee.
This commit is contained in:
parent
b1cc242cfd
commit
fefd011035
|
@ -25,7 +25,8 @@ class BlenderGlTF():
|
|||
@staticmethod
|
||||
def create(gltf):
|
||||
"""Create glTF main method."""
|
||||
bpy.context.scene.render.engine = 'BLENDER_EEVEE'
|
||||
if bpy.context.scene.render.engine not in ['CYCLES', 'BLENDER_EEVEE']:
|
||||
bpy.context.scene.render.engine = 'BLENDER_EEVEE'
|
||||
BlenderGlTF.pre_compute(gltf)
|
||||
|
||||
if gltf.data.scenes is not None:
|
||||
|
|
|
@ -41,7 +41,8 @@ class BlenderScene():
|
|||
scene = bpy.context.scene
|
||||
if bpy.context.collection.name in bpy.data.collections: # avoid master collection
|
||||
gltf.blender_active_collection = bpy.context.collection.name
|
||||
scene.render.engine = "BLENDER_EEVEE"
|
||||
if scene.render.engine not in ['CYCLES', 'BLENDER_EEVEE']:
|
||||
scene.render.engine = "BLENDER_EEVEE"
|
||||
|
||||
gltf.blender_scene = scene.name
|
||||
else:
|
||||
|
@ -55,7 +56,8 @@ class BlenderScene():
|
|||
else:
|
||||
# No scene in glTF file, create all objects in current scene
|
||||
scene = bpy.context.scene
|
||||
scene.render.engine = "BLENDER_EEVEE"
|
||||
if scene.render.engine not in ['CYCLES', 'BLENDER_EEVEE']:
|
||||
scene.render.engine = "BLENDER_EEVEE"
|
||||
if bpy.context.collection.name in bpy.data.collections: # avoid master collection
|
||||
gltf.blender_active_collection = bpy.context.collection.name
|
||||
gltf.blender_scene = scene.name
|
||||
|
|
Loading…
Reference in New Issue