-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
preferences.py
26 lines (18 loc) · 837 Bytes
/
preferences.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 bpy
import os
addon_name = os.path.basename(os.path.dirname(__file__))
class FCurveHelperAddonPrefs(bpy.types.AddonPreferences) :
bl_idname = addon_name
inspector_curve_size : bpy.props.FloatProperty(name="Curves Size in Inspector", min=0.1, max=1, default=0.5)
inspector_modifier_size : bpy.props.FloatProperty(name="Modifiers Size in Inspector", min=0.1, max=2, default=1)
def draw(self, context) :
wm = context.window_manager
layout = self.layout
layout.prop(wm, "fcurvehelper_debug")
row = layout.row()
row.prop(self, 'inspector_curve_size')
row.prop(self, 'inspector_modifier_size')
# get addon preferences
def get_addon_preferences():
addon = bpy.context.preferences.addons.get(addon_name)
return getattr(addon, "preferences", None)