-
-
Save zeffii/6e98e2210c2cfeb696e6 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
def sv_main(items_in=[]): | |
in_sockets = [ | |
['v', 'items_in', items_in]] | |
Verts = [] | |
def func1(): | |
# directly from incoming Object_in socket. | |
sn = bpy.context.node | |
# safe? or return early | |
if not (sn.inputs and sn.inputs[0].links): | |
msg = 'no input socket, or nothing connected' | |
print(dir(sn)) | |
return | |
# will try to find objects_local in from_node, else return None | |
obj_in = sn.inputs[0].links[0].from_node | |
obj_names = obj_in.get('objects_local', None) | |
if not obj_names: | |
return | |
obj_names = ast.literal_eval(obj_names) | |
print(obj_names, type(obj_names)) | |
verts = SvGetSocketAnyType(sn, sn.inputs['items_in']) | |
print(type(verts)) | |
for idx, objname in enumerate(obj_names): | |
print(objname,'= ') | |
print(verts[idx]) | |
out_sockets = [['v', 'Verts', [Verts]]] | |
ui_operators = [['print_names', func1]] | |
return in_sockets, out_sockets, ui_operators |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment