Переглянути джерело

Fix: Don't cause errors for un-jsonable attributes

I'm doing this because other addon developers are rude and add properties
to my objects without checking if they need them
This confuses my code and throws errors for some users.
Joseph Brandenburg 1 місяць тому
батько
коміт
288d3de6c1
1 змінених файлів з 2 додано та 1 видалено
  1. 2 1
      utilities/i_o.py

+ 2 - 1
utilities/i_o.py

@@ -424,7 +424,8 @@ def get_node_data(ui_node):
         if propname == "parent" and value:
             value = value.name
         if not is_jsonable(value):
-            raise RuntimeError(f"Could not export...  {ui_node.name}, {propname}, {type(value)}")
+            prOrange(f"Warning: Could not export...  {ui_node.name}, {propname}, {type(value)}")
+            continue
         if value is None:
             continue
         node_props[propname] = value