__init__.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:Urho3D-Blender-Mod 作者: Mike3D 项目源码 文件源码
def register():
    if DEBUG: print("Urho export register")

    #bpy.utils.register_module(__name__)

    bpy.utils.register_class(UrhoAddonPreferences)
    bpy.utils.register_class(UrhoExportSettings)
    bpy.utils.register_class(UrhoExportOperator)
    bpy.utils.register_class(UrhoExportResetOperator)
    bpy.utils.register_class(UrhoExportResetPathsOperator)
    bpy.utils.register_class(UrhoExportRenderPanel)
    bpy.utils.register_class(UrhoReportDialog)

    bpy.utils.register_class(UrhoComponentsPanel)
    bpy.utils.register_class(UrhoComponentModelResetOperator)
    bpy.utils.register_class(UrhoComponentShapeResetOperator)
    bpy.utils.register_class(UrhoComponentBodyResetOperator)
    Scene.urho_exportsettings = PointerProperty(type=UrhoExportSettings)

    bpy.context.user_preferences.filepaths.use_relative_paths = False

    if not PostLoad in bpy.app.handlers.load_post:
        bpy.app.handlers.load_post.append(PostLoad)


# Note: the script __init__.py is executed only the first time the addons is enabled. After that
# disabling or enabling the script will only call unregister() or register(). So in unregister()
# delete only objects created with register(), do not delete global objects as they will not be
# created re-enabling the addon.
# __init__.py is re-executed pressing F8 or randomly(?) enabling the addon.

# Called when the addon is disabled. Here we remove our UI classes.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号