__init__.py 文件源码

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

项目:CreatingAdd-onsForBlender 作者: varkenvarken 项目源码 文件源码
def load_icon():
    import os
    import bpy
    import bpy.utils

    try: # if anything goes wrong, for example because we are not running 2.75+ we just ignore it
        import bpy.utils.previews
        pcoll = bpy.utils.previews.new()
        # the path is calculated relative to this py file inside the addon folder
        my_icons_dir = os.path.join(os.path.dirname(__file__), "icons")
        # load a preview thumbnail of the circle icon
        pcoll.load("circle_icon", os.path.join(my_icons_dir, "circle32.png"), 'IMAGE')
        preview_collections['icons'] = pcoll
    except Exception as e:
        pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号