show occurrence name function in prefs only for custom name style

This commit is contained in:
Andrej730
2024-02-26 11:34:32 +05:00
parent 53e052eb77
commit ce8bdffe57
2 changed files with 7 additions and 3 deletions
@@ -99,7 +99,10 @@ class BIMModelProperties(PropertyGroup):
items=[("CLASS", "By Class", ""), ("TYPE", "By Type", ""), ("CUSTOM", "Custom", "")], items=[("CLASS", "By Class", ""), ("TYPE", "By Type", ""), ("CUSTOM", "Custom", "")],
name="Occurrence Name Style", name="Occurrence Name Style",
) )
occurrence_name_function: bpy.props.StringProperty(name="Occurrence Name Function") occurrence_name_function: bpy.props.StringProperty(
name="Occurrence Name Function",
description="Code that will be evaluated to generate occurrence name for CUSTOM occurrence name style",
)
getter_enum = {"ifc_class": get_ifc_class, "relating_type": get_relating_type_id} getter_enum = {"ifc_class": get_ifc_class, "relating_type": get_relating_type_id}
extrusion_depth: bpy.props.FloatProperty(min=0.001, default=42.0, subtype="DISTANCE") extrusion_depth: bpy.props.FloatProperty(min=0.001, default=42.0, subtype="DISTANCE")
cardinal_point: bpy.props.EnumProperty( cardinal_point: bpy.props.EnumProperty(
+1
View File
@@ -240,6 +240,7 @@ class BIM_ADDON_preferences(bpy.types.AddonPreferences):
row = layout.row() row = layout.row()
row.prop(context.scene.BIMModelProperties, "occurrence_name_style") row.prop(context.scene.BIMModelProperties, "occurrence_name_style")
if context.scene.BIMModelProperties == "CUSTOM":
row = layout.row() row = layout.row()
row.prop(context.scene.BIMModelProperties, "occurrence_name_function") row.prop(context.scene.BIMModelProperties, "occurrence_name_function")