# convert sverchok script node to script node lite

After updating blender I cant use a script node (SN) from someone else that I was using before. Now sverchok has script node lite (SNL). I dont know what I need to change for it to work, and cant find documentation on the changes either. (at the time of writing there's no documentation on the existence of SNL, just SN)

Somewhat related questions:

Is there a way to use Sverchok's ScriptNode without defining in_sockets? (links to SNL doc in a github issue)

Custom NodeTree and NodeCustomGroup and bpy.ops.node.tree_path_parent()

Has anyone started a project similar to Grasshopper (Rhino) for blender?

How do I build an object using Python and predetermined coordinates?

Can custom nodes be written for the compositor?

I found conversions other users have performed, and diffed the two versions to check the changes they made. They only seem to change the syntax of the input/output in such a way that sv_main is no longer used:

• every item in the lists in_sockets and out_sockets is now defined at the start inside bracketed (""") comments with the commands in and out
• after the in / out command the variable name is given, followed by the variable type
• the in variables also get a d default value, which was in sv_main before, and an n value of 1 or 2
• if the default value is [] then n=1 otherwise n=2 (I dont know the meaning of this)
• all code in sv_main is just executed at the end of the script and the def and return lines are just deleted

For instance

in_sockets = [
['s', 'maximum branches', npoints],
['s', 'branch length', dist],
['s', 'minimum distance', min_dist],
['s', 'maximum distance', max_dist],
['v', 'tropism', trop],
['v', 'End Vertices',  verts_in],
['v', 'Start Vertices', verts_start]
]

def sv_main(npoints=100 , dist=0.05, min_dist=0.05, max_dist=2.0, tip_radius=0.01, trop=[], verts_in=[], verts_start=[]):
out_sockets = [
['v', 'Vertices', [verts_out]],
['s', 'Edges', [edges_out]],
['m', 'Leaf matrices', mats_out],
]
#some code
return in_sockets, out_sockets


Is converted to

"""
in npoints s d=100 n=2
in dist s d=0.05 n=2
in min_dist s d=0.05 n=2
in max_dist s d=2.0 n=2