0
$\begingroup$

I can add a Text strip with the following code:

    effName = "eff" + tCStr[-3:]
    effName = sequences.new_effect(
        name=tField,
        type="TEXT",
        channel=tChan,
        frame_start=fStart,
        frame_end=fEnd)

I can also specify the location, size, color, and text content in my Python script, but I have not been able to change the font.

Can some kind soul please give me a clue how to do this?

I know the following don't work:

fnt = bpy.data.fonts.load(tFont)

bpy.ops.font.open(tFont)

bpy.context.scene.sequence_editor.sequences_all[tField].font = tFont

Note: tFont has the full path to the font.

$\endgroup$
0
$\begingroup$

Ok, I figured this one out.

tFont = 'fonts/' + row3[7] + '.ttf' # read font from .csv data file
fnt = bpy.data.fonts.load(tFont) # load font
bpy.context.scene.sequence_editor.sequences_all[tField].font = fnt # change font
bpy.context.scene.sequence_editor.sequences_all[tField].text = 'Text' # use font
| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.