mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 22:50:21 +00:00
OwnerData.can_add_user - remove as unnecessary
This commit is contained in:
@@ -179,7 +179,6 @@ class OwnerData:
|
|||||||
cls.data = {
|
cls.data = {
|
||||||
"user_person": cls.get_user_person(),
|
"user_person": cls.get_user_person(),
|
||||||
"user_organisation": cls.get_user_organisation(),
|
"user_organisation": cls.get_user_organisation(),
|
||||||
"can_add_user": cls.can_add_user(),
|
|
||||||
"users": cls.get_users(),
|
"users": cls.get_users(),
|
||||||
}
|
}
|
||||||
cls.is_loaded = True
|
cls.is_loaded = True
|
||||||
@@ -192,10 +191,6 @@ class OwnerData:
|
|||||||
def get_user_organisation(cls) -> tool.Blender.BLENDER_ENUM_ITEMS:
|
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")]
|
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
|
@classmethod
|
||||||
def get_users(cls) -> list[dict[str, Any]]:
|
def get_users(cls) -> list[dict[str, Any]]:
|
||||||
props = tool.Owner.get_owner_props()
|
props = tool.Owner.get_owner_props()
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ class BIM_PT_owner(bpy.types.Panel):
|
|||||||
row = self.layout.row()
|
row = self.layout.row()
|
||||||
row.prop(props, "user_organisation")
|
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()
|
row = self.layout.row()
|
||||||
op = row.operator("bim.add_person_and_organisation", icon="ADD")
|
op = row.operator("bim.add_person_and_organisation", icon="ADD")
|
||||||
op.person = int(props.user_person)
|
op.person = int(props.user_person)
|
||||||
|
|||||||
Reference in New Issue
Block a user