diff --git a/src/blenderbim/blenderbim/bim/module/model/array.py b/src/blenderbim/blenderbim/bim/module/model/array.py index 513fed4b81..42851123f3 100644 --- a/src/blenderbim/blenderbim/bim/module/model/array.py +++ b/src/blenderbim/blenderbim/bim/module/model/array.py @@ -42,7 +42,7 @@ class AddArray(bpy.types.Operator, tool.Ifc.Operator): "z": 0.0, "use_local_space": True, "sync_children": False, - "dimension_input_type": "Increment", + "method": "OFFSET", } pset = ifcopenshell.util.element.get_pset(element, "BBIM_Array") @@ -91,7 +91,7 @@ class EnableEditingArray(bpy.types.Operator, tool.Ifc.Operator): props.z = data["z"] props.use_local_space = data.get("use_local_space", False) props.sync_children = data.get("sync_children", False) - props.dimension_input_type = data.get("dimension_input_type", "Increment") + props.method = data.get("method", "OFFSET") props.is_editing = self.item return {"FINISHED"} @@ -117,7 +117,7 @@ class EditArray(bpy.types.Operator, tool.Ifc.Operator): "z": props.z, "use_local_space": props.use_local_space, "sync_children": props.sync_children, - "dimension_input_type": props.dimension_input_type, + "method": props.method, } props.is_editing = -1 diff --git a/src/blenderbim/blenderbim/bim/module/model/prop.py b/src/blenderbim/blenderbim/bim/module/model/prop.py index 077fe02f85..35b084c5cb 100644 --- a/src/blenderbim/blenderbim/bim/module/model/prop.py +++ b/src/blenderbim/blenderbim/bim/module/model/prop.py @@ -156,18 +156,15 @@ class BIMArrayProperties(PropertyGroup): description="Use local space for array items offset instead of world space", default=True, ) - dimension_input_type: bpy.props.EnumProperty( - items=( - ("Increment", "Increment", ""), - ("Total", "Total", ""), - ), - name="Type of input dimension", - default="Increment", + method: bpy.props.EnumProperty( + items=(("OFFSET", "Offset", ""), ("DISTRIBUTE", "Distribute", "")), + name="Method", + default="OFFSET", ) sync_children: bpy.props.BoolProperty( name="Sync Children", - description="Keep children objects in sync with parent object", - default = False, + description="Regenerate all children based on the parent object", + default=False, ) diff --git a/src/blenderbim/blenderbim/bim/module/model/ui.py b/src/blenderbim/blenderbim/bim/module/model/ui.py index 65638465c0..a3d9c12617 100644 --- a/src/blenderbim/blenderbim/bim/module/model/ui.py +++ b/src/blenderbim/blenderbim/bim/module/model/ui.py @@ -171,7 +171,7 @@ class BIM_PT_array(bpy.types.Panel): row.operator("bim.edit_array", icon="CHECKMARK", text="").item = i row.operator("bim.disable_editing_array", icon="CANCEL", text="") row = box.row(align=True) - row.prop(props, "dimension_input_type") + row.prop(props, "method") row = box.row(align=True) row.prop(props, "use_local_space") row.prop(props, "sync_children") @@ -185,18 +185,15 @@ class BIM_PT_array(bpy.types.Panel): row = col.row(align=True) row.prop(props, "z") row.operator("bim.input_cursor_z_array", icon="CURSOR", text="") - else: row = box.row(align=True) - row.label(text=f"{array['count']} Items", icon="MOD_ARRAY") + name = f"{array['count']} Items ({array.get('method', 'OFFSET').capitalize()})" + row.label(text=name, icon="MOD_ARRAY") row.operator("bim.enable_editing_array", icon="GREASEPENCIL", text="").item = i row.operator("bim.remove_array", icon="X", text="").item = i row = box.row(align=True) - row.label(text=f"Dimension input type: {array.get('dimension_input_type', 'Increment')}") - row = box.row(align=True) - row.label(text=f"Use Local Space: {array.get('use_local_space', False)}") - row = box.row(align=True) - row.label(text=f"X: {array['x']}") + icon = "EMPTY_ARROWS" if array.get("use_local_space", False) else "EMPTY_AXIS" + row.label(text=f"X: {array['x']}", icon=icon) row.label(text=f"Y: {array['y']}") row.label(text=f"Z: {array['z']}") else: diff --git a/src/blenderbim/blenderbim/tool/model.py b/src/blenderbim/blenderbim/tool/model.py index 8de66bc1c7..167ce8d9e2 100644 --- a/src/blenderbim/blenderbim/tool/model.py +++ b/src/blenderbim/blenderbim/tool/model.py @@ -421,13 +421,14 @@ class Model(blenderbim.core.tool.Model): obj = tool.Ifc.get_object(element) if obj: tool.Geometry.delete_ifc_object(obj) + array["children"].clear() child_i = 0 existing_children = set(array["children"]) total_existing_children = len(array["children"]) children_elements = [] children_objs = [] - if array["dimension_input_type"] == "Total": + if array["method"] == "DISTRIBUTE": divider = 1 if ((array["count"] - 1) == 0) else (array["count"] - 1) base_offset = Vector([array["x"] / divider, array["y"] / divider, array["z"] / divider]) * unit_scale else: