3
$\begingroup$

I need to change the font in the Sequencer Text Effect with Python code if it's possible ?!

$\endgroup$

1 Answer 1

2
$\begingroup$

First, you' have to know where the font-files are located in your system. You can find this location by changing manually a font. On my Windows machine, this is: C:\WINDOWS\Fonts\ARIAL.TTF for the Arial font. Then paste and run run the followig code in the Text Editor of the Scripting workspace to assign the Arial font to the active (selected) strip.

import bpy
strip  = bpy.context.scene.sequence_editor.active_strip
new_font = 'C:\WINDOWS\Fonts\ARIAL.TTF'
strip.font = bpy.data.fonts.load(new_font) 

See also Select text object by name and change font via script

$\endgroup$
1
  • $\begingroup$ Thanks but I have an old version of blender so strip class doesn't have attribute font, like in this error message :" AttributeError: 'TextSequence' object has no attribute 'font' " , so I need to know how to add this attribute 'font' in the source code first.. $\endgroup$
    – AlecDev
    Commented Feb 21, 2021 at 19:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .