glTF: Fix Traceback in Variant UI

This commit is contained in:
Julien Duroure 2022-11-14 16:03:27 +01:00 committed by Philipp Oeser
parent 6f168d5903
commit 1c1b05efd3
Notes: blender-bot 2023-02-13 13:22:27 +01:00
Referenced by issue blender/blender#100749: Blender LTS: Maintenance Task 3.3
Referenced by issue blender/blender#100749, Blender LTS: Maintenance Task 3.3
2 changed files with 4 additions and 4 deletions

View File

@ -4,7 +4,7 @@
bl_info = {
'name': 'glTF 2.0 format',
'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
"version": (3, 3, 34),
"version": (3, 3, 35),
'blender': (3, 3, 0),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',

View File

@ -183,7 +183,7 @@ class SCENE_OT_gltf2_assign_to_variant(bpy.types.Operator):
@classmethod
def poll(self, context):
return len(bpy.data.scenes[0].gltf2_KHR_materials_variants_variants) > 0 \
and bpy.context.object.type == "MESH"
and bpy.context.object and bpy.context.object.type == "MESH"
def execute(self, context):
gltf2_active_variant = bpy.data.scenes[0].gltf2_active_variant
@ -216,7 +216,7 @@ class SCENE_OT_gltf2_reset_to_original(bpy.types.Operator):
@classmethod
def poll(self, context):
return bpy.context.object.type == "MESH" and len(context.object.data.gltf2_variant_default_materials) > 0
return bpy.context.object and bpy.context.object.type == "MESH" and len(context.object.data.gltf2_variant_default_materials) > 0
def execute(self, context):
obj = bpy.context.object
@ -240,7 +240,7 @@ class SCENE_OT_gltf2_assign_as_original(bpy.types.Operator):
@classmethod
def poll(self, context):
return bpy.context.object.type == "MESH"
return bpy.context.object and bpy.context.object.type == "MESH"
def execute(self, context):
obj = bpy.context.object