See #2898. Fix bug where UI data was not refreshed when you switched active materials.

This commit is contained in:
Dion Moult
2023-03-26 18:06:25 +11:00
parent 15a1aa5355
commit fb3e4016ec
2 changed files with 5 additions and 0 deletions
+4
View File
@@ -101,6 +101,10 @@ def active_object_callback():
refresh_ui_data()
def active_material_index_callback(obj, data):
refresh_ui_data()
def subscribe_to(object, data_path, callback):
try:
subscribe_to = object.path_resolve(data_path, False)
+1
View File
@@ -320,6 +320,7 @@ class IfcStore:
blenderbim.bim.handler.subscribe_to(obj, "diffuse_color", blenderbim.bim.handler.color_callback)
elif isinstance(obj, bpy.types.Object):
blenderbim.bim.handler.subscribe_to(obj, "mode", blenderbim.bim.handler.mode_callback)
blenderbim.bim.handler.subscribe_to(obj, "active_material_index", blenderbim.bim.handler.active_material_index_callback)
for listener in IfcStore.element_listeners:
listener(element, obj)