Skip to content

Commit 9a333ee

Browse files
committed
Fix for archipack metadata writing bad output
1 parent d511bee commit 9a333ee

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

export_datasmith.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1892,6 +1892,8 @@ def collect_object_metadata(obj_name, obj_type, obj):
18921892
for prop_name in obj_props:
18931893
if prop_name in {"_RNA_UI", "cycles", "cycles_visibility"}:
18941894
continue
1895+
if prop_name.startswith("archipack_"):
1896+
continue
18951897
if metadata is None:
18961898
names = (obj_type, obj_name)
18971899
metadata = Node("MetaData", {"name": "%s_%s"%names, "reference":"%s.%s"%names } )
@@ -1912,8 +1914,16 @@ def collect_object_metadata(obj_name, obj_type, obj):
19121914
continue
19131915
out_type = "String"
19141916
out_value = str(prop_value.to_dict())
1917+
# elif prop_type is list:
1918+
# archipack uses some list props, I don't think these are useful
1919+
# but we should check if there's something specific we should do.
19151920
else:
1916-
log.error("got metadata with type:%s" % prop_type)
1921+
#if we're here, we will just make sure that we won't write bad data
1922+
out_value = str(out_value)
1923+
out_value = out_value.replace("<", "&lt;")
1924+
out_value = out_value.replace(">", "&gt;")
1925+
out_value = out_value.replace('"', "&quot;")
1926+
log.error("%s: %s has unsupported metadata with type:%s" % (obj_type, obj_name, prop_type))
19171927

19181928
kvp = Node("KeyValueProperty", {"name": prop_name, "val": out_value, "type": out_type } )
19191929
metadata.push(kvp)

0 commit comments

Comments
 (0)