Skip to content

Instantly share code, notes, and snippets.

@zeffii
Last active January 28, 2016 08:44
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/9864fa22e8148c3b9e2b to your computer and use it in GitHub Desktop.
Save zeffii/9864fa22e8148c3b9e2b to your computer and use it in GitHub Desktop.
import bpy
''' more options per character
character.use_bold
character.material_index
character.use_italic
character.use_underline
'''
def set_body(text_object, normal, small_cap, small_caps_scale=0.39):
data = text_object.data
data.small_caps_scale = small_caps_scale
data.body = normal + small_cap
for idx, character in enumerate(data.body_format):
character.use_small_caps = (idx >= len(normal))
text_object = bpy.data.objects['Text']
normal = 'Maintext ' # add space here, or at the start of the small_cap
small_cap = 'smaller'
set_body(text_object, normal, small_cap)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment