[Bf-taskforce25] operators and context

Brecht Van Lommel brecht at blender.org
Tue Oct 7 19:19:14 CEST 2008


Hi Jean-Luc,

On Tue, 2008-10-07 at 19:04 +0200, Jean-Luc Peurière wrote:
> there is a d) case :
> 
> d) the space controller define the context, and the operator that is
> called when a command is issued, when that space is active.
> Some spaces dont define their own context but use the general
>   one (buttons).

That the space defines the context was implicit in my assumption, should
have been more clear on that. The question is how does it do that
exactly. Does it just say to the operator, I'm this space type and this
is my data, you can figure out what to edit based on that. Or does it
really say this is the material that's being shown, and that menu is
being executed on this specific property, so that's what you should be
editing, without the operator having to know about the space.

> So in your delete example, if the active context was setup by 3Dview
> a given delete operator is called, but when the outliner is the active
> one, it is either a different one or the context being different, it  
> acts
> on a different selection.

This explanation leaves open if it works as a) or c). Either you have a
different operator/code for a different space, or you get get from the
context the selected objects through some abstraction that works for
both the outliner and the 3d view. Or am I missing something?

Thanks,
Brecht.




More information about the Bf-taskforce25 mailing list