浏览代码

Fix: Mantis Version stuff messed up JSON I/O

also update version number
Joseph Brandenburg 8 月之前
父节点
当前提交
50fc3c29a9
共有 2 个文件被更改,包括 8 次插入2 次删除
  1. 1 1
      blender_manifest.toml
  2. 7 1
      i_o.py

+ 1 - 1
blender_manifest.toml

@@ -3,7 +3,7 @@ schema_version = "1.0.0"
 # Example of manifest file for a Blender extension
 # Change the values according to your extension
 id = "mantis"
-version = "0.9.4"
+version = "0.9.5"
 name = "Mantis"
 tagline = "Mantis is a rigging nodes toolkit"
 maintainer = "Nodespaghetti <josephbburg@protonmail.com>"

+ 7 - 1
i_o.py

@@ -90,10 +90,16 @@ def export_to_json(trees, path="", write_file=True, only_selected=False):
 
         tree_info, tree_in_out = {}, {}
         for propname  in dir(tree):
+            # if getattr(tree, propname):
+            #     pass
             if (propname in prop_ignore) or ( callable(getattr(tree, propname)) ):
                 continue
             if not is_jsonable( v := getattr(tree, propname)):
-                raise RuntimeError(f"Not JSON-able: {propname}, type: {type(v)}")
+                try:
+                    tree_info[propname] = tuple(v)
+                except Exception as e:
+                    print (e)
+                    raise RuntimeError(f"Not JSON-able: {propname}, type: {type(v)}")
             tree_info[propname] = v
         tree_info["name"] = tree.name