Commit Graph

17 Commits

Author SHA1 Message Date
Joshua Leung aa4ed13e4a NLA SoC: NLA Mapping Cleanup
While trying to fix the mapping conversions for repeat, I came across some limitations with the current (soon to be previous) mapping methods. 

Now the mapping conversions should work nicely for all places that use them.
2009-06-28 07:32:00 +00:00
Joshua Leung b4acd77526 NLA SoC: Big Commit - Restored NLA-Mapping Corrections
In TweakMode, the keyframes of the Active Action are now shown (and can be edited) in NLA-mapped time, with appropriate corrections applied when editing. This works in the DopeSheet and Graph Editors :)

To do this, got rid of the old wrappers/API-methods, replacing them with new-style ones. A few methods previously (in this branch) used only for evaluation are now used for this purpose too. As the same code is used for editing + evaluation, this should now be much better to work with.

I've only done a few brief tests now, but I think I might've muddled the invert-flags on one or two cases which I'll need to check out tomorrow. So, beware that there may be some weird and critical bugs for the next few days here...

Also, added proper license headers to new NLA files.


TODO:
- testing + bugfixing due to this commit
- show range of keyframes in NLA Editor active-action line
2009-06-23 13:25:31 +00:00
Joshua Leung a87bc73d32 NLA SoC: Transition Strips + Strip Adding Operators + Bugfixes
== Transitions ==
Transition strips are now able to be created + evaluated. Transitions allow for interpolation between the endpoints of two adjacent strips in the same track (i.e. two strips which occur in the same track one after the other, but with a gap between them). 

- The current behaviour when only one endpoint affects some setting is non-optimal, since it appears somewhat inconsistently extend/replace values...
- Transform code needs a few fixes still to deal with these


== Strip Adding Operators ==
* New strips referencing Actions can be added using the Shift-A hotkey while in the strips-area. You must have a track selected first though.  
The new strip will get added, starting from the current frame, in the selected track(s) only if there is enough space to do so. Otherwise, the new strip gets added at the top of the stack in a new track.

* New transition strips can be added with the Shift-T hotkey while in the strips area. You must have two adjacent strips selected for this to work.

== New Backend Methods ==
* Recoded the strip/track adding API to be more flexible
* Added a new method for testing whether F-Curve has any modifiers of with certain attributes. Will be used in a later bugfix...

== Bugfixes ==
- Fixed bug with strip-blending which caused the blending modes to be useless.
- NLA buttons now use proper poll callbacks instead of defining checks
- Commented out missing operator in menus, silencing warnings in console
- Removed obsolete/incorrect comments
2009-06-19 04:45:56 +00:00
Joshua Leung f0f9034966 NLA SoC: Operator for adding new NLA-Tracks
New tracks can be added in the following ways (with the mouse hovering over the channels-list):
* Shift-A - this will add a new track at the top of the stack (i.e. above all the existing NLA-tracks but below the Active Action) for every AnimData block where there was a selected NLA-Track

* Ctrl-Shift-A - this will add a new track above every selected one
2009-06-11 03:19:08 +00:00
Joshua Leung 308b567e9c NLA SoC: NLA-Evaluation Bugfixes
* Fixed an evil bug where the last frame of a strip was always incorrectly evaluated. 
This was because these frames were not being included in the strip's 'range' as defined by the IN_RANGE() testing macro, which only considers the given range as an open interval (i.e. non-inclusive of boundary points). I've added a new macro, IN_RANGE_INCL(), which is inclusive of boundary points, since this is a common test in many other parts of the code.

* When an AnimData block is in 'tweaking' mode, the tracks following (and including the active track) are now correctly skipped during evaluation. 

* Finished coding the option of setting a single NLA-track per NLA-block to play 'solo' (i.e. only that track is enabled for evaluation). 
To enable this, simply click on one of the grey 'dots' beside the NLA-track names, turning this dot yellow. The 'yellow' dot means that the track will play by itself (even the 'active action' gets silenced). Only one track per AnimData block can play solo at a time. To disable, simply click on the 'yellow' dot again. 
NOTE: this currently uses the View3D layer-status icons. We probably need some special ones for these later (coloured vs grey star?)

* Also (not related to evaluation) made the selection operators for the NLA Editor only work when not in tweaking mode, since in tweaking mode they can potentially result in data being resolved inappropriately when leaving tweaking mode.
2009-06-05 11:51:27 +00:00
Joshua Leung 5c21c176fa NLA SoC: Operators for 'tweaking' strip actions (TAB-Key for both)
In this commit, I've introduced the mechanism by which actions already referenced by strips used in the NLA can be edited (or 'tweaked'). To use, simply select a strip you wish to edit, and hit that TAB key to start tweaking that strip's action, and hit TAB again once you're done.


What happens when you enter 'tweak mode':
1) The action of the active strip temporarily becomes the 'active action' of the AnimData block. You are now able to edit this in one of the Animation Editors (DopeSheet/Action, Graph Editors) as per normal (i.e. sliding keyframes around, inserting keyframes, etc.). The 'action-line' will therefore get drawn immediately above the active track containing the active strip, so that it's clear that that's what we're editing.

2) All the NLA-tracks (and all the strips within them) that occur after the track that the active strip lived in get disabled while you're in tweakmode. This is equivalent to travelling back to an earlier state in a construction history stack.

