Users can now toggle hiding of null / empty properties in case they are powerusers

This commit is contained in:
Dion Moult
2021-03-03 21:50:13 +11:00
parent 0d3175c6ef
commit 9c7c3d7078
2 changed files with 8 additions and 3 deletions
@@ -39,7 +39,9 @@ def draw_psetqto_ui(context, pset_id, pset, props, layout, obj_type):
else:
has_props_displayed = False
for prop in pset["Properties"]:
if prop["value"] is None or prop["value"] == "":
if context.preferences.addons["blenderbim"].preferences.should_hide_empty_props and (
prop["value"] is None or prop["value"] == ""
):
continue
has_props_displayed = True
row = box.row(align=True)
@@ -177,7 +179,7 @@ class BIM_PT_material_psets(Panel):
if not props.ifc_definition_id:
return False
if IfcStore.get_file().schema == "IFC2X3":
return False # We don't support material psets in IFC2X3 because they suck
return False # We don't support material psets in IFC2X3 because they suck
if props.ifc_definition_id not in Data.products:
Data.load(props.ifc_definition_id)
if not Data.products[props.ifc_definition_id]:
+4 -1
View File
@@ -2,7 +2,7 @@ import os
import bpy
from . import ifc
from bpy.types import Panel
from bpy.props import StringProperty
from bpy.props import StringProperty, BoolProperty
class BIM_PT_drawings(Panel):
@@ -292,6 +292,7 @@ class BIM_ADDON_preferences(bpy.types.AddonPreferences):
)
svg_command: StringProperty(name="SVG Command", description="E.g. [['firefox-bin', path]]")
pdf_command: StringProperty(name="PDF Command", description="E.g. [['firefox-bin', path]]")
should_hide_empty_props: BoolProperty(name="Should Hide Empty Properties", default=True)
def draw(self, context):
layout = self.layout
@@ -309,6 +310,8 @@ class BIM_ADDON_preferences(bpy.types.AddonPreferences):
row.prop(self, "svg_command")
row = layout.row()
row.prop(self, "pdf_command")
row = layout.row()
row.prop(self, "should_hide_empty_props")
class BIM_PT_annotation_utilities(Panel):