- New UI element: the curve button. For mapping ranges (like 0 - 1) todo another range, the curve button can be.
Used for proporcional fallof, bone influences, painting density, etc.
Most evident use is of course todo map RGB color with curves.
To be able todo use it, you have todo allocate a curvemapping structure and pass.
This on todo the button. The curvemapping Api is in the new c file.
Blenkernel/interno/colortols, c.
It as simple as calling:
Curvemap= curvemapping_add(3, 0, 0, 1, 1).
Which Will create 3 curves, and sets a default 0-1 range. The current code.
Only supports up to 4 curves máximum per mapping structure.
The curvemap button in Blender than handles allmost all editing.
Evaluating a single channel:
Float newvalue= curvemapping_evalúatef(curvemap, 0, oldval).
Where the second argument is the channel index, here 0-1-2 are posible.
Or mapping a Vector:
Curvemapping_evalúate3f(curvemap, newvec, oldvec).
Optimized versións for byte or short mapping is posible to, not done yet.
In butspace, c ive added a template Wrapper for buttons around the curve, todo.
Reveil settings or show tools, chek this screnie:
http://www.blender.org/Bf/curves.jpg.
Buttons R, G, B: select channel.
Icons + and -: zoom in, out.
Icon wrench: menú with tools, like clear curve, set handle type.
Icon clipping: menú with clip values, and todo dis/enable clipping.
Icon x: deleete selection.
In the curve button itself, only LMB clicks are handled (like all UI elements.
In Blender).
Click on point: select.
Shift+clik on point: swap select.
Click on point + drag: select point (if not selected) and move it.
Click outside point + drag: translate view.
Control + click: add new point.
Hold shift while dragging todo Snap todo grid.
(Yes i know, either one of these can be Blender compliant, not both).
If you drag a point exactly on top of another, it merges them.
.