Python bpy.types 模块,AddonPreferences() 实例源码

我们从Python开源项目中,提取了以下2个代码示例,用于说明如何使用bpy.types.AddonPreferences()

项目:fujiwara_toolbox    作者:YusukeFujiwara    | 项目源码 | 文件源码
def dummy():
    return


#Addon Preferences
#https://docs.blender.org/api/blender_python_api_2_67_1/bpy.types.AddonPreferences.html
项目:ToolPlus    作者:mkbreuer    | 项目源码 | 文件源码
def update_panel_position_custom(self, context):
    try:
        bpy.utils.unregister_class(VIEW3D_TP_Custom_Panel_UI)        
        bpy.utils.unregister_class(VIEW3D_TP_Custom_Panel_TOOLS)

    except:
        pass

    try:
        bpy.utils.unregister_class(VIEW3D_TP_Custom_Panel_UI)
    except:
        pass

    if context.user_preferences.addons[__name__].preferences.tab_location_custom == 'tools':

        VIEW3D_TP_Custom_Panel_TOOLS.bl_category = context.user_preferences.addons[__name__].preferences.tools_category_custom

        bpy.utils.register_class(VIEW3D_TP_Custom_Panel_TOOLS)

    if context.user_preferences.addons[__name__].preferences.tab_location_custom == 'ui':
        bpy.utils.register_class(VIEW3D_TP_Custom_Panel_UI)

    if context.user_preferences.addons[__name__].preferences.tab_location_custom == 'off':
        pass



# AddonPreferences #####################################