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 <[email protected]> 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 [email protected] > <javascript:_e(%7B%7D,'cvml','[email protected]');>https://lists.blender.org/mailman/listinfo/bf-python > > -- Ulf Enhörning summerclouds.com
_______________________________________________ Bf-python mailing list [email protected] https://lists.blender.org/mailman/listinfo/bf-python
