NodeIO, previously MaterialIO, is an import/export add-on for node trees. NodeIO allows things such as materials and other node setups to be saved to a file so they can be used later or distributed without having to share the whole .blend file. Currently, four different node systems are supported:
This add-on is still in the early stage, especially when it comes to Animation nodes and Sverchok, so if anyone finds data that isn’t being exported and re-imported, or comes across any errors, then please report them at the link above.
I just added primary support for Sverchok, currently all nodes are importing and exporting and I believe all necessary information is being collected, but more testing is still needed.
Adding Sverchok wasn’t that bad, about 10 or so lines for initial support. The most interesting part is that SvGetPropNode and SvSetPropNode don’t play nice with inspect.getmembers(), which is what my code uses to get fields/attributes. Calling inspect.getmembers() with those nodes leads to a NameError, which is something that I didn’t encounter with any of the other node systems I worked on importing and exporting.
I made a couple commits over the last day that added support for Sverchok groups, as well as fixed some other things, so as far as I can tell everything within Mitsuba, Cycles, BI, Animation, and Sverchok is working correctly.
I just released a new version to fix to really bad bugs. The one which prevented node setups with groups from being exported and imported properly. The other was with exporting images with Relative filepaths, which wasn’t creating the new folder properly for the images.
just tested but I get an error while importing a simple material with a group
Traceback (most recent call last): File “C:\Users\Max\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\io_node.py”, line 716, in execute import_node_tree(self, context) File “C:\Users\Max\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\io_node.py”, line 567, in import_node_tree o = nt.nodes[link[0]].outputs[link[1]] IndexError: bpy_prop_collection[index]: index 1 out of range, size 1
Ok, this issue does not appear to be with my code, but rather a bug within Blender itself. I have figured out a workaround, but I still haven’t determined the best way to implement it.
Traceback (most recent call last): File “C:\Users\max\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\io_node.py”, line 716, in execute import_node_tree(self, context) File “C:\Users\max\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\io_node.py”, line 532, in import_node_tree i[‘values’][val_key])) File “<string>”, line 1, in <module> IndexError: bpy_prop_collection[index]: index 0 out of range, size 0
Ok, I was able to export and import this material without any errors. Could you post a link to the files that you are trying to import? Also, when you exported the material, did you use relative or absolute dependencies filepaths?
I just released version 0.5 which includes the workaround for the bug within Blender relating to importing groups. Zipped files are not automatically unzipped and imported, and dependencies are no longer duplicated within the file.