Skip to content
This repository has been archived by the owner on Feb 19, 2024. It is now read-only.

Commit

Permalink
Added verification for empty list
Browse files Browse the repository at this point in the history
  • Loading branch information
FairplexVR committed Jan 6, 2024
1 parent 2d47bc9 commit f0ff510
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lightmap_baker.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ class Operator(bpy.types.Operator):

def execute(self, context):
global bake_in_progress

# Cancel if the list ist empty
if len(context.scene.lightmap_baker_objects) == 0:
self.report({'ERROR'}, "Nothing to Bake :(")
return {'CANCELLED'}

# Reset Bake Progression and index
context.scene.lightmap_baker_progress = 0.0
Expand All @@ -137,6 +142,8 @@ def execute(self, context):
if invalid_objects:
self.report({'ERROR'}, f"Invalid objects found in the bake list.")
return {'CANCELLED'}



objects_missing_uv = [obj_name for obj_name in objects_to_bake
if len(bpy.data.objects.get(obj_name).data.uv_layers) < 2]
Expand Down

0 comments on commit f0ff510

Please sign in to comment.