Node2Code: Turn any node shader into a custom addon

Are two seperate nodegroups in a shader supported?
It gives me an error:
Traceback (most recent call last):
File “C:\Users\Flatron\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\”, line 216, in execute[2], group2.inputs[5])
NameError: name ‘group2’ is not defined

In the generated code, the code for this second nodegroup starts with:
group_data1 =“ShaderNodeTree”, name=“Albedo_Variation”)

It’s not a group in a group.

Could you send me a PM on here or email me directly (email address in the documentation) with the script attached so I can confirm some details?

1 Like

UPDATE: Have found the problem and pushed a fix v1.11, both 2.79 and 2.80 scripts added :slight_smile:


Well, that is really premium service. I just e-mail-ed you a few minutes ago.
Thanks again!


When this makes an addon for a node group, does that addon just allow you to spawn that node group into any Blend, or does it ‘bake’ it into a custom Python node?

The generated addon spawns in the selected nodes/node groups natively, as they would be normally in blender. No python. No baking. One click deployment. :slight_smile:

Hi everyone, have just added gumroad for those of you who prefer that.

Gumroad: [10% off with code save10]

What’s happening now:

I’m currently preparing to restructure the addon architecture to handle saving images as part of addons (so the images come preloaded when you click deploy).
This restructuring will also include the bonus’s of:

  • Automatic saving and zipping of addon (this means you won’t have to manually save anymore)

I’m hoping to also address the framing issue, however if the positioning problem is just an issue with 2.79 and not 2.80, then I will likely move on to working on more meaningful examples.

V1.2 with Massive Architecture Overhaul is now available!

New Improvements:

  • Texture packing supported
  • Frames supported
  • Automatic addon zipping
  • 50% Reduced file size
  • Speed upgrade
  • Better workflow
  • Improved user interface
  • Product facelift
  • Better explanation images
  • More customization guides added to roadmap

Other updates:

  • Gumroad product link fixed and discount field added!

What’s coming next:

  • 2 new guides for adding custom icons + changing addon panel location
  • Compositing Support
1 Like

Ahw, that’s pretty amazing.
Cant wait for the Compositing support. I have plans for that :smiley: in the ev express addon.

1 Like

v1.3 now available on all platforms

New Changes:


  • Guide for adding custom image icons added
  • Guide for changing panel location added
  • Enhanced guide of adding Blender icons to EnumProperty items (1 icon per option)
  • Documentation updated with more thorough walkthrough of combining addons
  • UI prompt added when combining multiple addons without specifying a name

Pricing Update:

  • Standard version of the addon has been reduced by $5

What’s coming next:

  • Compositing Support

v1.4 now available on all platforms

New Changes:

  • Compositing support added
  • Original Material settings now copied across with node groups
  • Documentation updated
  • Fixed minor naming bug (caused issue with loading addons)
  • Added new goal to allow for editing of addon properties within the Node2Code panel

What’s next:

  • Property editing
  • World node support
  • Texture node support

Enjoy :smiley:

1 Like

v1.5 is now available

New Changes:


  • Property Editing through the UI now possible
  • Documentation updates

What’s next:

  • World node support
  • Texture node support

Other news:

1 Like

v1.6 is now available

New Changes:

  • Automatic removal of unused node trees
  • Automatic reusing of node trees
  • only used images are packed / saved (should reduce addon size)
  • broken image links are automatically removed
  • color ramps now fully supported
  • generated addons get their own tab
  • only N2C texts can be successfully exported
  • overwrite option added
  • compositing image node fixes
  • addon now packaged in a zip file so you don’t need to extract anything
  • world support

What’s next:

  • Texture node support

Potential future features:

  • Animation node support
  • Addon operators being added to the Shift + A menu
1 Like

Where’s 1.6?..
Only 1.4 in gumroad.

Have just updated the links :slight_smile:

1 Like

any idea how can textures be saved into image texture nodes when exporting the addon?

The addon will automatically pack all relevant image textures. You don’t need to do anything here apart from make sure you are using the latest version. If you are thinking of full addon customisation I would recommend the extended edition as this includes step by step guides.

Node2Code just received a big update (v1.7)!

  • Menu entry exporting is now available (shift + a menu)
  • Visual Overhaul (cleaner look)
  • Better Explanation on the product page
  • Improved Documentation
  • Minor bug fixes

Update is free for all previous customers :smiley:



Hello. I would like to know if this works with Animation Nodes, which uses a similar workspace as shading or compositor. If not, could you consider to give it support?