mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 22:33:33 +00:00
Support int, float, bool and improve UX/UI
This commit is contained in:
@@ -38,8 +38,10 @@ def extract_docs(patcher, boilerplate_args=None):
|
|||||||
elif line.startswith(":param"):
|
elif line.startswith(":param"):
|
||||||
param_name = line.split(":")[1].strip().replace("param ", "")
|
param_name = line.split(":")[1].strip().replace("param ", "")
|
||||||
inputs[param_name]["description"] = line.split(":")[2].strip()
|
inputs[param_name]["description"] = line.split(":")[2].strip()
|
||||||
elif i >= 2:
|
elif i == 2:
|
||||||
description += line
|
description += line
|
||||||
|
elif i > 2:
|
||||||
|
description += "\n" + line
|
||||||
|
|
||||||
node_data["description"] = description.strip()
|
node_data["description"] = description.strip()
|
||||||
node_data["inputs"] = inputs
|
node_data["inputs"] = inputs
|
||||||
|
|||||||
@@ -66,7 +66,9 @@ class PopulatePatchArguments(bpy.types.Operator):
|
|||||||
bl_label = "Update IFC Patch arguments"
|
bl_label = "Update IFC Patch arguments"
|
||||||
TYPE_BINDINGS = {
|
TYPE_BINDINGS = {
|
||||||
"str": "string",
|
"str": "string",
|
||||||
|
"float": "float",
|
||||||
|
"int": "integer",
|
||||||
|
"bool": "boolean"
|
||||||
}
|
}
|
||||||
recipe: bpy.props.StringProperty()
|
recipe: bpy.props.StringProperty()
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ class BIM_PT_patch(bpy.types.Panel):
|
|||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
layout.use_property_split = True
|
layout.use_property_split = True
|
||||||
|
layout.use_property_decorate = False
|
||||||
|
|
||||||
scene = context.scene
|
scene = context.scene
|
||||||
props = scene.BIMPatchProperties
|
props = scene.BIMPatchProperties
|
||||||
@@ -44,6 +45,7 @@ class BIM_PT_patch(bpy.types.Panel):
|
|||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.prop(props, "ifc_patch_input")
|
row.prop(props, "ifc_patch_input")
|
||||||
row.operator("bim.select_ifc_patch_input", icon="FILE_FOLDER", text="")
|
row.operator("bim.select_ifc_patch_input", icon="FILE_FOLDER", text="")
|
||||||
|
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.prop(props, "ifc_patch_output")
|
row.prop(props, "ifc_patch_output")
|
||||||
row.operator("bim.select_ifc_patch_output", icon="FILE_FOLDER", text="")
|
row.operator("bim.select_ifc_patch_output", icon="FILE_FOLDER", text="")
|
||||||
@@ -53,12 +55,13 @@ class BIM_PT_patch(bpy.types.Panel):
|
|||||||
if props.ifc_patch_args_attr:
|
if props.ifc_patch_args_attr:
|
||||||
for attr in props.ifc_patch_args_attr:
|
for attr in props.ifc_patch_args_attr:
|
||||||
if attr.data_type == "string":
|
if attr.data_type == "string":
|
||||||
box = layout.box()
|
layout.row().prop(attr, "string_value", text=attr.description if attr.description else attr.name)
|
||||||
box.row().prop(attr, "string_value", text=attr.name)
|
elif attr.data_type == "float":
|
||||||
if attr.description != "":
|
layout.row().prop(attr, "float_value", text=attr.description if attr.description else attr.name)
|
||||||
row = box.row(align=True)
|
elif attr.data_type == "boolean":
|
||||||
row.label(text="Description")
|
layout.row().prop(attr, "bool_value", text=attr.description if attr.description else attr.name)
|
||||||
row.label(text = attr.description)
|
elif attr.data_type == "integer":
|
||||||
|
layout.row().prop(attr, "int_value", text=attr.description if attr.description else attr.name)
|
||||||
else:
|
else:
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.prop(props, "ifc_patch_args")
|
row.prop(props, "ifc_patch_args")
|
||||||
|
|||||||
Reference in New Issue
Block a user