mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 17:58:20 +00:00
bim.attribute_search_values - support not just scene props
This commit is contained in:
@@ -131,7 +131,7 @@ def draw_attribute(
|
||||
op = layout.operator("bim.attribute_search_values", text="", icon="VIEWZOOM")
|
||||
op.attribute_name = attribute.name
|
||||
op.attribute_ifc_class = attribute.ifc_class
|
||||
op.data_path = attribute.path_from_id(value_name)
|
||||
op.data_path = tool.Blender.get_full_data_path(attribute, value_name)
|
||||
op.data_type = attribute.data_type
|
||||
|
||||
if attribute.is_optional:
|
||||
|
||||
@@ -1368,10 +1368,8 @@ class BIM_OT_attribute_search_values(bpy.types.Operator):
|
||||
@staticmethod
|
||||
def resolve_data_path(data_path: str) -> tuple[str, "Attribute"]:
|
||||
"""Resolve the data path of an object's attribute to get the attribute name and the object."""
|
||||
path_parts = data_path.split(".")
|
||||
obj_path = ".".join(path_parts[:-1])
|
||||
attr_name = path_parts[-1]
|
||||
attribute_obj = eval(f"bpy.context.scene.{obj_path}")
|
||||
attribute_obj, _, attr_name = data_path.rpartition(".")
|
||||
attribute_obj = eval(attribute_obj)
|
||||
return attr_name, attribute_obj
|
||||
|
||||
def invoke(self, context, event):
|
||||
|
||||
Reference in New Issue
Block a user