gp_render/prefs.py

43 lines
1.1 KiB
Python
Raw Normal View History

import bpy
class gp_render_prefs(bpy.types.AddonPreferences):
bl_idname = __name__.split('.')[0]
# resample_otf : bpy.props.BoolProperty(
# name='Resample on the fly',
# description="Allow smoother stroke when using pinch\nnote that stroke using textured materials will not be resampled",
# default=True)
2023-01-18 14:28:27 +01:00
advanced : bpy.props.BoolProperty(
name='Advanced Options', # Reproject On Guessed Plane
description="Display advanced options",
default=False)
def draw(self, context):
layout = self.layout
layout.prop(self, "advanced")
def get_addon_prefs():
'''
function to read current addon preferences properties
access with : get_addon_prefs().super_special_option
'''
2023-01-18 14:28:27 +01:00
import os
addon_name = os.path.splitext(__name__)[0]
preferences = bpy.context.preferences
addon_prefs = preferences.addons[addon_name].preferences
return (addon_prefs)
classes=(
gp_render_prefs,
)
def register():
for cls in classes:
bpy.utils.register_class(cls)
def unregister():
for cls in reversed(classes):
bpy.utils.unregister_class(cls)