Skip to content

Instantly share code, notes, and snippets.

@zeffii
Forked from anonymous/Titles
Created June 17, 2015 12:04
Show Gist options
  • Save zeffii/298f51d1d50c820d4648 to your computer and use it in GitHub Desktop.
Save zeffii/298f51d1d50c820d4648 to your computer and use it in GitHub Desktop.
def sv_main(xoffset=0.3, lineheight=1.54):
locations_r = []
locations_b = []
text_bold = []
text_regular = []
in_sockets = [
['s', 'xoffset', xoffset],
['s', 'lineheight', lineheight]
]
text_name = 'Titles'
text = bpy.data.texts[text_name].as_string()
idx = 0
for l in text.split('\n'):
if not l:
continue
if l.strip() == '|':
idx+=1
continue
thick, thin = [a.strip() for a in l.split('|')]
text_bold.append([thick])
text_regular.append([thin])
r = [xoffset, -idx * lineheight, 0]
b = [-xoffset, -idx * lineheight, 0]
locations_r.append(r)
locations_b.append(b)
idx+=1
out_sockets = [
['s', 'text_bold', [text_bold]],
['v', 'locations_b', [locations_b]],
['s', 'text_regular', [text_regular]],
['v', 'locations_r', [locations_r]],
]
return in_sockets, out_sockets
Lead 1 | Jane Dough
Lead 2 | John Dough
Lead 3 | Ms Smith
Lead 3 | Mr White
|
Support 1 | Mr Pinker
Support 2 | Mr Red
|
Director | Mr Golder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment