Log notes from 06-01-2006 until 08-01-2006
FIX: Scaling op pupmenu for materials caused text to be cut off.
Scaling up of the text and icon in pupmenu is prevented now in ui_do_but_MENU
While testing other code, I found out the scrollwheel code redraws a 2d window 3 (three!) times on every event! This explains why scrollwheel seems to lag quite some when used in buttons or outliner.
The view2dzoom() and view2dmove() code is horrid. Nice project for someone is to move all 2d (View2D struct related) code into its own C file. A lot of that is spread around in the code.
- New UI element: the "Curve Button".
For mapping ranges (like 0 - 1) to another range, the curve button can be used for proportional falloff, bone influences, painting density, etc.
Most evident use is of course to map RGB color with curves.
To be able to use it, you have to allocate a CurveMapping struct and pass this on to the button. The CurveMapping API is in the new C file blenkernel/intern/colortools.c
It's as simple as calling:
Code: Select all
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 maximum per mapping struct.
The CurveMap button in Blender than handles allmost all editing.
Evaluating a single channel:
Code: Select all
float newvalue= curvemapping_evaluateF(curvemap, 0, oldval);
Where the second argument is the channel index, here 0-1-2 are possible.
Or mapping a vector:
Code: Select all
curvemapping_evaluate3F(curvemap, newvec, oldvec);
In butspace.c I've added a template wrapper for buttons around the curve, to reveil settings or show tools; check this screenie:
- Buttons R, G, B: select channel
- icons + and -: zoom in, out
- icon 'wrench': menu with tools, like clear curve, set handle type
- icon 'clipping': menu with clip values, and to dis/enable clipping
- icon 'x': delete selection
- click on point: select
- shift+click on point: swap select
- click on point + drag: select point (if not selected) and move it
- click outside point + drag: translate view
- CTRL+click: add new point
- hold SHIFT while dragging to snap to 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
- Icons now draw using "Safe RasterPos", so they align with pixel boundary. the old code made ints from the raster pos coordinate, which doesn't work well for zoom in/out situations
- bug in Node editing: buttons could not get freed, causing in memory error prints at end of a Blender session. That one was a very simple, but nasty error causing me all evening last night to find! (Hint; check diff of editnode.c, where uiDoButtons is called)
Note from zupermonkey:
This build also contains a patch that makes newly created primitives aligned to world space instead of view space. This patch, however, is not finished yet, so you cannot choose in what kind of space a primitive should be created.
Also, other objects (like lamps and camera's) are still aligned to view space. That's about to change soon.
The patch will be submitted to the tracker later or at the end of this week (can't finish it before because I'll be recovering from a surgery).
http://www.graphicall.org/builds/builds ... show&id=70