mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-30 08:33:10 +00:00
See #2898. Fix bug where UI data was not refreshed when you switched active materials.
This commit is contained in:
@@ -101,6 +101,10 @@ def active_object_callback():
|
|||||||
refresh_ui_data()
|
refresh_ui_data()
|
||||||
|
|
||||||
|
|
||||||
|
def active_material_index_callback(obj, data):
|
||||||
|
refresh_ui_data()
|
||||||
|
|
||||||
|
|
||||||
def subscribe_to(object, data_path, callback):
|
def subscribe_to(object, data_path, callback):
|
||||||
try:
|
try:
|
||||||
subscribe_to = object.path_resolve(data_path, False)
|
subscribe_to = object.path_resolve(data_path, False)
|
||||||
|
|||||||
@@ -320,6 +320,7 @@ class IfcStore:
|
|||||||
blenderbim.bim.handler.subscribe_to(obj, "diffuse_color", blenderbim.bim.handler.color_callback)
|
blenderbim.bim.handler.subscribe_to(obj, "diffuse_color", blenderbim.bim.handler.color_callback)
|
||||||
elif isinstance(obj, bpy.types.Object):
|
elif isinstance(obj, bpy.types.Object):
|
||||||
blenderbim.bim.handler.subscribe_to(obj, "mode", blenderbim.bim.handler.mode_callback)
|
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:
|
for listener in IfcStore.element_listeners:
|
||||||
listener(element, obj)
|
listener(element, obj)
|
||||||
|
|||||||
Reference in New Issue
Block a user