Godot_bridge/addon/common/icons.py

17 lines
408 B
Python
Raw Normal View History

2023-03-29 10:43:53 +00:00
import bpy
import os
icons_collection = None
2024-05-18 11:09:47 +00:00
icons_directory = os.path.split(os.path.dirname(__file__))[0] + '/icons'
2023-03-29 10:43:53 +00:00
def get_icon_id(identifier):
return get_icon(identifier).icon_id
def get_icon(identifier):
if identifier in icons_collection:
return icons_collection[identifier]
return icons_collection.load(identifier, os.path.join(icons_directory, identifier + ".png"), "IMAGE")