mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-11 14:22:33 +00:00
Fix #1608. Fix warnings when no people or organisations existed.
This commit is contained in:
@@ -4,6 +4,7 @@ import addon_utils
|
|||||||
import ifcopenshell.api.owner.settings
|
import ifcopenshell.api.owner.settings
|
||||||
from bpy.app.handlers import persistent
|
from bpy.app.handlers import persistent
|
||||||
from blenderbim.bim.ifc import IfcStore
|
from blenderbim.bim.ifc import IfcStore
|
||||||
|
from blenderbim.bim.module.owner.prop import getPersons, getOrganisations
|
||||||
from ifcopenshell.api.attribute.data import Data as AttributeData
|
from ifcopenshell.api.attribute.data import Data as AttributeData
|
||||||
from ifcopenshell.api.material.data import Data as MaterialData
|
from ifcopenshell.api.material.data import Data as MaterialData
|
||||||
from ifcopenshell.api.style.data import Data as StyleData
|
from ifcopenshell.api.style.data import Data as StyleData
|
||||||
@@ -211,12 +212,12 @@ def setDefaultProperties(scene):
|
|||||||
)
|
)
|
||||||
ifcopenshell.api.owner.settings.get_person = (
|
ifcopenshell.api.owner.settings.get_person = (
|
||||||
lambda ifc: ifc.by_id(int(bpy.context.scene.BIMOwnerProperties.user_person))
|
lambda ifc: ifc.by_id(int(bpy.context.scene.BIMOwnerProperties.user_person))
|
||||||
if bpy.context.scene.BIMOwnerProperties.user_person
|
if getPersons(None, bpy.context) and bpy.context.scene.BIMOwnerProperties.user_person
|
||||||
else None
|
else None
|
||||||
)
|
)
|
||||||
ifcopenshell.api.owner.settings.get_organisation = (
|
ifcopenshell.api.owner.settings.get_organisation = (
|
||||||
lambda ifc: ifc.by_id(int(bpy.context.scene.BIMOwnerProperties.user_organisation))
|
lambda ifc: ifc.by_id(int(bpy.context.scene.BIMOwnerProperties.user_organisation))
|
||||||
if bpy.context.scene.BIMOwnerProperties.user_organisation
|
if getOrganisations(None, bpy.context) and bpy.context.scene.BIMOwnerProperties.user_organisation
|
||||||
else None
|
else None
|
||||||
)
|
)
|
||||||
ifcopenshell.api.owner.settings.get_application = get_application
|
ifcopenshell.api.owner.settings.get_application = get_application
|
||||||
|
|||||||
Reference in New Issue
Block a user