Skip to content

Instantly share code, notes, and snippets.

@zeffii
Created May 19, 2014 17:48
Show Gist options
  • Save zeffii/a27e2ba87a05983b824a to your computer and use it in GitHub Desktop.
Save zeffii/a27e2ba87a05983b824a to your computer and use it in GitHub Desktop.
allows nested lists.
def sv_main(vc=[], vf=[]):
in_sockets = [
['v', 'vc', vc],
['v', 'vf', vf]]
edges_out = []
verts_out = []
for idx, vz in enumerate(vf[0]):
b = []
b.append(vz)
b.extend(vc[idx])
verts_out.append(b)
edges_out.append([(0,n+1) for n in range(len(b)-1)])
# out boilerplate
out_sockets = [
['v', 'Vecs', verts_out],
['s', 'Edges', edges_out]
]
return in_sockets, out_sockets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment