Skip to content

Instantly share code, notes, and snippets.

@zeffii
Forked from anonymous/ui_ops4.py
Created May 6, 2014 13:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeffii/6e98e2210c2cfeb696e6 to your computer and use it in GitHub Desktop.
Save zeffii/6e98e2210c2cfeb696e6 to your computer and use it in GitHub Desktop.
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