3) The active NLA track also gets disabled while in tweakmode, since it would otherwise interfere with the correct functioning of the tweaking for the action of interest.

4) The 'real' active action (i.e. the one displaced by the active strip's action) gets put into temp storage, and will be restored after you exit tweakmode.

5) Any strips which also reference the action being tweaked will get highlighted in red shading to indicate that you may be making some changes to the action which you don't really want to make for the other users too.


Please note though, that this is only a rough prototype of this functionality, with some niceties still to come. i.e.:
* NLA-tracks after the active track should still get drawn above the 'tweaking action line', but perhaps with different appearance?
* Various tools will still need awareness of this to prevent corrupting operations from taking place. How to proceed is still undecided...
* When exiting tweak-mode, the strip the action came from still needs some form of syncing with the modified action... there are a few tricky issues here that will need to be solved
* Evaluation code doesn't totally take this into account yet...

---
Also, fixed a number of bugs with various code (notably selection, and also a few drawing bugs)
2009-06-05 05:18:07 +00:00
Joshua Leung 33267f5858 NLA SoC: Basic selection operators
* Added click-select/left-right select and deselect all/invert all selection operators. For now, these basic operators will suffice (more advanced selection operators will be coded at a later stage).

* Fixed a few bugs in DopeSheet found while coding the relevant tools for NLA. 

* Added custom border-select operator for NLA channels (since the standard one assumes negative direction channel order)

* Added new API-method for NLA strips to check if the strip occurs within a given range, since this test needed to be performed in a few places...

* Tweaked the NLA Editor View2D ranges a bit to give saner default sizing. This still isn't right yet though.
2009-05-31 11:14:50 +00:00
Joshua Leung c42eeddea4 NLA SoC: Bugfixes + Improvements to 'Push Down' track-selection
* Trying to save no longer crashes in some cases when the NLA Editor was open with some data. The sanity check added in filesel.c might be able to be backported to 2.5? (Elubie, please check)

* NLA-track names now get drawn with the correct colours for identifying themselves as being selected or not selected.

* Now the 'push down' functionality for actions will try to add the new strip to the last NLA track, provided it has space in the range required. 
* When new strips are added, they will only be allowed to extrapolate before/after if they are the first (time-wise) strip for the set of NLA data per AnimData block. This stops layered strips overriding strips that occurred in earlier tracks at earlier times.
2009-05-31 04:52:20 +00:00
Joshua Leung d141aff097 NLA SoC: Adding more backend code/utilities
* Data copying
* Strip sorting
2009-05-23 09:36:18 +00:00
Joshua Leung 3b7f63a088 NLA SoC: File IO for new NLA Datatypes 2009-05-22 11:19:35 +00:00
Joshua Leung 9b1ce6e556 NLA SoC: Part 1 of NLA-Data Management API
In this commit:
* Added code for freeing NLA data now stored in AnimData
* Started writing some utilities for adding NLA data, especially the 'push-down' concept for Actions
* Cleanups of existing code - removal of obsolete NLA code from various places

Next commits/parts:
* File IO code for new-style NLA data
* Version patching for old data to new data
2009-05-22 01:16:26 +00:00
Chris Want 5e3cffc64a Patch to change license to GPL only, from GSR. 2008-01-07 19:13:47 +00:00
Toni Alatalo a3d0d456ac More things for easying the job of replacing proxy/working armatures in the scenes of Elephants Dream with the final ones: 1) adds removing Fakeusers from Actions to PyAPI, now with a hackish call in the Blender module. Possibility of better ways should be discussed on bf-python. 2) adds BPY Object.copyNLA(otherob) - that was simple 'cause the copy_nla function was nicely in kernel nla.c. 3) Object.convertActionToStrip(), here it gets tricky: the function to convert the active action of an object to a NLA strip was buried inside the respective function in the GUI editnla.c which had also code for reading mouse coordinates and whatnot. So I took the actual copying out of it and moved it to the kernel nla.c as a new function, bActionStrip *convert_action_to_strip (Object *ob). that code used other functions, of which find_stridechannel() was also in editnla.c but free of UI code so i moved it to kernel too. kept things with UI code in editnla.c. tried to be careful with keeping mallocs and the pointer business intact, and tested that this works and after usage Blender gives no memory warnings or anything, so seems ok - but certainly is best reviewed by ppl more active with c coding than me. hopefully this little refactor makes it possible to add this function to the menus too, which was not straightforward earlier when Matt took a look at it. 2006-02-08 16:58:12 +00:00
Kent Mein f1c4f705a1 Removed the config.h thing from the .h's in the source dir.
So we should be all set now :)

Kent
--
mein@cs.umn.edu
2002-12-27 13:11:01 +00:00
Kent Mein b9a19f1ea7 Did all of the .h's in source
(adding)
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

also the Makefile.in's were from previous patch adding
the system depend stuff to configure.ac

Kent
--
mein@cs.umn.edu
2002-11-25 11:16:17 +00:00
Kent Mein 01bff70383 fixed spacing in the headers to get rid of some warnings and some other
little minor spacing issues.
2002-10-30 02:07:20 +00:00
Hans Lambermont 12315f4d0e Initial revision 2002-10-12 11:37:38 +00:00