[Bf-committers] SystemError when using simple mesh commands in scripts started from the command line...

Martin Poirier theeth at yahoo.com
Sun Nov 8 22:16:31 CET 2009


Hi,

--- On Sun, 11/8/09, Dietrich Bollmann <diresu at web.de> wrote:

> So invoke would be used for functionality which for
> instance use mouse
> input to rotate some object?

Yes. Like transform, loop cut, lasso, brush select, ...

> And operations used in a script which does not need user
> input would
> only use exec?

Hopefully.

> Probably the bpy.ops.mesh.primitive_cube_add() command than
> would be of
> the second kind and not require the window context?  

It's not as clear cut as that. Some operator supply both an invoke and exec function, so it has to be decided based on calling function, not operator type.

> Just by curiosity:
> 
> Concerning interactive commands, why isn't it enough to
> specify the
> window(s) when registering an event handler? 

It's not so much the window that is missing but the whole windowmanager. When running scripts from command line, it tries to run them before the UI is fully initialized.

> Aren't interactive commands (event handlers) reacting on
> user input
> invoked by events in the queue of the window they
> registered for?  As
> there is exactly one event queue per window the window
> should be clear,
> no?

The window missing from context only applied to operator running from the command line (or in background mode), otherwise it is not a problem.

> Non-interactive commands on the other hand wouldn't need
> the context at
> all.  (At least if they only manipulate a scene and
> not some window
> itself.) 

Context is like a generalized dictionary. They would take the current scene from the context too.

> Are there documents which explain Blenders new event
> system?

Some of it is on this wiki, like on this page for example:

http://wiki.blender.org/index.php/BlenderDev/Blender2.5/WM_Architecture

Martin

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the Bf-committers mailing list