forked from samytichadou/Auto_Reload_Blender_addon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gui.py
26 lines (20 loc) · 929 Bytes
/
gui.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import bpy
class MenuPanel(bpy.types.Panel):
"""Creates a Panel in the scene context of the properties editor"""
bl_label = "Auto Reload Image"
bl_idname = "SCENE_PT_AutoReloadImage"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "scene"
def draw(self, context):
layout = self.layout
layout.use_property_split = True # Active single-column layout
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=True, align=False)
row = flow.row(align=True)
row.operator('reload.reload_all',
icon='FILE_REFRESH')
row = flow.row(align=True)
row.operator('reload.reload_timer', icon='TIME')
if bpy.data.window_managers['WinMan'].reload_modal :
row.prop(bpy.data.window_managers['WinMan'],
'reload_modal', text = "", icon='CANCEL')