1
$\begingroup$

This page suggests there is a function called new_effect that I could used to create a new text strip. However, this function is part of a class, so I can't just call bpy.types.SequencesMeta.new_effect() I have to find a object already in Blender that's a bpy.types.SequencesMeta class and use it. ...Where would I find such an object?

I could use bpy.ops.sequencer.effect_strip_add() but that function doesn't return the strip that was added, so to further edit that strip I'd have to go find it. Its possible but its annoying and makes me feel like I'm doing this the wrong way when the new_effect() function does return the newly created strip.

$\endgroup$

1 Answer 1

1
$\begingroup$

The command is bpy.context.scene.sequence_editor.sequences.new_effect(). This has the added bonus over bpy.ops.sequencer.effect_strip_add() that it can be called directly from the scripting console without throwing a failed, context is incorrect error.

$\endgroup$
1
  • $\begingroup$ To use this in any class method that has a context argument to an execute or draw function, remove the bpy.; so that the operator will be called in the same context that the class method is called in. $\endgroup$ Commented Dec 12, 2021 at 15:42

You must log in to answer this question.

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