[Add-on] NodeIO


(Jacob Morris) #1

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.


(Benny G) #2

Thanks works fine with cycles materials , Thanks :eyebrowlift2:


(zeffii) #3

interesting.

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


(Jacob Morris) #4

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.


(Jacob Morris) #5

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.


(Jacob Morris) #6

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.


(Jacob Morris) #7

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.


(MmAaXx) #8

thanks a lot!


(MmAaXx) #9

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


(Jacob Morris) #10

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


(Jacob Morris) #11

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.


(MmAaXx) #12

thankyou for your time.


(Jacob Morris) #13

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


(MmAaXx) #14

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


(Jacob Morris) #15

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


(MmAaXx) #16

sure, here is the link!
>LINK<

thankyou!


(Jacob Morris) #17

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?


(Jacob Morris) #18

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.


(urkokul) #19

Thanks a lot


(MmAaXx) #20

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