Просмотр исходного кода

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 месяц назад
Родитель
Сommit
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:
         if propname == "parent" and value:
             value = value.name
             value = value.name
         if not is_jsonable(value):
         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:
         if value is None:
             continue
             continue
         node_props[propname] = value
         node_props[propname] = value