Property set templates attributes now show a tooltip on hover

This commit is contained in:
Gorgious
2022-10-31 19:34:59 +01:00
parent 7eefb3f62f
commit 84dde4c5c0
2 changed files with 35 additions and 9 deletions
@@ -19,6 +19,7 @@
import os
import bpy
import ifcopenshell
from ifcopenshell.util.doc import get_attribute_doc
from blenderbim.bim.module.pset_template.data import PsetTemplatesData
from blenderbim.bim.prop import StrProperty, Attribute
from blenderbim.bim.ifc import IfcStore
@@ -111,11 +112,27 @@ def get_template_type(self, context):
class PsetTemplate(PropertyGroup):
global_id: StringProperty(name="Global ID")
name: StringProperty(name="Name")
description: StringProperty(name="Description")
template_type: EnumProperty(items=get_template_type, name="Template Type")
applicable_entity: StringProperty(name="Applicable Entity")
global_id: StringProperty(
name="Global ID",
description=get_attribute_doc("IFC4", "IfcPropertySetTemplate", "GlobalId"),
)
name: StringProperty(
name="Name",
description=get_attribute_doc("IFC4", "IfcPropertySetTemplate", "Name"),
)
description: StringProperty(
name="Description",
description=get_attribute_doc("IFC4", "IfcPropertySetTemplate", "Description"),
)
template_type: EnumProperty(
items=get_template_type,
name="Template Type",
description=get_attribute_doc("IFC4", "IfcPropertySetTemplate", "TemplateType"),
)
applicable_entity: StringProperty(
name="Applicable Entity",
description=get_attribute_doc("IFC4", "IfcPropertySetTemplate", "ApplicableEntity"),
)
class EnumerationValues(PropertyGroup):
@@ -126,9 +143,18 @@ class EnumerationValues(PropertyGroup):
class PropTemplate(PropertyGroup):
global_id: StringProperty(name="Global ID")
name: StringProperty(name="Name")
description: StringProperty(name="Description")
global_id: StringProperty(
name="Global ID",
description=get_attribute_doc("IFC4", "IfcPropertyTemplate", "GlobalId"),
)
name: StringProperty(
name="Name",
description=get_attribute_doc("IFC4", "IfcPropertyTemplate", "Name"),
)
description: StringProperty(
name="Description",
description=get_attribute_doc("IFC4", "IfcPropertyTemplate", "Description"),
)
primary_measure_type: EnumProperty(items=get_primary_measure_type, name="Primary Measure Type")
template_type: EnumProperty(
items=[("P_SINGLEVALUE", "P_SINGLEVALUE", ""), ("P_ENUMERATEDVALUE", "P_ENUMERATEDVALUE", "")],
+1 -1
View File
@@ -25,6 +25,7 @@ from ifcopenshell.util.doc import (
get_entity_doc,
get_property_set_doc,
get_type_doc,
get_attribute_doc,
)
from . import ifc
import blenderbim.tool as tool
@@ -406,7 +407,6 @@ def draw_custom_context_menu(self, context):
layout = self.layout
if isinstance(context.button_pointer, Attribute):
print(prop, prop_name, prop_value)
description = getattr(context.button_pointer, "description", None)
ifc_class = getattr(context.button_pointer, "ifc_class", "")
if ifc_class: