Add XML and glTF serializers to python

This commit is contained in:
Thomas Krijnen
2022-02-26 14:52:58 +01:00
parent ccc6f2c4c6
commit 8be79f9aee
3 changed files with 13 additions and 2 deletions
@@ -266,13 +266,20 @@ def wrap_buffer_creation(fn):
return inner
# Hdf- Xml- and glTF- serializers don't support writing to a buffer, only to filename
# so no wrap_buffer_creation() for these serializers
serializer_dict = {}
serializer_dict["obj"] = wrap_buffer_creation(ifcopenshell_wrapper.WaveFrontOBJSerializer)
serializer_dict["svg"] = wrap_buffer_creation(ifcopenshell_wrapper.SvgSerializer)
serializer_dict["xml"] = ifcopenshell_wrapper.XmlSerializer
serializer_dict["buffer"] = ifcopenshell_wrapper.buffer
# gltf and hdf5 availability depend on IfcOpenShell configuration settings
try:
serializer_dict["gltf"] = ifcopenshell_wrapper.GltfSerializer
except: pass
try:
# HdfSerializer doesn't support writing to a buffer (obviously) only to filename
# so no wrap_buffer_creation()
serializer_dict["hdf5"] = ifcopenshell_wrapper.HdfSerializer
except:
pass