python类AddonPreferences()的实例源码

conf.py 文件源码 项目:fujiwara_toolbox 作者: YusukeFujiwara 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def dummy():
    return


#Addon Preferences
#https://docs.blender.org/api/blender_python_api_2_67_1/bpy.types.AddonPreferences.html
__init__.py 文件源码 项目:ToolPlus 作者: mkbreuer 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
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 #####################################


问题


面经


文章

微信
公众号

扫码关注公众号