UI: move top-bar into the spaces header
[blender.git] / release / scripts / startup / bl_ui / space_topbar.py
1 # ##### BEGIN GPL LICENSE BLOCK #####
2 #
3 #  This program is free software; you can redistribute it and/or
4 #  modify it under the terms of the GNU General Public License
5 #  as published by the Free Software Foundation; either version 2
6 #  of the License, or (at your option) any later version.
7 #
8 #  This program is distributed in the hope that it will be useful,
9 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 #  GNU General Public License for more details.
12 #
13 #  You should have received a copy of the GNU General Public License
14 #  along with this program; if not, write to the Free Software Foundation,
15 #  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 #
17 # ##### END GPL LICENSE BLOCK #####
18
19 # <pep8 compliant>
20 import bpy
21 from bpy.types import Header, Menu, Panel
22
23
24 class TOPBAR_HT_upper_bar(Header):
25     bl_space_type = 'TOPBAR'
26
27     def draw(self, context):
28         region = context.region
29
30         if region.alignment == 'RIGHT':
31             self.draw_right(context)
32         else:
33             self.draw_left(context)
34
35     def draw_left(self, context):
36         layout = self.layout
37
38         window = context.window
39         screen = context.screen
40
41         layout.operator("wm.splash", text="", icon='BLENDER', emboss=False)
42
43         TOPBAR_MT_editor_menus.draw_collapsible(context, layout)
44
45         layout.separator()
46
47         if not screen.show_fullscreen:
48             layout.template_ID_tabs(
49                 window, "workspace",
50                 new="workspace.add",
51                 menu="TOPBAR_MT_workspace_menu",
52             )
53         else:
54             layout.operator(
55                 "screen.back_to_previous",
56                 icon='SCREEN_BACK',
57                 text="Back to Previous",
58             )
59
60     def draw_right(self, context):
61         layout = self.layout
62
63         window = context.window
64         screen = context.screen
65         scene = window.scene
66
67         # If statusbar is hidden, still show messages at the top
68         if not screen.show_statusbar:
69             layout.template_reports_banner()
70             layout.template_running_jobs()
71
72         # Active workspace view-layer is retrieved through window, not through workspace.
73         layout.template_ID(window, "scene", new="scene.new", unlink="scene.delete")
74
75         row = layout.row(align=True)
76         row.template_search(
77             window, "view_layer",
78             scene, "view_layers",
79             new="scene.view_layer_add",
80             unlink="scene.view_layer_remove")
81
82
83 class TOPBAR_PT_gpencil_layers(Panel):
84     bl_space_type = 'VIEW_3D'
85     bl_region_type = 'HEADER'
86     bl_label = "Layers"
87     bl_ui_units_x = 14
88
89     @classmethod
90     def poll(cls, context):
91         if context.gpencil_data is None:
92             return False
93
94         ob = context.object
95         if ob is not None and ob.type == 'GPENCIL':
96             return True
97
98         return False
99
100     def draw(self, context):
101         layout = self.layout
102         gpd = context.gpencil_data
103
104         # Grease Pencil data...
105         if (gpd is None) or (not gpd.layers):
106             layout.operator("gpencil.layer_add", text="New Layer")
107         else:
108             self.draw_layers(context, layout, gpd)
109
110     def draw_layers(self, context, layout, gpd):
111         row = layout.row()
112
113         col = row.column()
114         layer_rows = 10
115         col.template_list("GPENCIL_UL_layer", "", gpd, "layers", gpd.layers, "active_index",
116                           rows=layer_rows, sort_reverse=True, sort_lock=True)
117
118         gpl = context.active_gpencil_layer
119         if gpl:
120             srow = col.row(align=True)
121             srow.prop(gpl, "blend_mode", text="Blend")
122
123             srow = col.row(align=True)
124             srow.prop(gpl, "opacity", text="Opacity", slider=True)
125             srow.prop(gpl, "clamp_layer", text="",
126                       icon='MOD_MASK' if gpl.clamp_layer else 'LAYER_ACTIVE')
127
128             srow = col.row(align=True)
129             srow.prop(gpl, "use_solo_mode", text="Show Only On Keyframed")
130
131         col = row.column()
132
133         sub = col.column(align=True)
134         sub.operator("gpencil.layer_add", icon='ADD', text="")
135         sub.operator("gpencil.layer_remove", icon='REMOVE', text="")
136
137         gpl = context.active_gpencil_layer
138         if gpl:
139             sub.menu("GPENCIL_MT_layer_context_menu", icon='DOWNARROW_HLT', text="")
140
141             if len(gpd.layers) > 1:
142                 col.separator()
143
144                 sub = col.column(align=True)
145                 sub.operator("gpencil.layer_move", icon='TRIA_UP', text="").type = 'UP'
146                 sub.operator("gpencil.layer_move", icon='TRIA_DOWN', text="").type = 'DOWN'
147
148                 col.separator()
149
150                 sub = col.column(align=True)
151                 sub.operator("gpencil.layer_isolate", icon='LOCKED', text="").affect_visibility = False
152                 sub.operator("gpencil.layer_isolate", icon='HIDE_OFF', text="").affect_visibility = True
153
154
155 class TOPBAR_MT_editor_menus(Menu):
156     bl_idname = "TOPBAR_MT_editor_menus"
157     bl_label = ""
158
159     def draw(self, context):
160         layout = self.layout
161         layout.menu("TOPBAR_MT_file")
162         layout.menu("TOPBAR_MT_edit")
163
164         layout.menu("TOPBAR_MT_render")
165
166         layout.menu("TOPBAR_MT_window")
167         layout.menu("TOPBAR_MT_help")
168
169
170 class TOPBAR_MT_file(Menu):
171     bl_label = "File"
172
173     def draw(self, context):
174         layout = self.layout
175
176         layout.operator_context = 'INVOKE_AREA'
177         layout.menu("TOPBAR_MT_file_new", text="New", icon='FILE_NEW')
178         layout.operator("wm.open_mainfile", text="Open...", icon='FILE_FOLDER')
179         layout.menu("TOPBAR_MT_file_open_recent")
180         layout.operator("wm.revert_mainfile")
181         layout.operator("wm.recover_last_session")
182         layout.operator("wm.recover_auto_save", text="Recover Auto Save...")
183
184         layout.separator()
185
186         layout.operator_context = 'EXEC_AREA' if context.blend_data.is_saved else 'INVOKE_AREA'
187         layout.operator("wm.save_mainfile", text="Save", icon='FILE_TICK')
188
189         layout.operator_context = 'INVOKE_AREA'
190         layout.operator("wm.save_as_mainfile", text="Save As...")
191         layout.operator_context = 'INVOKE_AREA'
192         layout.operator("wm.save_as_mainfile", text="Save Copy...").copy = True
193
194         layout.separator()
195         layout.operator_context = 'INVOKE_AREA'
196
197         if any(bpy.utils.app_template_paths()):
198             app_template = context.preferences.app_template
199         else:
200             app_template = None
201
202         if app_template:
203             layout.label(text=bpy.path.display_name(app_template, has_ext=False))
204             layout.operator("wm.save_homefile")
205             layout.operator(
206                 "wm.read_factory_settings",
207                 text="Load Factory Settings",
208             ).app_template = app_template
209         else:
210             layout.operator("wm.save_homefile")
211             layout.operator("wm.read_factory_settings")
212
213         layout.separator()
214
215         layout.operator("preferences.app_template_install", text="Install Application Template...")
216
217         layout.separator()
218
219         layout.operator_context = 'INVOKE_AREA'
220         layout.operator("wm.link", text="Link...", icon='LINK_BLEND')
221         layout.operator("wm.append", text="Append...", icon='APPEND_BLEND')
222         layout.menu("TOPBAR_MT_file_previews")
223
224         layout.separator()
225
226         layout.menu("TOPBAR_MT_file_import", icon='IMPORT')
227         layout.menu("TOPBAR_MT_file_export", icon='EXPORT')
228
229         layout.separator()
230
231         layout.menu("TOPBAR_MT_file_external_data")
232
233         layout.separator()
234
235         layout.operator_context = 'EXEC_AREA'
236         if bpy.data.is_dirty:
237             layout.operator_context = 'INVOKE_SCREEN'  # quit dialog
238         layout.operator("wm.quit_blender", text="Quit", icon='QUIT')
239
240
241 class TOPBAR_MT_file_new(Menu):
242     bl_label = "New File"
243
244     @staticmethod
245     def app_template_paths():
246         import os
247
248         template_paths = bpy.utils.app_template_paths()
249
250         # expand template paths
251         app_templates = []
252         for path in template_paths:
253             for d in os.listdir(path):
254                 if d.startswith(("__", ".")):
255                     continue
256                 template = os.path.join(path, d)
257                 if os.path.isdir(template):
258                     # template_paths_expand.append(template)
259                     app_templates.append(d)
260
261         return sorted(app_templates)
262
263     def draw_ex(layout, context, *, use_splash=False, use_more=False):
264         layout.operator_context = 'EXEC_DEFAULT'
265
266         # Limit number of templates in splash screen, spill over into more menu.
267         paths = TOPBAR_MT_file_new.app_template_paths()
268         splash_limit = 5
269
270         if use_splash:
271             icon = 'FILE_NEW'
272             show_more = len(paths) > (splash_limit - 1)
273             if show_more:
274                 paths = paths[:splash_limit - 2]
275         elif use_more:
276             icon = 'FILE_NEW'
277             paths = paths[splash_limit - 2:]
278             show_more = False
279         else:
280             icon = 'NONE'
281             show_more = False
282
283         # Draw application templates.
284         if not use_more:
285             props = layout.operator("wm.read_homefile", text="General", icon=icon)
286             props.app_template = ""
287
288         for d in paths:
289             props = layout.operator(
290                 "wm.read_homefile",
291                 text=bpy.path.display_name(d),
292                 icon=icon,
293             )
294             props.app_template = d
295
296         if show_more:
297             layout.menu("TOPBAR_MT_templates_more", text="...")
298
299     def draw(self, context):
300         TOPBAR_MT_file_new.draw_ex(self.layout, context)
301
302
303 class TOPBAR_MT_templates_more(Menu):
304     bl_label = "Templates"
305
306     def draw(self, context):
307         bpy.types.TOPBAR_MT_file_new.draw_ex(self.layout, context, use_more=True)
308
309
310 class TOPBAR_MT_file_import(Menu):
311     bl_idname = "TOPBAR_MT_file_import"
312     bl_label = "Import"
313
314     def draw(self, context):
315         if bpy.app.build_options.collada:
316             self.layout.operator("wm.collada_import", text="Collada (Default) (.dae)")
317         if bpy.app.build_options.alembic:
318             self.layout.operator("wm.alembic_import", text="Alembic (.abc)")
319
320
321 class TOPBAR_MT_file_export(Menu):
322     bl_idname = "TOPBAR_MT_file_export"
323     bl_label = "Export"
324
325     def draw(self, context):
326         if bpy.app.build_options.collada:
327             self.layout.operator("wm.collada_export", text="Collada (Default) (.dae)")
328         if bpy.app.build_options.alembic:
329             self.layout.operator("wm.alembic_export", text="Alembic (.abc)")
330
331
332 class TOPBAR_MT_file_external_data(Menu):
333     bl_label = "External Data"
334
335     def draw(self, context):
336         layout = self.layout
337
338         icon = 'CHECKBOX_HLT' if bpy.data.use_autopack else 'CHECKBOX_DEHLT'
339         layout.operator("file.autopack_toggle", icon=icon)
340
341         layout.separator()
342
343         pack_all = layout.row()
344         pack_all.operator("file.pack_all")
345         pack_all.active = not bpy.data.use_autopack
346
347         unpack_all = layout.row()
348         unpack_all.operator("file.unpack_all")
349         unpack_all.active = not bpy.data.use_autopack
350
351         layout.separator()
352
353         layout.operator("file.make_paths_relative")
354         layout.operator("file.make_paths_absolute")
355         layout.operator("file.report_missing_files")
356         layout.operator("file.find_missing_files")
357
358
359 class TOPBAR_MT_file_previews(Menu):
360     bl_label = "Data Previews"
361
362     def draw(self, context):
363         layout = self.layout
364
365         layout.operator("wm.previews_ensure")
366         layout.operator("wm.previews_batch_generate")
367
368         layout.separator()
369
370         layout.operator("wm.previews_clear")
371         layout.operator("wm.previews_batch_clear")
372
373
374 class TOPBAR_MT_render(Menu):
375     bl_label = "Render"
376
377     def draw(self, context):
378         layout = self.layout
379
380         rd = context.scene.render
381
382         layout.operator("render.render", text="Render Image", icon='RENDER_STILL').use_viewport = True
383         props = layout.operator("render.render", text="Render Animation", icon='RENDER_ANIMATION')
384         props.animation = True
385         props.use_viewport = True
386
387         layout.separator()
388
389         layout.operator("sound.mixdown", text="Render Audio...")
390
391         layout.separator()
392
393         layout.operator("render.view_show", text="View Render")
394         layout.operator("render.play_rendered_anim", text="View Animation")
395         layout.prop_menu_enum(rd, "display_mode", text="Display Mode")
396
397         layout.separator()
398
399         layout.prop(rd, "use_lock_interface", text="Lock Interface")
400
401
402 class TOPBAR_MT_edit(Menu):
403     bl_label = "Edit"
404
405     def draw(self, context):
406         layout = self.layout
407
408         layout.operator("ed.undo")
409         layout.operator("ed.redo")
410
411         layout.separator()
412
413         layout.operator("ed.undo_history", text="Undo History...")
414
415         layout.separator()
416
417         layout.operator("screen.repeat_last")
418         layout.operator("screen.repeat_history", text="Repeat History...")
419
420         layout.separator()
421
422         layout.operator("screen.redo_last", text="Adjust Last Operation...")
423
424         layout.separator()
425
426         layout.operator("wm.search_menu", text="Operator Search...", icon='VIEWZOOM')
427
428         layout.separator()
429
430         # Mainly to expose shortcut since this depends on the context.
431         props = layout.operator("wm.call_panel", text="Rename Active Item...", icon='OUTLINER_DATA_FONT')
432         props.name = "TOPBAR_PT_name"
433         props.keep_open = False
434
435         layout.separator()
436
437         # Should move elsewhere (impacts outliner & 3D view).
438         tool_settings = context.tool_settings
439         layout.prop(tool_settings, "lock_object_mode")
440
441         layout.separator()
442
443         layout.operator("screen.userpref_show", text="Preferences...", icon='PREFERENCES')
444
445
446 class TOPBAR_MT_window(Menu):
447     bl_label = "Window"
448
449     def draw(self, context):
450         import sys
451
452         layout = self.layout
453
454         layout.operator("wm.window_new")
455         layout.operator("wm.window_new_main")
456
457         layout.separator()
458
459         layout.operator("wm.window_fullscreen_toggle", icon='FULLSCREEN_ENTER')
460
461         layout.separator()
462
463         layout.operator("screen.workspace_cycle", text="Next Workspace").direction = 'NEXT'
464         layout.operator("screen.workspace_cycle", text="Previous Workspace").direction = 'PREV'
465
466         layout.separator()
467
468         layout.prop(context.screen, "show_statusbar")
469
470         layout.separator()
471
472         layout.operator("screen.screenshot")
473
474         if sys.platform[:3] == "win":
475             layout.separator()
476             layout.operator("wm.console_toggle", icon='CONSOLE')
477
478         if context.scene.render.use_multiview:
479             layout.separator()
480             layout.operator("wm.set_stereo_3d")
481
482
483 class TOPBAR_MT_help(Menu):
484     bl_label = "Help"
485
486     def draw(self, context):
487         # If 'url_prefill_from_blender' becomes slow it could be made into a separate operator
488         # to avoid constructing the bug report just to show this menu.
489         from bl_ui_utils.bug_report_url import url_prefill_from_blender
490
491         layout = self.layout
492
493         show_developer = context.preferences.view.show_developer_ui
494
495         layout.operator(
496             "wm.url_open", text="Manual", icon='HELP',
497         ).url = "https://docs.blender.org/manual/en/dev/"
498
499         layout.operator(
500             "wm.url_open", text="Report a Bug", icon='URL',
501         ).url = url_prefill_from_blender()
502
503         layout.separator()
504
505         layout.operator(
506             "wm.url_open", text="User Communities", icon='URL',
507         ).url = "https://www.blender.org/community/"
508         layout.operator(
509             "wm.url_open", text="Developer Community", icon='URL',
510         ).url = "https://www.blender.org/get-involved/developers/"
511
512         layout.separator()
513
514         layout.operator(
515             "wm.url_open", text="Blender Website", icon='URL',
516         ).url = "https://www.blender.org"
517         layout.operator(
518             "wm.url_open", text="Release Notes", icon='URL',
519         ).url = "https://www.blender.org/download/releases/%d-%d/" % bpy.app.version[:2]
520         layout.operator(
521             "wm.url_open", text="Credits", icon='URL',
522         ).url = "https://www.blender.org/about/credits/"
523
524         layout.separator()
525
526         layout.operator(
527             "wm.url_open", text="Blender Store", icon='URL',
528         ).url = "https://store.blender.org"
529         layout.operator(
530             "wm.url_open", text="Development Fund", icon='URL',
531         ).url = "https://fund.blender.org"
532         layout.operator(
533             "wm.url_open", text="Donate", icon='URL',
534         ).url = "https://www.blender.org/foundation/donation-payment/"
535
536         layout.separator()
537
538         if show_developer:
539             layout.operator(
540                 "wm.url_open", text="Python API Reference", icon='URL',
541             ).url = bpy.types.WM_OT_doc_view._prefix
542
543             layout.operator("wm.operator_cheat_sheet", icon='TEXT')
544
545         layout.operator("wm.sysinfo")
546
547         layout.separator()
548
549         layout.operator("wm.splash", icon='BLENDER')
550
551
552 class TOPBAR_MT_file_context_menu(Menu):
553     bl_label = "File Context Menu"
554
555     def draw(self, context):
556         layout = self.layout
557
558         layout.operator_context = 'INVOKE_AREA'
559         layout.operator("wm.read_homefile", text="New", icon='FILE_NEW')
560         layout.operator("wm.open_mainfile", text="Open...", icon='FILE_FOLDER')
561
562         layout.separator()
563
564         layout.operator("wm.link", text="Link...", icon='LINK_BLEND')
565         layout.operator("wm.append", text="Append...", icon='APPEND_BLEND')
566
567         layout.separator()
568
569         layout.menu("TOPBAR_MT_file_import", icon='IMPORT')
570         layout.menu("TOPBAR_MT_file_export", icon='EXPORT')
571
572         layout.separator()
573
574         layout.operator("screen.userpref_show", text="Preferences...", icon='PREFERENCES')
575
576
577 class TOPBAR_MT_workspace_menu(Menu):
578     bl_label = "Workspace"
579
580     def draw(self, context):
581         layout = self.layout
582
583         layout.operator("workspace.duplicate", text="Duplicate", icon='DUPLICATE')
584         if len(bpy.data.workspaces) > 1:
585             layout.operator("workspace.delete", text="Delete", icon='REMOVE')
586
587         layout.separator()
588
589         layout.operator("workspace.reorder_to_front", text="Reorder to Front", icon='TRIA_LEFT_BAR')
590         layout.operator("workspace.reorder_to_back", text="Reorder to Back", icon='TRIA_RIGHT_BAR')
591
592         layout.separator()
593
594         # For key binding discoverability.
595         props = layout.operator("screen.workspace_cycle", text="Previous Workspace")
596         props.direction = 'PREV'
597         props = layout.operator("screen.workspace_cycle", text="Next Workspace")
598         props.direction = 'NEXT'
599
600
601 class TOPBAR_PT_active_tool(Panel):
602     bl_space_type = 'PROPERTIES'
603     bl_region_type = 'WINDOW'
604     bl_category = ""
605     bl_context = ".active_tool"  # dot on purpose (access from tool settings)
606     bl_label = "Active Tool"
607     bl_options = {'HIDE_HEADER'}
608
609     def draw(self, context):
610         layout = self.layout
611
612         # Panel display of topbar tool settings.
613         # currently displays in tool settings, keep here since the same functionality is used for the topbar.
614
615         layout.use_property_split = True
616         layout.use_property_decorate = False
617
618         from .space_toolsystem_common import ToolSelectPanelHelper
619         ToolSelectPanelHelper.draw_active_tool_header(context, layout, show_tool_name=True)
620
621
622 # Grease Pencil Object - Primitive curve
623 class TOPBAR_PT_gpencil_primitive(Panel):
624     bl_space_type = 'VIEW_3D'
625     bl_region_type = 'HEADER'
626     bl_label = "Primitives"
627
628     def draw(self, context):
629         settings = context.tool_settings.gpencil_sculpt
630
631         layout = self.layout
632         # Curve
633         layout.template_curve_mapping(settings, "thickness_primitive_curve", brush=True)
634
635
636 # Grease Pencil Fill
637 class TOPBAR_PT_gpencil_fill(Panel):
638     bl_space_type = 'VIEW_3D'
639     bl_region_type = 'HEADER'
640     bl_label = "Advanced"
641
642     @staticmethod
643     def draw(self, context):
644         paint = context.tool_settings.gpencil_paint
645         brush = paint.brush
646         gp_settings = brush.gpencil_settings
647
648         layout = self.layout
649         # Fill
650         row = layout.row(align=True)
651         row.prop(gp_settings, "fill_factor", text="Resolution")
652         if gp_settings.fill_draw_mode != 'STROKE':
653             row = layout.row(align=True)
654             row.prop(gp_settings, "show_fill", text="Ignore Transparent Strokes")
655             row = layout.row(align=True)
656             row.prop(gp_settings, "fill_threshold", text="Threshold")
657
658
659 # Only a popover
660 class TOPBAR_PT_name(Panel):
661     bl_space_type = 'TOPBAR'  # dummy
662     bl_region_type = 'HEADER'
663     bl_label = "Rename Active Item"
664     bl_ui_units_x = 14
665
666     @classmethod
667     def poll(cls, context):
668         return True
669
670     def draw(self, context):
671         layout = self.layout
672
673         # Edit first editable button in popup
674         def row_with_icon(layout, icon):
675             row = layout.row()
676             row.activate_init = True
677             row.label(icon=icon)
678             return row
679
680         mode = context.mode
681         scene = context.scene
682         space = context.space_data
683         space_type = None if (space is None) else space.type
684         found = False
685         if space_type == 'SEQUENCE_EDITOR':
686             layout.label(text="Sequence Strip Name")
687             item = getattr(scene.sequence_editor, "active_strip")
688             if item:
689                 row = row_with_icon(layout, 'SEQUENCE')
690                 row.prop(item, "name", text="")
691                 found = True
692         elif space_type == 'NODE_EDITOR':
693             layout.label(text="Node Label")
694             item = context.active_node
695             if item:
696                 row = row_with_icon(layout, 'NODE')
697                 row.prop(item, "label", text="")
698                 found = True
699         else:
700             if mode == 'POSE' or (mode == 'WEIGHT_PAINT' and context.pose_object):
701                 layout.label(text="Bone Name")
702                 item = context.active_pose_bone
703                 if item:
704                     row = row_with_icon(layout, 'BONE_DATA')
705                     row.prop(item, "name", text="")
706                     found = True
707             elif mode == 'EDIT_ARMATURE':
708                 layout.label(text="Bone Name")
709                 item = context.active_bone
710                 if item:
711                     row = row_with_icon(layout, 'BONE_DATA')
712                     row.prop(item, "name", text="")
713                     found = True
714             else:
715                 layout.label(text="Object Name")
716                 item = context.object
717                 if item:
718                     row = row_with_icon(layout, 'OBJECT_DATA')
719                     row.prop(item, "name", text="")
720                     found = True
721
722         if not found:
723             row = row_with_icon(layout, 'ERROR')
724             row.label(text="No active item")
725
726
727 classes = (
728     TOPBAR_HT_upper_bar,
729     TOPBAR_MT_file_context_menu,
730     TOPBAR_MT_workspace_menu,
731     TOPBAR_MT_editor_menus,
732     TOPBAR_MT_file,
733     TOPBAR_MT_file_new,
734     TOPBAR_MT_templates_more,
735     TOPBAR_MT_file_import,
736     TOPBAR_MT_file_export,
737     TOPBAR_MT_file_external_data,
738     TOPBAR_MT_file_previews,
739     TOPBAR_MT_edit,
740     TOPBAR_MT_render,
741     TOPBAR_MT_window,
742     TOPBAR_MT_help,
743     TOPBAR_PT_active_tool,
744     TOPBAR_PT_gpencil_layers,
745     TOPBAR_PT_gpencil_primitive,
746     TOPBAR_PT_gpencil_fill,
747 )
748
749 if __name__ == "__main__":  # only for live edit.
750     from bpy.utils import register_class
751     for cls in classes:
752         register_class(cls)