conform hierarchy : first working version for collection. UI wip

This commit is contained in:
pullusb
2025-07-24 16:55:06 +02:00
parent 22e97d63ca
commit e98300ac44
3 changed files with 264 additions and 74 deletions
+6 -6
View File
@@ -420,9 +420,9 @@ def show_and_active_object(obj, make_active=True, select=True, unhide=True):
if select:
obj.select_set(True)
def show_message_box(_message = "", _title = "Message Box", _icon = 'INFO'):
def show_message_box(message = "", title = "Message Box", icon = 'INFO'):
'''Show message box with element passed as string or list
if _message if a list of lists:
if message is a list of lists:
if sublist have 2 element:
considered a label [text, icon]
if sublist have 3 element:
@@ -433,7 +433,7 @@ def show_message_box(_message = "", _title = "Message Box", _icon = 'INFO'):
def draw(self, context):
layout = self.layout
for l in _message:
for l in message:
if isinstance(l, str):
layout.label(text=l)
elif len(l) == 2: # label with icon
@@ -446,9 +446,9 @@ def show_message_box(_message = "", _title = "Message Box", _icon = 'INFO'):
row.label(text=l[2], icon=l[3])
row.prop(l[0], l[1], text='')
if isinstance(_message, str):
_message = [_message]
bpy.context.window_manager.popup_menu(draw, title = _title, icon = _icon)
if isinstance(message, str):
message = [message]
bpy.context.window_manager.popup_menu(draw, title = title, icon = icon)
def get_rightmost_number_in_string(string) -> str: