Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion bakelab_bake.py
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,9 @@ def modal(self, context, event):

if event.type == 'TIMER':
if context.scene.BakeLabProps.bake_state == 'BAKING':
context.area.tag_redraw() # Update UI
# Check if the area is valid and if it's the correct area type
if context.area and context.area.type == 'VIEW_3D':
context.area.tag_redraw() # Update UI
result = next(self.BakeCrt)
if result == -1:
self.cancel(context)
Expand Down
12 changes: 9 additions & 3 deletions bakelab_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,9 @@ def invoke(self, context, event):
return wm.invoke_props_dialog(self)

def execute(self,context):
context.area.tag_redraw()
# Check if the area is valid and if it's the correct area type
if context.area and context.area.type == 'VIEW_3D':
context.area.tag_redraw()
item = context.scene.BakeLabMaps.add()

item.type = self.type
Expand Down Expand Up @@ -442,7 +444,9 @@ def poll(cls,context):
return context.scene.BakeLabMaps

def execute(self,context):
context.area.tag_redraw()
# Check if the area is valid and if it's the correct area type
if context.area and context.area.type == 'VIEW_3D':
context.area.tag_redraw()
context.scene.BakeLabMaps.remove(context.scene.BakeLabMapIndex)
context.scene.BakeLabMapIndex = max(context.scene.BakeLabMapIndex - 1,0)
context.scene.BakeLabMapIndex = min(context.scene.BakeLabMapIndex, len(context.scene.BakeLabMaps))
Expand All @@ -468,7 +472,9 @@ class BakeLabShowPassPresets(Operator):
)

def execute(self,context):
context.area.tag_redraw()
# Check if the area is valid and if it's the correct area type
if context.area and context.area.type == 'VIEW_3D':
context.area.tag_redraw()
scene = context.scene
if scene.BakeLabMapIndex>=0 and scene.BakeLabMaps:
item = scene.BakeLabMaps[scene.BakeLabMapIndex]
Expand Down