[feat] add full element icons

- add more element icons. now element icons is not problem.
- change icon load strategy. now icon is loaded outside plugin. this operations might slow down blender but now I can apply my custom map to some operators to get better using experience.
- use new element icons to decorate some group name to let user know what this group stands for.
This commit is contained in:
2023-01-30 11:12:15 +08:00
parent 8d7a982e50
commit 807e006245
21 changed files with 40 additions and 14 deletions

View File

@ -1,5 +1,5 @@
import bpy, mathutils
from . import UTILS_constants, UTILS_functions
from . import UTILS_constants, UTILS_functions, UTILS_icons_manager
# ================================================= actual add
@ -12,7 +12,12 @@ class BALLANCE_OT_add_components(bpy.types.Operator):
elements_type: bpy.props.EnumProperty(
name="Type",
description="This element type",
items=tuple(map(lambda x: (x, x, ""), UTILS_constants.bmfile_componentList)),
#items=tuple(map(lambda x: (x, x, ""), UTILS_constants.bmfile_componentList)),
items=tuple(
# token, display name, descriptions, icon, index
(blk, blk, "", UTILS_icons_manager.get_element_icon(blk), idx)
for idx, blk in enumerate(UTILS_constants.bmfile_componentList)
),
)
attentionElements = ("PC_TwoFlames", "PR_Resetpoint")