2
$\begingroup$

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

$\endgroup$
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 Feb 21 at 19:17

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.