46 lines
1.3 KiB
Python
46 lines
1.3 KiB
Python
import bpy
|
|
from bpy.props import (FloatProperty,
|
|
BoolProperty,
|
|
EnumProperty,
|
|
StringProperty,
|
|
IntProperty,
|
|
PointerProperty)
|
|
|
|
def get_addon_prefs():
|
|
prefs = bpy.context.preferences
|
|
return prefs.addons[__package__].preferences
|
|
|
|
class myaddonPrefs(bpy.types.AddonPreferences):
|
|
bl_idname = __name__.split('.')[0]
|
|
|
|
root_default : bpy.props.StringProperty(
|
|
name='Default Root',
|
|
description="Default root folder path when using export to Zip",
|
|
subtype='DIR_PATH',
|
|
default='')
|
|
|
|
def draw(self, context):
|
|
layout = self.layout
|
|
col = layout.column()
|
|
col.label(text='Export to Zip preferences:')
|
|
col.prop(self, 'root_default')
|
|
|
|
col = layout.column()
|
|
col.label(text='If specified, will be the default root folder path when using export to Zip')
|
|
col.label(text='Typically the root folder of the current project')
|
|
|
|
|
|
|
|
### --- REGISTER ---
|
|
|
|
classes=(
|
|
myaddonPrefs,
|
|
)
|
|
|
|
def register():
|
|
for cls in classes:
|
|
bpy.utils.register_class(cls)
|
|
|
|
def unregister():
|
|
for cls in reversed(classes):
|
|
bpy.utils.unregister_class(cls) |