mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-17 22:11:36 +00:00
Prevent user from trying to assign material style if not style is selected
Possibly explains #6462
This commit is contained in:
@@ -876,6 +876,15 @@ class EditMaterialStyle(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
bl_label = "Edit Material Style"
|
bl_label = "Edit Material Style"
|
||||||
bl_options = {"REGISTER", "UNDO"}
|
bl_options = {"REGISTER", "UNDO"}
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def poll(cls, context):
|
||||||
|
props = tool.Material.get_material_props()
|
||||||
|
active_style = tool.Blender.get_enum_safe(props, "styles")
|
||||||
|
if not active_style:
|
||||||
|
cls.poll_message_set("No style selected to assign.")
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
def _execute(self, context):
|
def _execute(self, context):
|
||||||
props = tool.Material.get_material_props()
|
props = tool.Material.get_material_props()
|
||||||
ifc_file = tool.Ifc.get()
|
ifc_file = tool.Ifc.get()
|
||||||
|
|||||||
Reference in New Issue
Block a user