Fixes:
- HSV picker didn't work. Old option "No Hilite" for buttons made it not
being checked for input anymore. Needs to be on attention list!
- Node editor wasn't drawing buttons correctly. Two things to keep track
off:
- Use wmLoadIdentity(), not glLoadIdentity()
- I've added a wmPushMatrix() and wmPopMatrix() version for correct
wm-compatible push/pop. Only one level for now.
Restored the code to get this working. I haven't tested this to verify it, but it 'should' work...
Also, deleted old gpencil.c file in editors, since it was causing compiling errors.
Patch from Joshua, converting Grease Pencil to 2.5.
All GP data now is an ID block, allowing re-use, link and append.
For better contextual control within 2.5, these GP ID's will get
linked to actual data, like NodeTrees, Scenes, Images or Objects.
That will ensure Undo works, and opens up exciting new use cases
as well. :)
Patch note: on reading files, GPencils linked from editors will
get moved to the main library, using standard naming (indicating
where it was used), and with "Fake User" set. That way the user
can manually relink the pencils where appropriate.
We can check on just linking GP to some default, like 3d window
pencils to Scene? Nice to experiment with.
Notes for Joshua:
- for reading old GPencil, it has to use old code as well, meaning
to tread data as "indirect data, within another ID".
- Saving ID data means the chunk in file BHead needs the ID_GD code,
and not "DATA", which indicates 'indirect data'. That's the file
format spec.
- I've added do_versions_gpencil_2_50(), feel free to further tweak
things here, like linking things to scene or so.
- Formerly GPencil saved 2.50 files won't convert gpencil
Now it is possible to write a Python Expression using the variable names for driver targets (see mockup from initial commit) to substitute the appropriate values into the expression.
In the __global__ namespace for PyDriver evaluation, the following modules are available:
* __builtins__ - i.e. the builtin Python functions
* bpy - new Python API
* math or m - math module
For example:
Consider a driver with three targets, named: A, B, C
Now, you could write an expression like:
C if A < 5 else B
or even:
2*C if A < 5 or A > 20 else m.PI*B
Of course, you don't have to have three targets, the above was just an example.
TODO:
* Bring back way to load pydrivers.py
* Blender.Noise equivalent would be nice to have
P.S. I hope I haven't made any terrible Python API coding errors here (i.e. mem leaks, etc.)
In much the same way as Keying Sets are defined in the Outliner, you can now select items in the Datablocks view of the Outliner, and use the D/Alt-D hotkeys to Add/Remove drivers (repectively). This is useful for settings which don't have buttons yet (in the buttons window).
The Python API to define Panels and Operators is based on subclassing,
this makes that system more generic, and based on RNA. Hopefully that
will make it easy to make various parts of Blender more extensible.
* The system simply uses RNA properties and functions and marks them
with REGISTER to make them part of the type registration process.
Additionally, the struct must provide a register/unregister callback
to create/free the PanelType or similar.
* From the python side there were some small changes, mainly that
registration now goes trough bpy.types.register instead of
bpy.ui.addPanel.
* Only Panels have been wrapped this way now. Check rna_ui.c to see
how this code works. There's still some rough edges and possibilities
to make it cleaner, though it works without any manual python code.
* Started some docs here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/RNATypeRegistration
* Also changed some RNA_property and RNA_struct functions to not
require a PointerRNA anymore, where they were not required (which
is actually the cause of most changed files).
* long time due: copy the executables to the install/msvc9 or install/msvc9d dir instead of keeping them in the source tree in the bin folder!
* copy the new ui scripts to the install dir
* Forgot to finish this code yesterday, dragging panels was
broken. This is fixed and new panels are now inserted after
the last added one, inbetween others rather than at the end.
* Added back backgrounds behind buttons for modifiers and driver targets
* 'Protect' toggle doesn't draw for F-Curves with no keyframes to prevent editing on anymore
* Inserting keyframes on objects using builtin keyingsets now use the right names
* For new buttons spaces, automatically set horizontal/vertical
align depending on size, instead of free.
* Cleaned up the UI panel API. There's now a new uiBeginPanel
function which takes a panel type, and a uiEndPanel which takes
the final size. uiNewPanel* functions will be phased out.
* Animate the re-alignment when a panel size changes, e.g. when
enabling dupliframes.
* Load ui scripts from the release/ folder first if it is
available. This makes it easier to edit ui scripts, since it
will directly use the original files which avoids having to
run the build system.
* Improve editing of panel types while blender is open. That
means fixing some issues with lacking updates, overlaps, strange
ordering. It even does an animation now when the panel resizes.
* Added extra parameter to generic unique name finding function BLI_uniquename() for specifying the delimeter between non-unique parts of the name and digits.
* Driver target variables now get unique names by default.
* The UI for adding and modifying drivers is now functional, and reflects the new way they work. It has also been tidied up a bit (from the previous incarnation), with RNA buttons starting to be used (currently limited to the 'Path' settings).
* Fixed errors in RNA wrapping for drivers
* Don't call generic layout hints templates anymore, i.e.
TemplateRow becomes Row, etc.
* Added more general layout nesting, using uiLayoutSplit()
and uiLayoutBox() functions, for which the sublayouts
can then be accessed using uiLayoutSub(), to put items
in those sublayouts.
* Some steps to make the layout decisions, like which items
to put in which columns, independent of the width of the
window or the text in the buttons. We want the layout to
be stable under resizes and translations.
* Added an "expand" parameter to uiItemR, used now to expand
enums into a row instead of using a menu.
Drivers now support multiple targets which act as 'variables'. The targets have a short 'name' (see later), and reference some property (in much the same way as F-Curves do, using RNA-Paths) which acts as the 'value'.
These named variables can then be used in a Python Expression which relates them to each other for more fine-grained control over the result of the driver. By using only the names of these variables in the expressions, we are able to define expressions/relationships in a much more readable way, as data access is separated from data use. This makes the underlying relationships easier to understand.
By default, if no Python Expression is given, the variables are simply averaged together, so old files won't break. :)
For example, check the following diagram (thanks Cessen/Nathan V from Peach team):
http://download.blender.org/ftp/incoming/250_drivers_mockup_cessen.png
TODO List:
* Depsgraph building for new driver relationships doesn't work yet. This needs to be recoded again, but this new system makes this much easier, since the targets are clearly defined (i.e. no need to parse py expressions to get list of objects)
* Graph Editor interface for editing these needs to be rewritten
* Python function for evaluating these expressions is needed (Campbell?)
* Replaced a quicky hack needed to get PoseLib working with a proper new group-naming option for KeyingSets. Now, all builtin KeyingSets will use the name of the data (i.e. Object or PoseChannel) as the name of the group new channels are added to
* Fixed a bug with LocRotScale builtin KeyingSet, which meant that scale keyframes were not getting added.
* TAB key (toggle original pose) now works again. Previously, events were flying past too quickly.
- Fun for testers: Added "Redo Operator" Panel in view3d 'nkey' region.
It's going to be part of tools UI I know, but this will give good
tests of what goes on with operators. I had to add small fixes in
Transform for it already. :)
One important issue to note is that it lists every operator, also from
non-3D-window ops. Needs checked or classified somehow.
- Fix: removed bad 2.4x hack from how pulldown menus were defined. Made
widget code cleaner, and will show menus like SHIFT+A correct now.
* For RNA wrapped functions, the prototypes of the original
function being wrapped is now generated as well. This is
an extra check to ensure that the function is correctly
wrapped. It's printed after the function is used to still
get proper warnings in case the #include for it is missing.
Following on from the methods added specially for PoseLib to only execute the F-Curves in a given Action Group, I've attempted to use this for evaluating Action Constraints on Pose Channels. This does rely on the F-Curves being in groups named according to name of the Pose Channel of interest, hence, we may need some way to be able to fine tune this later.
Preliminary tests seem to be promising, with rigs with quite a few action constraints being slightly more responsive (subjective test though). Please test thoroughly.
* Bug with confirming was due to mixed up order for events handling and updates for drawing. Now events are handled before relevant updates are done for drawing, since these only get called when an event occurs.
* View manipulations work again, and in a much nicer way thanks to the OPERATOR_PASS_THROUGH flags :)
* Search seems to work much better now again too...
This (most important part) of PoseLib now mostly works again. It even works for PoseLibs saved with the old animation system.
However, there are a few annoying bugs that need to be addressed still:
* When 'confirming' poses, the pose changes to the next one before PoseLib exits. I'm not quite sure where this is coming from yet...
* There are still a few minor bugs in the search-string code that will get ironed out
* AutoKeyframing doesn't work yet for this