OwnerData.can_add_user - remove as unnecessary

This commit is contained in:
Andrej730
2025-06-20 12:59:08 +05:00
parent 946cae4065
commit 4f03c7e03e
2 changed files with 1 additions and 6 deletions
@@ -179,7 +179,6 @@ class OwnerData:
cls.data = {
"user_person": cls.get_user_person(),
"user_organisation": cls.get_user_organisation(),
"can_add_user": cls.can_add_user(),
"users": cls.get_users(),
}
cls.is_loaded = True
@@ -192,10 +191,6 @@ class OwnerData:
def get_user_organisation(cls) -> tool.Blender.BLENDER_ENUM_ITEMS:
return [(str(p.id()), p[0] or "Unnamed", "") for p in tool.Ifc.get().by_type("IfcOrganization")]
@classmethod
def can_add_user(cls) -> bool:
return bool(tool.Ifc.get().by_type("IfcPerson") and tool.Ifc.get().by_type("IfcOrganization"))
@classmethod
def get_users(cls) -> list[dict[str, Any]]:
props = tool.Owner.get_owner_props()
+1 -1
View File
@@ -233,7 +233,7 @@ class BIM_PT_owner(bpy.types.Panel):
row = self.layout.row()
row.prop(props, "user_organisation")
if OwnerData.data["can_add_user"]:
if OwnerData.data["user_organisation"] and OwnerData.data["user_person"]:
row = self.layout.row()
op = row.operator("bim.add_person_and_organisation", icon="ADD")
op.person = int(props.user_person)