Fix #1443 bug where UI update of type name was not refreshed when you changed it

This commit is contained in:
Dion Moult
2021-04-26 19:46:27 +10:00
parent 57396e1bb9
commit 22e087c82a
3 changed files with 4 additions and 0 deletions
Binary file not shown.
+3
View File
@@ -6,6 +6,7 @@ import ifcopenshell.api.owner.settings
from bpy.app.handlers import persistent
from blenderbim.bim.ifc import IfcStore
from ifcopenshell.api.attribute.data import Data as AttributeData
from ifcopenshell.api.type.data import Data as TypeData
def mode_callback(obj, data):
@@ -33,6 +34,8 @@ def name_callback(obj, data):
if element.is_a("IfcSpatialStructureElement") or (hasattr(element, "IsDecomposedBy") and element.IsDecomposedBy):
collection = obj.users_collection[0]
collection.name = obj.name
if element.is_a("IfcTypeProduct"):
TypeData.purge()
element.Name = "/".join(obj.name.split("/")[1:])
AttributeData.load(IfcStore.get_file(), obj.BIMObjectProperties.ifc_definition_id)
@@ -106,6 +106,7 @@ class EnableEditingCostItems(bpy.types.Operator):
import aud
device = aud.Device()
# chaching.mp3 is by Lucish_ CC-BY-3.0 https://freesound.org/people/Lucish_/sounds/554841/
sound = aud.Sound(os.path.join(context.scene.BIMProperties.data_dir, "chaching.mp3"))
handle = device.play(sound)
sound_buffered = aud.Sound.buffer(sound)