auto_walk/preferences.py

51 lines
1.7 KiB
Python
Raw Normal View History

2022-03-29 18:46:33 +02:00
import bpy
class UAC_addon_prefs(bpy.types.AddonPreferences):
## can be just __name__ if prefs are in the __init__ mainfile
# Else need the splitext '__name__ = addonname.subfile' (or use a static name)
bl_idname = __name__.split('.')[0] # or with: os.path.splitext(__name__)[0]
# some_bool_prop to display in the addon pref
debug : bpy.props.IntProperty(
2022-03-29 18:46:33 +02:00
name='Debug',
description="Enable Debug prints\n\
0 = no prints\n\
1 = basic\n\
2 = full prints",
default=0)
2022-03-29 18:46:33 +02:00
tgt_bone : bpy.props.StringProperty(
name="Constrained Pose bone name", default='world',
description="name of the bone that suppose to hold the constraint")
""" default_forward_axis : bpy.props.EnumProperty(
name='Forward Axis',
default='TRACK_NEGATIVE_Y', # Modifier default is FORWARD_X
description='Axis that points forward along the path',
items=(
('FORWARD_X', 'X', ''),
('FORWARD_Y', 'Y', ''),
('FORWARD_Z', 'Z', ''),
('TRACK_NEGATIVE_X', '-X', ''),
('TRACK_NEGATIVE_Y', '-Y', ''),
('TRACK_NEGATIVE_Z', '-Z', ''),
),
)
"""
def draw(self, context):
layout = self.layout
layout.use_property_split = True
box = layout.box()
box.label(text='Curve creation parameters:')
box.prop(self, "tgt_bone")
# box.prop(self, "default_forward_axis", text='Default Forward Axis')
layout.prop(self, "debug")
def register():
bpy.utils.register_class(UAC_addon_prefs)
def unregister():
bpy.utils.unregister_class(UAC_addon_prefs)