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
__init__.py 文件源码
python
阅读 19
收藏 0
点赞 0
评论 0
评论列表
文章目录