preferences.py 1.0 KB

123456789101112131415161718192021222324252627282930
  1. import bpy
  2. import os
  3. dir_path = os.path.dirname(os.path.realpath(__file__))
  4. #
  5. class MantisPreferences(bpy.types.AddonPreferences):
  6. bl_idname = __package__
  7. # JSONprefix: bpy.props.StringProperty(
  8. # name = "Prefix code file",
  9. # subtype = 'FILE_PATH',
  10. # default = dir_path + '/preferences/prefix.json',)
  11. # JSONchiral: bpy.props.StringProperty(
  12. # name = "Chiral Identifier file",
  13. # subtype = 'FILE_PATH',
  14. # default = dir_path + '/preferences/chiral_identifier.json',)
  15. # JSONseperator:bpy.props.StringProperty(
  16. # name = "Seperator file",
  17. # subtype = 'FILE_PATH',
  18. # default = dir_path + '/preferences/seperator.json',)
  19. WidgetsLibraryFolder:bpy.props.StringProperty(
  20. name = "Widget Library Folder",
  21. subtype = 'FILE_PATH',
  22. default = os.path.join(dir_path, 'widgets'),)
  23. def draw(self, context):
  24. layout = self.layout
  25. layout.label(text="Mantis Preferences")
  26. layout.prop(self, "WidgetsLibraryFolder", icon='FILE_FOLDER')