nortikin / sverchok

Sverchok
http://nortikin.github.io/sverchok/
GNU General Public License v3.0
2.23k stars 232 forks source link

update_py in node_Script.py evaluates empty sockets #94

Closed zeffii closed 10 years ago

zeffii commented 10 years ago

node_Script.py needs a small fix to send the default value if one of the sockets isn't connected. Either that or call node_func(**args)

This is a minor bug, but I hope to fix it later today.

zeffii commented 10 years ago

considering parsing the function argument list once,

import re
s = "def sv_main(num_verts=20, radius=5, danger_list=[]):"
r = re.compile('(?P<name>\w+)=(?P<defval>.*?|\[\])[,\)]')
k = [m.groupdict() for m in r.finditer(s)]
print(k)
>>> [
  {'defval': '20', 'name': 'num_verts'}, 
  {'defval': '5', 'name': 'radius'}, 
  {'defval': '[]', 'name': 'danger_list'}
]
nortikin commented 10 years ago

script node give error if name of socker not equal to socket veriable name... i cannot find what is wrong.

zeffii commented 10 years ago

oops! will attempt to fix tomorrow ( i like to use same variable names as socket names )

nortikin commented 10 years ago

i commited interface changes to script node

zeffii commented 10 years ago

fixed.