Godot_bridge/addon/common/icons.py

17 lines
379 B
Python
Raw Normal View History

2023-03-29 10:43:53 +00:00
import bpy
import os
icons_collection = None
icons_directory = os.path.dirname(__file__)
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")