[Bf-committers] RNA write access for CurveMap

Dan Eicher dan at trollwerks.org
Wed Sep 21 14:23:50 CEST 2011

On Wed, Sep 21, 2011 at 5:03 AM, Lukas Tönne
<lukas.toenne at googlemail.com> wrote:
> This is a small RNA patch to enable scripters to make custom curve
> mapping node setups with python scripts. Only question is if we want
> to carry the unwieldy C function design to the RNA, but since
> CurveMaps are probably not going to be changed it's better than no
> access at all.
> http://codereview.appspot.com/5091046/
> >From the codereview description:
> Updating points in a CurveMap requires update calls on the CurveMapping struct.
> Since this is unknown to the CurveMap itself, this has been disabled in the RNA
> (CurveMap points are readonly, except for selection flag, which does not require
> the update).
> To work around this i added some RNA functions to CurveMapping, wrapping the C
> functions used for this purpose. They take the curve map index as a required
> parameter. The remove and set_handle functions work on all selected points (as
> in C code), so in order to update specific points without messing up selection
> one would have to save the selection state and restore later.
> Cheers
> Lukas
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers

I tried to do this once before by adding an index value to the
CurveMap(?) struct so they could be dereferenced into the enclosing
CurveMapping but it was rejected by Campbell.

This way doesn't really fit into the rest of the rna functions (not to
mention py-dogma) since you're operating on a 'child' through the
'parent' interface.

But, alas, this one little thing is the *only* reason you can't create
materials using the py-api so it really needs a good solution.


More information about the Bf-committers mailing list