[Bf-taskforce25] Assorted RNA Todos

Brecht Van Lommel brecht at blender.org
Thu Sep 3 18:40:17 CEST 2009


Hey Joshua,

On Thu, Sep 3, 2009 at 1:59 PM, Joshua Leung<aligorith at gmail.com> wrote:
> 1) There doesn't seem to be any way to set the way that operators get called
> from Py-Menus. Currently with quite a few tools in the Armature Edit Mode
> menu, clicking on the entries will result in an invoke menu despite the user
> having already chosen the tool (see Autoside tools). Probably we need
> uiLayoutSetOperatorContext() wrapped, but that would require that the
> WM_OP_* defines be wrapped too.

It's already possible, for example:
layout.operator_context = "EXEC_AREA"

> 2) More for Py-API, but some way to specify the same thing when running
> operators from scripts could be useful. See
> http://www.pasteall.org/7488/python for an example of a script where
> specifying how the operator gets called is important.
>
> Campbell and I discussed this item a bit in IRC yesterday. One of the
> potential ways of doing this would have been to require the execution type
> to be the first arg, i.e.
> bpy.ops.gpencil.convert('INVOKE')
> bpy.ops.gpencil.convert('EXEC', type='CURVE')

I think exec is a reasonable default, and invoke is pretty rare. So
perhaps it is better to add an optional argument defaulting to
context="EXEC_DEFAULT"?

> 3) UI's for custom properties added to various structs by users during
> runtime.
>
> One of the issues here is that we're probably going to need be able to
> determine what custom properties have been added and/or loop over them. Is
> there already an easy way to do this?

There is no function for this, but what first needs to be determined
is how this should work. ID properties should be relatively easy to
do, what you'd have to do is list all ID properties that do not have a
corresponding RNA property. What is not possible currently is letting
the user define an RNA property including limits, ui text,
description, etc. RNA can't be saved at the moment, and works for all
objects of some type. Unless someone wants to implement it, I would
not do that for now, because I don't have the time to make those deep
changes currently.

Brecht.


More information about the Bf-taskforce25 mailing list