bim.resize_to_storey - document

This commit is contained in:
Andrej730
2024-10-22 11:40:11 +05:00
parent bcf54b643d
commit 5c08b8f22d
2 changed files with 15 additions and 1 deletions
@@ -95,6 +95,11 @@ class SnapSpacesTogether(bpy.types.Operator):
class ResizeToStorey(bpy.types.Operator, tool.Ifc.Operator):
bl_idname = "bim.resize_to_storey"
bl_label = "Resize To Storey"
bl_description = (
"Change object's origin to the bottom, move object to it's storey elevation and scale object to storey height.\n"
"Storey height is based on the provided number of storeys above object's storey.\n"
"If object's storey is the last storey, operator will have no effect"
)
bl_options = {"REGISTER", "UNDO"}
total_storeys: bpy.props.IntProperty()
@@ -104,6 +109,11 @@ class ResizeToStorey(bpy.types.Operator, tool.Ifc.Operator):
def _execute(self, context):
for obj in context.selected_objects:
if not (element := tool.Ifc.get_entity(obj)):
continue
if element.HasOpenings:
self.report({"ERROR"}, f"Object '{obj.name}', scaling is not supported.")
continue
core.resize_to_storey(tool.Misc, obj=obj, total_storeys=self.total_storeys)
+5 -1
View File
@@ -32,7 +32,11 @@ from bpy.props import (
class BIMMiscProperties(PropertyGroup):
total_storeys: IntProperty(name="Total Storeys", default=1)
total_storeys: IntProperty(
name="Total Storeys",
description="Number of storeys above object's storey to take into account for resizing",
default=1,
)
override_colour: FloatVectorProperty(
name="Override Colour", subtype="COLOR", default=(1, 0, 0, 1), min=0.0, max=1.0, size=4
)