Make it possible to create CurveMapping from Python
This is a feature request to make the CurveMapping available from Python.
Currently it is only possible to embed an existing CurveMapping into a custom UI . However it is not possible to create a new CurveMapping from Python, this can only be done in C code.
There are some workarounds for this, like adding Cycles nodes which have a CurveMapping , but they have drawbacks and are hacky.
6 Comments
bpy.types.CurveMapping is already available from python, there is just no function that can store a pointer property to it. bpy.props.PointerProperty doesn't work because it only supports ID and PropertyGroup, and CurveMapping is derived from bpy_struct. There doesn't seem to be any immediate plans to make PointerProperty able to use bpy_struct derived classes, so currently it can only be done properly in the C code. Another way of using an existing instance is to use ID data block types, as some of these (such as bpy.types.Brush) have curve mappings in them.
I'm not sure I'm completely following. You're saying you want this feature available from Python, but then you link to it's availability in the Python API.
Do you mean to say that this feature is only accessible via Python and you'd like it more accessible in Blender's interface?
@Jason van Gumster: I was sent here from the Blender bug tracker , so I assumed this was a place for developers. I have updated the description, I hope it is more clear now.
@simonwendsche: Do you have a proposed API call and perhaps psuedocode that shows how you'd expect to be able to use this?
2 Posts ?? Bug ?
@darkstarmail: No. They are two different features.