-
Notifications
You must be signed in to change notification settings - Fork 4
/
icons.py
26 lines (19 loc) · 733 Bytes
/
icons.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 os
import glob
from sverchok.ui.sv_icons import register_custom_icon_provider
class SvO3IconProvider(object):
def __init__(self):
pass
def get_icons(self):
icons_dir = os.path.join(os.path.dirname(__file__), "icons")
icon_pattern = "sv_o3_*.png"
icon_path = os.path.join(icons_dir, icon_pattern)
icon_files = [os.path.basename(x) for x in glob.glob(icon_path)]
for icon_file in icon_files:
icon_name = os.path.splitext(icon_file)[0]
icon_id = icon_name.upper()
yield icon_id, os.path.join(icons_dir, icon_file)
def register():
register_custom_icon_provider("sverchok_open3d", SvO3IconProvider())
def unregister():
pass