-
-
Save zeffii/1049d2d8fd713eb581da to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from mathutils import Vector, Euler | |
def sv_main(verts=[], indices=[], translate=[]): | |
in_sockets = [ | |
['v', 'verts', verts], | |
['s', 'indices', indices], | |
['v', 'translate', translate]] | |
out_sockets = [ | |
['v', 'Verts', [verts]] | |
] | |
if not verts: | |
return in_sockets, out_sockets | |
# yes, ugly.. | |
if indices and translate: | |
if indices[0] and len(indices[0][0]) > 0: | |
if translate[0] and len(translate[0][0]) > 0: | |
indices = indices[0][0] | |
translate = translate[0][0] | |
else: | |
return in_sockets, out_sockets | |
# reaches here only if conditions are met. | |
v_out = [] | |
for idx, v in enumerate(verts[0]): | |
print(idx) | |
if idx in indices: | |
print('in indices') | |
v = Vector(v) + Vector(translate) | |
v = v[:] | |
v_out.append(v) | |
out_sockets[0][2] = [v_out] | |
return in_sockets, out_sockets |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment