Change profile object UI #5796

example - https://imgchest.com/p/qb4zwj6ad4j
1) moved profile object selection to the same row as the profile type selection, so it will more noticable that they're related
2) added object requirements in the description
3) filtered only mesh objects to appear in the dropdown
This commit is contained in:
Andrej730
2024-11-25 16:45:30 +05:00
parent fc736f725c
commit 29f9f04d92
2 changed files with 15 additions and 5 deletions
+7 -1
View File
@@ -73,7 +73,13 @@ class BIMProfileProperties(PropertyGroup):
update=lambda self, context: bpy.ops.bim.load_profiles(),
)
object_to_profile: PointerProperty(
name="Object to profile", type=bpy.types.Object, description="Object to copy the mesh to a profile"
name="Object to profile",
type=bpy.types.Object,
description=(
"Optional mesh object to use as a source for a new arbitrary profile.\n"
"Object must be a closed mesh and have at least 1 face"
),
poll=lambda self, obj: obj.type == "MESH",
)
+8 -4
View File
@@ -71,12 +71,16 @@ class BIM_PT_profiles(Panel):
return
row = self.layout.row(align=True)
row.prop(self.props, "profile_classes", text="")
if self.props.profile_classes == "IfcArbitraryClosedProfileDef":
split = row.split(factor=0.5, align=True)
row = split.row(align=True)
row.prop(self.props, "profile_classes", text="")
row = split.row(align=True)
row.prop(self.props, "object_to_profile", text="")
else:
row.prop(self.props, "profile_classes", text="")
row.operator("bim.add_profile_def", text="", icon="ADD")
row.operator("bim.duplicate_profile_def", icon="DUPLICATE", text="")
if self.props.profile_classes == "IfcArbitraryClosedProfileDef":
row = self.layout.row(align=True)
row.prop(self.props, "object_to_profile", text="Create From")
self.layout.template_list(
"BIM_UL_profiles",