add addon pref and file browser wrapper

This commit is contained in:
2023-10-14 11:48:41 +08:00
parent 5584bc66a0
commit b94e7e2b22
4 changed files with 190 additions and 21 deletions

View File

@ -742,9 +742,26 @@ class BBP_PT_virtools_material(bpy.types.Panel):
layout.prop(props, 'z_func')
g_BldClasses: tuple[typing.Any, ...] = (
# basic property
BBP_PG_virtools_material,
# 2 operator used in panel
BBP_OT_apply_virtools_material,
BBP_OT_preset_virtools_material,
# panel
BBP_PT_virtools_material,
)
def register_prop():
def register():
for cls in g_BldClasses:
bpy.utils.register_class(cls)
# add into material metadata
bpy.types.Material.virtools_material = bpy.props.PointerProperty(type = BBP_PG_virtools_material)
def unregister_prop():
def unregister():
# del from material metadata
del bpy.types.Material.virtools_material
for cls in g_BldClasses:
bpy.utils.unregister_class(cls)