mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 18:16:40 +00:00
change .is_editing type for ifc modifiers to boolean
This commit is contained in:
@@ -565,7 +565,7 @@ class CancelEditingDoor(bpy.types.Operator, tool.Ifc.Operator):
|
||||
should_sync_changes_first=False,
|
||||
)
|
||||
|
||||
props.is_editing = -1
|
||||
props.is_editing = False
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -586,7 +586,7 @@ class FinishEditingDoor(bpy.types.Operator, tool.Ifc.Operator):
|
||||
door_data["lining_properties"] = lining_props
|
||||
door_data["panel_properties"] = panel_props
|
||||
|
||||
props.is_editing = -1
|
||||
props.is_editing = False
|
||||
|
||||
update_door_modifier_representation(context)
|
||||
|
||||
@@ -611,7 +611,7 @@ class EnableEditingDoor(bpy.types.Operator, tool.Ifc.Operator):
|
||||
|
||||
# required since we could load pset from .ifc and BIMDoorProperties won't be set
|
||||
props.set_props_kwargs_from_ifc_data(data)
|
||||
props.is_editing = 1
|
||||
props.is_editing = True
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -624,7 +624,7 @@ class RemoveDoor(bpy.types.Operator, tool.Ifc.Operator):
|
||||
obj = context.active_object
|
||||
props = obj.BIMDoorProperties
|
||||
element = tool.Ifc.get_entity(obj)
|
||||
obj.BIMDoorProperties.is_editing = -1
|
||||
obj.BIMDoorProperties.is_editing = False
|
||||
|
||||
pset = tool.Pset.get_element_pset(element, "BBIM_Door")
|
||||
ifcopenshell.api.run("pset.remove_pset", tool.Ifc.get(), pset=pset)
|
||||
|
||||
@@ -190,7 +190,7 @@ class BIMStairProperties(PropertyGroup):
|
||||
("GENERIC", "Generic", ""),
|
||||
)
|
||||
|
||||
is_editing: bpy.props.IntProperty(default=-1)
|
||||
is_editing: bpy.props.BoolProperty(default=False)
|
||||
width: bpy.props.FloatProperty(name="Width", default=1.2, soft_min=0.01, subtype="DISTANCE")
|
||||
height: bpy.props.FloatProperty(name="Height", default=1.0, soft_min=0.01, subtype="DISTANCE")
|
||||
number_of_treads: bpy.props.IntProperty(name="Number of treads", default=6, soft_min=1)
|
||||
@@ -280,7 +280,7 @@ class BIMWindowProperties(PropertyGroup):
|
||||
}
|
||||
# fmt: on
|
||||
|
||||
is_editing: bpy.props.IntProperty(default=-1)
|
||||
is_editing: bpy.props.BoolProperty(default=False)
|
||||
window_type: bpy.props.EnumProperty(
|
||||
name="Window Type", items=window_types, default="SINGLE_PANEL", update=window_type_prop_update
|
||||
)
|
||||
@@ -409,7 +409,7 @@ class BIMDoorProperties(PropertyGroup):
|
||||
("DOUBLE_DOOR_SLIDING", "DOUBLE_DOOR_SLIDING", ""),
|
||||
)
|
||||
|
||||
is_editing: bpy.props.IntProperty(default=-1)
|
||||
is_editing: bpy.props.BoolProperty(default=False)
|
||||
door_type: bpy.props.EnumProperty(name="Door Operation Type", items=door_types, default="SINGLE_SWING_LEFT")
|
||||
overall_height: bpy.props.FloatProperty(name="Overall Height", default=2.0, subtype="DISTANCE")
|
||||
overall_width: bpy.props.FloatProperty(name="Overall Width", default=0.9, subtype="DISTANCE")
|
||||
|
||||
@@ -394,7 +394,7 @@ class CancelEditingStair(bpy.types.Operator, tool.Ifc.Operator):
|
||||
props.set_props_kwargs_from_ifc_data(data)
|
||||
update_stair_modifier(context)
|
||||
|
||||
props.is_editing = -1
|
||||
props.is_editing = False
|
||||
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -410,7 +410,7 @@ class FinishEditingStair(bpy.types.Operator, tool.Ifc.Operator):
|
||||
props = obj.BIMStairProperties
|
||||
|
||||
data = props.get_props_kwargs(convert_to_project_units=True)
|
||||
props.is_editing = -1
|
||||
props.is_editing = False
|
||||
update_stair_modifier(context)
|
||||
|
||||
pset = tool.Pset.get_element_pset(element, "BBIM_Stair")
|
||||
@@ -434,7 +434,7 @@ class EnableEditingStair(bpy.types.Operator, tool.Ifc.Operator):
|
||||
data = json.loads(ifcopenshell.util.element.get_pset(element, "BBIM_Stair", "Data"))
|
||||
# required since we could load pset from .ifc and BIMStairProperties won't be set
|
||||
props.set_props_kwargs_from_ifc_data(data)
|
||||
props.is_editing = 1
|
||||
props.is_editing = True
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -447,7 +447,7 @@ class RemoveStair(bpy.types.Operator, tool.Ifc.Operator):
|
||||
obj = context.active_object
|
||||
props = obj.BIMStairProperties
|
||||
element = tool.Ifc.get_entity(obj)
|
||||
obj.BIMStairProperties.is_editing = -1
|
||||
obj.BIMStairProperties.is_editing = False
|
||||
|
||||
pset = tool.Pset.get_element_pset(element, "BBIM_Stair")
|
||||
ifcopenshell.api.run("pset.remove_pset", tool.Ifc.get(), pset=pset)
|
||||
|
||||
@@ -257,7 +257,7 @@ class BIM_PT_stair(bpy.types.Panel):
|
||||
row.label(text="Stair parameters", icon="IPO_CONSTANT")
|
||||
|
||||
stair_data = StairData.data["parameters"]["data_dict"]
|
||||
if props.is_editing != -1:
|
||||
if props.is_editing:
|
||||
row = self.layout.row(align=True)
|
||||
row.operator("bim.finish_editing_stair", icon="CHECKMARK", text="Finish Editing")
|
||||
row.operator("bim.cancel_editing_stair", icon="CANCEL", text="")
|
||||
@@ -357,7 +357,7 @@ class BIM_PT_window(bpy.types.Panel):
|
||||
window_data = WindowData.data["parameters"]["data_dict"]
|
||||
number_of_panels, panels_data = props.window_types_panels[props.window_type]
|
||||
|
||||
if props.is_editing != -1:
|
||||
if props.is_editing:
|
||||
row = self.layout.row(align=True)
|
||||
row.operator("bim.finish_editing_window", icon="CHECKMARK", text="Finish Editing")
|
||||
row.operator("bim.cancel_editing_window", icon="CANCEL", text="")
|
||||
@@ -472,7 +472,7 @@ class BIM_PT_door(bpy.types.Panel):
|
||||
|
||||
door_data = DoorData.data["parameters"]["data_dict"]
|
||||
|
||||
if props.is_editing != -1:
|
||||
if props.is_editing:
|
||||
row = self.layout.row(align=True)
|
||||
row.operator("bim.finish_editing_door", icon="CHECKMARK", text="Finish Editing")
|
||||
row.operator("bim.cancel_editing_door", icon="CANCEL", text="")
|
||||
|
||||
@@ -531,7 +531,7 @@ class CancelEditingWindow(bpy.types.Operator, tool.Ifc.Operator):
|
||||
should_sync_changes_first=False,
|
||||
)
|
||||
|
||||
props.is_editing = -1
|
||||
props.is_editing = False
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -552,7 +552,7 @@ class FinishEditingWindow(bpy.types.Operator, tool.Ifc.Operator):
|
||||
window_data["lining_properties"] = lining_props
|
||||
window_data["panel_properties"] = panel_props
|
||||
|
||||
props.is_editing = -1
|
||||
props.is_editing = False
|
||||
|
||||
update_window_modifier_representation(context)
|
||||
|
||||
@@ -578,7 +578,7 @@ class EnableEditingWindow(bpy.types.Operator, tool.Ifc.Operator):
|
||||
# required since we could load pset from .ifc and BIMWindowProperties won't be set
|
||||
props.set_props_kwargs_from_ifc_data(data)
|
||||
|
||||
props.is_editing = 1
|
||||
props.is_editing = True
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -591,7 +591,7 @@ class RemoveWindow(bpy.types.Operator, tool.Ifc.Operator):
|
||||
obj = context.active_object
|
||||
props = obj.BIMWindowProperties
|
||||
element = tool.Ifc.get_entity(obj)
|
||||
obj.BIMWindowProperties.is_editing = -1
|
||||
obj.BIMWindowProperties.is_editing = False
|
||||
|
||||
pset = tool.Pset.get_element_pset(element, "BBIM_Window")
|
||||
ifcopenshell.api.run("pset.remove_pset", tool.Ifc.get(), pset=pset)
|
||||
|
||||
Reference in New Issue
Block a user