[Add-on] NodeIO

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:

  • Cycles nodes
  • Blender Render nodes
  • Mitsuba nodes
  • Animation nodes (from the Animation Nodes add-on)
  • Sverchok (Group Support Added)

Latest Release
The project is hosted on GitHub
Issues can be reported here

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.

Thanks works fine with cycles materials , Thanks :eyebrowlift2:

interesting.

btw, for sverchok we started an ongoing implemention of IO through JSON 2 years ago. … i feel your pain :slight_smile:

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.

thanks a lot!

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

location: <unknown location>:-1

here is the dropbox link
FILE

Thought I had this fixed…I’ll hopefully have a patch up soon

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.

thankyou for your time.

Ok, I just added a fix that should workaround the bug within Blender. Groups are now importing properly.

uhmuhm I still got an error :frowning:

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

location: <unknown location>:-1

That’s odd, I tested several node setups and it worked fine for me. Could you attach a blend file?

sure, here is the link!
>LINK<

thankyou!

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.

Thanks a lot

wohoo!

for some reasons now it works!
anyway I always use absolute path, not a big fan of relative path.

THANKYOU!
you made my day