style: fixing tabs instead of 4 spaces indent

This commit is contained in:
yannk 2023-03-21 21:54:53 +01:00
parent 8a39fc5378
commit 314a219186
2 changed files with 19 additions and 19 deletions

View file

@ -5,25 +5,25 @@ icons_collection = None
icons_directory = os.path.dirname(__file__) icons_directory = os.path.dirname(__file__)
def initialize_icons_collection(): def initialize_icons_collection():
import bpy.utils.previews import bpy.utils.previews
global icons_collection global icons_collection
print("icons_collection : {}".format(icons_collection)) print("icons_collection : {}".format(icons_collection))
icons_collection = bpy.utils.previews.new() icons_collection = bpy.utils.previews.new()
def unload_icons(): def unload_icons():
bpy.utils.previews.remove(icons_collection) bpy.utils.previews.remove(icons_collection)
def get_icon_id(identifier): def get_icon_id(identifier):
# The initialize_icons_collection function needs to be called first. # The initialize_icons_collection function needs to be called first.
return get_icon(identifier).icon_id return get_icon(identifier).icon_id
def get_icon(identifier): def get_icon(identifier):
if identifier in icons_collection: if identifier in icons_collection:
return icons_collection[identifier] return icons_collection[identifier]
return icons_collection.load(identifier, os.path.join(icons_directory, identifier + ".png"), "IMAGE") return icons_collection.load(identifier, os.path.join(icons_directory, identifier + ".png"), "IMAGE")
def register_icons(): def register_icons():
initialize_icons_collection() initialize_icons_collection()
def unregister_icons(): def unregister_icons():
unload_icons() unload_icons()

View file

@ -3,16 +3,16 @@ import bpy
from .panel_main import KH_PT_panel_main from .panel_main import KH_PT_panel_main
classes = ( classes = (
KH_PT_panel_main, KH_PT_panel_main,
) )
def register_menus(): def register_menus():
from bpy.utils import register_class from bpy.utils import register_class
for cls in classes: for cls in classes:
register_class(cls) register_class(cls)
def unregister_menus(): def unregister_menus():
from bpy.utils import unregister_class from bpy.utils import unregister_class
for cls in classes: for cls in classes:
unregister_class(cls) unregister_class(cls)