2025-12-01

This commit is contained in:
2026-03-17 14:58:51 -06:00
parent 183e865f8b
commit 4b82b57113
6846 changed files with 954887 additions and 162606 deletions
+27
View File
@@ -0,0 +1,27 @@
# SPDX-FileCopyrightText: 2025 Blender Studio Tools Authors
#
# SPDX-License-Identifier: GPL-3.0-or-later
import bpy
import bpy.utils.previews
import os
icon_previews = {}
def register():
# register custom icons
dir = os.path.join(os.path.dirname(__file__), "icons")
pcoll = bpy.utils.previews.new()
for entry in os.scandir(dir):
if entry.name.endswith(".png"):
name = os.path.splitext(entry.name)[0]
pcoll.load(name.upper(), entry.path, "IMAGE")
global icon_previews
icon_previews["main"] = pcoll
def unregister():
# unregister custom icons
global icon_previews
for pcoll in icon_previews.values():
bpy.utils.previews.remove(pcoll)
icon_previews.clear()