* Column select (ALT-RMB) works again, and in conjunction with 'extend' (i.e. SHIFT) to add to selection instead of just replacing
* Select all keyframes in curve (CTRL-ALT-RMB) now works
* Cleaned up the code for selecting keyframes
* Click-column-select (Alt-RMB) now works
* Also, moved a function used in both Action/DopeSheet and Graph editors to the Animation module
Version string is compatible with all previous releases, but report
subversion if not 0.
Keep distribution dir so you can run from there without needed of unpack,
and make messages and cmds be in sync.
The bug was todo with bpy.data and bpy.types becoming invalid, temporary fix is to re-assign them to the bpy module before running python operators or panels.
will look into a nicer way to get this working.
API, added support for return values for RNA_function_call_direct and completed the code. Didn't test it though.
Returns works exact the same way as other parameters for format strings except you put a R in front of it. For instance for a function that accepts two vectors and returns a vector you use a format like "f[4]f[4]Rf[4]".
I'm thinking about allowing arbitrary white space in the format string (or use comas as separators) to make it more readable.
The return format *must* always come last and of course the corresponding argument you pass to the function has to be a pointer so that it can be filled with the return value.
Committing quick RNA function calling RNA_function_call_direct* functions set à la fprintf.
It works like this (with ptr being an RNA pointer to some ID):
RNA_function_call_direct_lookup(ptr, "rename", "s", "MyCamera");
the format specifier would not be strictly needed but I prefer to keep this as it gives nice error handling in case some RNA function changes.
Format strings are very easy and similar to python ones:
"b" for booleans
"i" for integers
"f" for floats
"s" for strings
"e" for enums (using int values)
"O" for pointers (using O as in py, we can change to P)
"N" special NULL parameter, valid to skip optional parameters
For bools, ints and floats you can use a special format specifier with [n] where n is the size of an array of that type. For instance "f[4]" to set a location/vector (it expects a pointer to float* holding the array).
Return values still have to be implemented.
Also I know the name is a bit long maybe we can cut it up at RNA_call_direct or simply RNA_call.
* Invalid drivers are now tagged accordingly and are not evaluated until they are manually refreshed using the 'Update Dependencies' button
* Drivers with errors have a error warning shown in their UI
* Rearranged the UI buttons a bit for drivers, adding support for a 'remove' driver button.
this means it caches the compiled pyc files after importing fro the first time.
My times for importing 501 buttons_objects.py files were.
- running each as a script 1.9sec
- importing for the first time 1.8sec
- importing a second time (using pyc files) 0.57sec
Also added "bpy" to sys.modules so it can be imported.
* Added very basic loading of .py files on startup to define panels.
It now executes all .py files in .blender/ui on startup. Right now
this contains the object buttons, the C code for it is commented out.
These files should get embedded in the blender executable as well
eventually, that's a bit more complicated so this works for now.
* For scons and cmake it seems to copy & find the files OK, for make
only "make release" works (same with scripts/ folder it seems).
* Added BLI_gethome_folder function in BLI_util.h. This is adapted
from bpy_gethome, and gives the path to a folder in .blender like
scripts or ui.
There's plenty of things to figure out here about paths, embedding,
caching, user configs ...
* Template slots are no longer specified per item, but are
a state now, set with uiTemplateSlot.
* Some renaming of Layout functions for consistency.
* Fix for roundbox in stack template, now is always behind
the other buttons.
* Improved python API for layout:
http://www.pasteall.org/5008/python
* Added REQUIRED flag for function parameters.
* Made dupliframes/verts/faces/groups an enum, and make it editable.
* Enum bitflags were broken, fixed.
Quick hack to enable zoom in buttons window again.
It uses bad old conventions for fixed panel width still, view2d has
to be tweaked for new system. But, it shows layout to work. :)
Grand cleanup:
- removal of FTF and ftfont dir
- removal of text.c which wrapped it
- wrapped old text drawing code temporarily, need to decide how 'style'
will behave per editor when you draw strings outside interface code....
wouldn't be very useful to set fonts locally all over?
Nicer implementation of blurred font draw, moved to blenfont
module. Set it with BLF_blur(value). Current kernels implemented
are 3 and 5 only. Blenfont module can extend this once.
More font style work;
- hooked up almost all ui buttons code to new font
system, including text clipping
- panel headers scale now too to smaller fonts
- added further style hints, for shadow/emboss. Is all going to
be in UI designer control!
- for fun; changed layout engine to spread vertical buttons in
window width
Next: removal of all usage of old font system, using 'styles'.
Will also move font blurring to blenfont module.
* Widgets now get coloured when driven. The colour used is debatable, but I've just set it to a purplish colour so that it's easy to distinguish from animated/keyframes/highlight colours.
* New drivers are given generator F-Curve modifiers by default so that they at least show up in the view.
Drivers can now be Added/Removed from buttons using the D/Alt-D hotkeys, and also through the menu. Driver settings (i.e. the target) are not set by default. To set those, go to the Graph Editor (see notes).
Notes:
* Buildsystem maintainers - I've added a new file "editors/animation/drivers.c"
* Widget colours for the driven-setting indications are needed
* To see the new drivers, go into Graph Editor -> "Drivers" mode. Currently, there's a little bug there which prevents editing of the new drivers.
* Fixed a few typos in the code
* Switched the meaning of the Ctrl and Alt modifiers when selecting keyframes.
- Ctrl is now select all keyframes on one side of time cursor
- Alt is now select all keyframes at same time as a particular keyframe.
TODO:
While testing these changes, I've found that this column-select is not working yet as the tolerances are too low. This will be rectified soon.
DNA_texture_types almost finished, missing still plugin type.
I noticed many texture share the same noise settings maybe this can be grouped into a common function.
Also testing out first commit.
WIP commit for UI drawing.
- Hooked up Diego's new Font API
- Added Style definitions for fonts, currently it uses
a different font for panel titles to show it.
- Styles are in Userdef now too, still not finished
- Userdef "DPI" will offer global control over font size,
to match monitor size/resolution. It's meant to scale
widgets and headers too btw, later.
- Lots of code removed for old fonts, but that's unfinished.
On todo: too much to mention, will continue happily tomorrow!
Since adding a new type gives quite a lot of extra boiler plate functions.
Return PyCFunction's main disadvantage is it does not have a uniqie name when you print it.
Fixed the problems with using uninitialised vars in the calls for inserting keyframes from buttons. Oldstyle buttons (i.e. those without any RNA links, such as the 3D-View header buttons) would crash otherwise.
* Collapse selected channels should now work for most channels. It still doesn't work for Action Groups for some reason...
* Objects are now deemed to only be selected in Animation Editors if the are selected (i.e. if they are active but not selected, they are no longer considered to be selected)
* Outliner updates when scrubbing the TimeLine. As a consequence, anim playback with an Outliner open is a bit slower now.
* Fix to make python panels callbacks get the actual
blender Panel as an argument, instead of any instance.
* Fix for callback validation in python 2.5, worked OK
in python 3.0 but gave error in 2.5 because it's a
method instead of a function there.
* Added the build system code to compile files named
editors/*/*_api.c into the makesrna preprocessing.
The reason to do this is to keep operators and API
close together, but it doesn't fit well with the build
system, especially Makefiles use an ugly hack here.
* Some fixes to pass an RNA AnyType through the API,
this will give a PointerRNA, for use in the interface
code for example.
* Added RNA wrapping of some UI template code as a test.
There are two operators: one for expanding channels and one for collapsing them. These operators each have a property, "All", which specifies if they should expand/collapse all channels regardless of selection.
TODO:
* A few of the sub-object channel types still needs to be supported by this.
This feature takes a 'snapshot' of the visible+selected F-Curves, and displays these in the background as 'ghosts curves' in the background. Such curves are drawn semi-transparent, slightly darker, and with dotted lines.
To use, simply click the 'curve' button beside the Auto-Snapping selector. To clear, simply click that button again (with a different icon now).
These 'ghost curves' are stored per Graph Editor instance, and are not saved to file (i.e. per session only). They are useful to be used as guides when refining the shape of existing curves.
- Widgets now draw projected themselves, putting window/region matrix
on 1:1 pixelspace. This allows zoomable buttons, but crispy.
- Note: text in smaller buttons dont get clipped correct now, WIP
- Fixed error with button types in some menus.
- removed temp UI_2_50 define hack.
The library can load any font supported by the Freetype2 library or
used the internal bitmap font.
With both types it's possible draw the text as texture or bitmap,
and using texture it's possible rotate, scale and clipping text.
Still have things to fix/add, but I think it's ready to move-on
and start droping the old api, most of (if it's not all) the
editors/interface/text.c will be remove, but some things still
has to be define, like:
* Where is store the fonts ? (default font, panel font, filesel font, etc)
I mean, every space have own fonts ? or we keep it on the context ?
It's not a really problem from the blenfont side, because every font
have reference number, so it's load only the first time.
* What we do about gettext ?
Keep the old system that call gettext inside the blenfont or replace
it for _() in the Blender source ?
Also things like pupmen has to be take care, if we want translate the menu.
Ok, time to sleep, back tomorrow to start moving the things :)