[Bf-python] bpy.ops.sequencer??

Ulf Enhörning ulfboy at gmail.com
Sun Jun 12 12:51:44 CEST 2016


Thank you Bassam.

I will look into this later! Now i feel hopefull i will solve thia problem.
:)

Ulf

On Friday, June 10, 2016, Bassam Kurdali <bassam at urchn.org> wrote:

> Hi Ulf, quick answer:
>
> Operators' poll() function are looking for specific properties in
> bpy.context ; it's impossible to know which without looking at the actual
> code for the specific operator's poll() function (for example, mesh editing
> operators might check that you're in edit mode),
> but:
> It's highly probably that in this case the failure is in the space type -
> these operators don't run outside of a sequencer window, so if you're
> running this from e.g. a python console or text editor, it won't work. Some
> options:
> - You can override context:
> https://www.blender.org/api/blender_python_api_2_77_0/bpy.ops.html
> - Set your code to run within an operator, or from a panel, and then
> execute it from the sequencer
> Personally I'd do the later; overriding context has not been too reliable
> for me. Or, if possible, avoid using the operators altogether in my code.
> Cheers
> Bassam
> On Fri, 2016-06-10 at 20:26 +0200, Ulf Enhörning wrote:
>
> Hello, I am developing Python scripts that use the *bpy.ops.sequencer*.
> Several of the operators give the following error message:
>
> *File “**C:\Program** files\Blender
> Foundation\Blender\2.77\scripts\modules\bpy\ops.py, line 189, in __cal__*
>
> *ret = op_call(self.idname_py(), None, kw)*
>
> *RuntimeError: Operator bpy.ops.sequencer.effect_strip_add.poll() failed,
> context is incorrect*
>
> *Error: Python script fail, look in the console for now...*
>
> Here are a few of the operators that yield the above error message:
>
> bpy.ops.sequencer.*effect_strip_add(type='CROSS')*
> bpy.ops.sequencer*.duplicate(mode='TRANSLATION')*
> bpy.ops.sequencer*.paste()*
> bpy.ops.sequencer*.select()*
> bpy.ops.sequencer*.next_edit()*
>
> I would be very grateful to any suggestions that could help me solve this
> so I can be on my way in writing interesting scripts!
>
> Sincerely, Ulf Enhörning
>
> _______________________________________________
> Bf-python mailing listBf-python at blender.org <javascript:_e(%7B%7D,'cvml','Bf-python at blender.org');>https://lists.blender.org/mailman/listinfo/bf-python
>
>

-- 
Ulf Enhörning
summerclouds.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.blender.org/pipermail/bf-python/attachments/20160612/6e8e4788/attachment.html>


More information about the Bf-python mailing list