-
Notifications
You must be signed in to change notification settings - Fork 4
/
examples.py
22 lines (19 loc) · 753 Bytes
/
examples.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import bpy
from pathlib import Path
from sverchok.ui.sv_examples_menu import add_extra_examples, make_submenu_classes
import sverchok_open3d
EXAMPLES_PATH = Path(sverchok_open3d.__file__).parent / 'json_examples'
def example_categories_names():
names = []
for category_path in EXAMPLES_PATH.iterdir():
if category_path.is_dir():
names.append((EXAMPLES_PATH, category_path.name))
for name in names:
yield name
def register():
submenu_classes = (make_submenu_classes(path, category_name) for path, category_name in example_categories_names())
for examples_menu in submenu_classes:
bpy.utils.register_class(examples_menu)
add_extra_examples('Open3d', EXAMPLES_PATH)
def unregister():
pass