mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Fix #5955. Regression in 0983f812fd where you couldn't remove a style that wasn't being edited.
This commit is contained in:
@@ -80,7 +80,6 @@ class RemoveStyle(bpy.types.Operator, tool.Ifc.Operator):
|
||||
style: bpy.props.IntProperty()
|
||||
|
||||
def _execute(self, context):
|
||||
core.disable_editing_style(tool.Style) # So we don't end up soft-locking style edition
|
||||
core.remove_style(tool.Ifc, tool.Style, style=tool.Ifc.get().by_id(self.style), reload_styles_ui=True)
|
||||
|
||||
|
||||
|
||||
@@ -65,6 +65,8 @@ def remove_style(
|
||||
avoid unnecessary reloads.
|
||||
"""
|
||||
obj = ifc.get_object(style)
|
||||
if style_tool.is_editing_style() and obj == style_tool.get_currently_edited_material():
|
||||
style_tool.disable_editing()
|
||||
# Get style_type before removing object as later StylesData might fail to load
|
||||
# due object not yet removed completely.
|
||||
style_type = style_tool.get_active_style_type()
|
||||
|
||||
@@ -1013,6 +1013,7 @@ class Style:
|
||||
def get_uv_maps(cls, representation): pass
|
||||
def import_presentation_styles(cls, style_type): pass
|
||||
def import_surface_attributes(cls, style): pass
|
||||
def is_editing_style(cls): pass
|
||||
def is_editing_styles(cls): pass
|
||||
def reload_material_from_ifc(cls, obj): pass
|
||||
def is_style_side_attribute_edited(cls, style, new_attributes): pass
|
||||
|
||||
@@ -550,6 +550,10 @@ class Style(bonsai.core.tool.Style):
|
||||
def is_editing_styles(cls) -> bool:
|
||||
return bpy.context.scene.BIMStylesProperties.is_editing
|
||||
|
||||
@classmethod
|
||||
def is_editing_style(cls) -> bool:
|
||||
return bpy.context.scene.BIMStylesProperties.is_editing_style
|
||||
|
||||
@classmethod
|
||||
def select_elements(cls, elements: list[ifcopenshell.entity_instance]) -> None:
|
||||
for element in elements:
|
||||
|
||||
Reference in New Issue
Block a user