2011-02-21 07:25:24 +00:00
|
|
|
/*
|
2009-06-23 00:09:26 +00:00
|
|
|
* $Id$
|
2008-12-20 08:24:24 +00:00
|
|
|
*
|
|
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2008-12-20 08:24:24 +00:00
|
|
|
*
|
|
|
|
|
* The Original Code is Copyright (C) 2008, Blender Foundation
|
|
|
|
|
* This is a new part of Blender (with some old code)
|
|
|
|
|
*
|
|
|
|
|
* Contributor(s): Joshua Leung
|
|
|
|
|
*
|
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
|
*/
|
|
|
|
|
|
2011-02-21 07:25:24 +00:00
|
|
|
/** \file ED_keyframing.h
|
|
|
|
|
* \ingroup editors
|
|
|
|
|
*/
|
|
|
|
|
|
2009-01-06 10:31:25 +00:00
|
|
|
#ifndef ED_KEYFRAMING_H
|
|
|
|
|
#define ED_KEYFRAMING_H
|
2008-12-20 08:24:24 +00:00
|
|
|
|
2010-10-05 00:05:14 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2011-05-18 10:56:26 +00:00
|
|
|
struct Main;
|
2008-12-20 08:24:24 +00:00
|
|
|
struct ListBase;
|
|
|
|
|
struct ID;
|
2009-07-12 02:06:15 +00:00
|
|
|
struct Scene;
|
2008-12-20 08:24:24 +00:00
|
|
|
|
2009-02-11 12:19:42 +00:00
|
|
|
struct KeyingSet;
|
|
|
|
|
|
2009-04-15 01:10:36 +00:00
|
|
|
struct bAction;
|
2.5: Blender "Animato" - New Animation System
Finally, here is the basic (functional) prototype of the new animation system which will allow for the infamous "everything is animatable", and which also addresses several of the more serious shortcomings of the old system. Unfortunately, this will break old animation files (especially right now, as I haven't written the version patching code yet), however, this is for the future.
Highlights of the new system:
* Scrapped IPO-Curves/IPO/(Action+Constraint-Channels)/Action system, and replaced it with F-Curve/Action.
- F-Curves (animators from other packages will feel at home with this name) replace IPO-Curves.
- The 'new' Actions, act as the containers for F-Curves, so that they can be reused. They are therefore more akin to the old 'IPO' blocks, except they do not have the blocktype restriction, so you can store materials/texture/geometry F-Curves in the same Action as Object transforms, etc.
* F-Curves use RNA-paths for Data Access, hence allowing "every" (where sensible/editable that is) user-accessible setting from RNA to be animated.
* Drivers are no longer mixed with Animation Data, so rigs will not be that easily broken and several dependency problems can be eliminated. (NOTE: drivers haven't been hooked up yet, but the code is in place)
* F-Curve modifier system allows useful 'large-scale' manipulation of F-Curve values, including (I've only included implemented ones here): envelope deform (similar to lattices to allow broad-scale reshaping of curves), curve generator (polynomial or py-expression), cycles (replacing the old cyclic extrapolation modes, giving more control over this). (NOTE: currently this cannot be tested, as there's not access to them, but the code is all in place)
* NLA system with 'tracks' (i.e. layers), and multiple strips per track. (NOTE: NLA system is not yet functional, as it's only partially coded still)
There are more nice things that I will be preparing some nice docs for soon, but for now, check for more details:
http://lists.blender.org/pipermail/bf-taskforce25/2009-January/000260.html
So, what currently works:
* I've implemented two basic operators for the 3D-view only to Insert and Delete Keyframes. These are tempolary ones only that will be replaced in due course with 'proper' code.
* Object Loc/Rot/Scale can be keyframed. Also, the colour of the 'active' material (Note: this should really be for nth material instead, but that doesn't work yet in RNA) can also be keyframed into the same datablock.
* Standard animation refresh (i.e. animation resulting from NLA and Action evaluation) is now done completely separate from drivers before anything else is done after a frame change. Drivers are handled after this in a separate pass, as dictated by depsgraph flags, etc.
Notes:
* Drivers haven't been hooked up yet
* Only objects and data directly linked to objects can be animated.
* Depsgraph will need further tweaks. Currently, I've only made sure that it will update some things in the most basic cases (i.e. frame change).
* Animation Editors are currently broken (in terms of editing stuff). This will be my next target (priority to get Dopesheet working first, then F-Curve editor - i.e. old IPO Editor)
* I've had to put in large chunks of XXX sandboxing for old animation system code all around the place. This will be cleaned up in due course, as some places need special review.
In particular, the particles and sequencer code have far too many manual calls to calculate + flush animation info, which is really bad (this is a 'please explain yourselves' call to Physics coders!).
2009-01-17 03:12:50 +00:00
|
|
|
struct FCurve;
|
2008-12-20 08:24:24 +00:00
|
|
|
struct BezTriple;
|
|
|
|
|
|
2009-04-15 01:10:36 +00:00
|
|
|
struct bPoseChannel;
|
|
|
|
|
struct bConstraint;
|
|
|
|
|
|
|
|
|
|
struct bContext;
|
2.5: Blender "Animato" - New Animation System
Finally, here is the basic (functional) prototype of the new animation system which will allow for the infamous "everything is animatable", and which also addresses several of the more serious shortcomings of the old system. Unfortunately, this will break old animation files (especially right now, as I haven't written the version patching code yet), however, this is for the future.
Highlights of the new system:
* Scrapped IPO-Curves/IPO/(Action+Constraint-Channels)/Action system, and replaced it with F-Curve/Action.
- F-Curves (animators from other packages will feel at home with this name) replace IPO-Curves.
- The 'new' Actions, act as the containers for F-Curves, so that they can be reused. They are therefore more akin to the old 'IPO' blocks, except they do not have the blocktype restriction, so you can store materials/texture/geometry F-Curves in the same Action as Object transforms, etc.
* F-Curves use RNA-paths for Data Access, hence allowing "every" (where sensible/editable that is) user-accessible setting from RNA to be animated.
* Drivers are no longer mixed with Animation Data, so rigs will not be that easily broken and several dependency problems can be eliminated. (NOTE: drivers haven't been hooked up yet, but the code is in place)
* F-Curve modifier system allows useful 'large-scale' manipulation of F-Curve values, including (I've only included implemented ones here): envelope deform (similar to lattices to allow broad-scale reshaping of curves), curve generator (polynomial or py-expression), cycles (replacing the old cyclic extrapolation modes, giving more control over this). (NOTE: currently this cannot be tested, as there's not access to them, but the code is all in place)
* NLA system with 'tracks' (i.e. layers), and multiple strips per track. (NOTE: NLA system is not yet functional, as it's only partially coded still)
There are more nice things that I will be preparing some nice docs for soon, but for now, check for more details:
http://lists.blender.org/pipermail/bf-taskforce25/2009-January/000260.html
So, what currently works:
* I've implemented two basic operators for the 3D-view only to Insert and Delete Keyframes. These are tempolary ones only that will be replaced in due course with 'proper' code.
* Object Loc/Rot/Scale can be keyframed. Also, the colour of the 'active' material (Note: this should really be for nth material instead, but that doesn't work yet in RNA) can also be keyframed into the same datablock.
* Standard animation refresh (i.e. animation resulting from NLA and Action evaluation) is now done completely separate from drivers before anything else is done after a frame change. Drivers are handled after this in a separate pass, as dictated by depsgraph flags, etc.
Notes:
* Drivers haven't been hooked up yet
* Only objects and data directly linked to objects can be animated.
* Depsgraph will need further tweaks. Currently, I've only made sure that it will update some things in the most basic cases (i.e. frame change).
* Animation Editors are currently broken (in terms of editing stuff). This will be my next target (priority to get Dopesheet working first, then F-Curve editor - i.e. old IPO Editor)
* I've had to put in large chunks of XXX sandboxing for old animation system code all around the place. This will be cleaned up in due course, as some places need special review.
In particular, the particles and sequencer code have far too many manual calls to calculate + flush animation info, which is really bad (this is a 'please explain yourselves' call to Physics coders!).
2009-01-17 03:12:50 +00:00
|
|
|
struct wmOperatorType;
|
2010-11-17 12:02:36 +00:00
|
|
|
struct ReportList;
|
2008-12-29 01:19:25 +00:00
|
|
|
|
2009-07-08 05:00:10 +00:00
|
|
|
struct PointerRNA;
|
|
|
|
|
struct PropertyRNA;
|
2011-01-03 05:36:52 +00:00
|
|
|
struct EnumPropertyItem;
|
2009-07-08 05:00:10 +00:00
|
|
|
|
2010-03-16 16:15:30 +00:00
|
|
|
#include "RNA_types.h"
|
|
|
|
|
|
2008-12-20 08:24:24 +00:00
|
|
|
/* ************ Keyframing Management **************** */
|
|
|
|
|
|
2009-12-14 12:09:20 +00:00
|
|
|
/* Get the active settings for keyframing settings from context (specifically the given scene)
|
|
|
|
|
* - incl_mode: include settings from keyframing mode in the result (i.e. replace only)
|
|
|
|
|
*/
|
|
|
|
|
short ANIM_get_keyframing_flags(struct Scene *scene, short incl_mode);
|
|
|
|
|
|
|
|
|
|
/* -------- */
|
|
|
|
|
|
2009-04-15 01:10:36 +00:00
|
|
|
/* Get (or add relevant data to be able to do so) the Active Action for the given
|
|
|
|
|
* Animation Data block, given an ID block where the Animation Data should reside.
|
|
|
|
|
*/
|
|
|
|
|
struct bAction *verify_adt_action(struct ID *id, short add);
|
|
|
|
|
|
|
|
|
|
/* Get (or add relevant data to be able to do so) F-Curve from the given Action.
|
|
|
|
|
* This assumes that all the destinations are valid.
|
|
|
|
|
*/
|
|
|
|
|
struct FCurve *verify_fcurve(struct bAction *act, const char group[], const char rna_path[], const int array_index, short add);
|
|
|
|
|
|
|
|
|
|
/* -------- */
|
|
|
|
|
|
2008-12-20 08:24:24 +00:00
|
|
|
/* Lesser Keyframing API call:
|
|
|
|
|
* Use this when validation of necessary animation data isn't necessary as it already
|
|
|
|
|
* exists, and there is a beztriple that can be directly copied into the array.
|
|
|
|
|
*/
|
2009-09-04 04:27:06 +00:00
|
|
|
int insert_bezt_fcurve(struct FCurve *fcu, struct BezTriple *bezt, short flag);
|
2008-12-20 08:24:24 +00:00
|
|
|
|
|
|
|
|
/* Main Keyframing API call:
|
|
|
|
|
* Use this when validation of necessary animation data isn't necessary as it
|
|
|
|
|
* already exists. It will insert a keyframe using the current value being keyframed.
|
2009-09-04 04:27:06 +00:00
|
|
|
* Returns the index at which a keyframe was added (or -1 if failed)
|
2008-12-20 08:24:24 +00:00
|
|
|
*/
|
2009-09-04 04:27:06 +00:00
|
|
|
int insert_vert_fcurve(struct FCurve *fcu, float x, float y, short flag);
|
2008-12-20 08:24:24 +00:00
|
|
|
|
2009-07-08 05:00:10 +00:00
|
|
|
/* -------- */
|
|
|
|
|
|
|
|
|
|
/* Secondary Keyframing API calls:
|
|
|
|
|
* Use this to insert a keyframe using the current value being keyframed, in the
|
|
|
|
|
* nominated F-Curve (no creation of animation data performed). Returns success.
|
|
|
|
|
*/
|
2010-11-17 12:02:36 +00:00
|
|
|
short insert_keyframe_direct(struct ReportList *reports, struct PointerRNA ptr, struct PropertyRNA *prop, struct FCurve *fcu, float cfra, short flag);
|
2009-07-08 05:00:10 +00:00
|
|
|
|
2008-12-20 08:24:24 +00:00
|
|
|
/* -------- */
|
|
|
|
|
|
|
|
|
|
/* Main Keyframing API calls:
|
|
|
|
|
* Use this to create any necessary animation data, and then insert a keyframe
|
|
|
|
|
* using the current value being keyframed, in the relevant place. Returns success.
|
|
|
|
|
*/
|
2010-11-17 12:02:36 +00:00
|
|
|
short insert_keyframe(struct ReportList *reports, struct ID *id, struct bAction *act, const char group[], const char rna_path[], int array_index, float cfra, short flag);
|
2008-12-20 08:24:24 +00:00
|
|
|
|
|
|
|
|
/* Main Keyframing API call:
|
|
|
|
|
* Use this to delete keyframe on current frame for relevant channel. Will perform checks just in case.
|
|
|
|
|
*/
|
2010-11-17 12:02:36 +00:00
|
|
|
short delete_keyframe(struct ReportList *reports, struct ID *id, struct bAction *act, const char group[], const char rna_path[], int array_index, float cfra, short flag);
|
2009-02-11 12:19:42 +00:00
|
|
|
|
2009-04-15 01:10:36 +00:00
|
|
|
/* ************ Keying Sets ********************** */
|
|
|
|
|
|
== Massive Keying Sets Recode ==
After a few days of wrong turns and learning the finer points of RNA-type-subclassing the hard way, this commit finally presents a refactored version of the Keying Sets system (now version 2) based on some requirements from Cessen.
For a more thorough discussion of this commit, see
http://sites.google.com/site/aligorith/keyingsets_2.pdf?attredirects=0&d=1
------
The main highlight of this refactor is that relative Keying Sets have now been recoded so that Python callbacks are run to generate the Keying Set's list of paths everytime the Keying Set is used (to insert or delete keyframes), allowing complex heuristics to be used to determine whether a property gets keyframed based on the current context. These checks may include checking on selection status of related entities, or transform locks.
Built-In KeyingSets have also been recoded, and moved from C and out into Python. These are now coded as Relative Keying Sets, and can to some extent serve as basis for adding new relative Keying Sets. However, these have mostly been coded in a slightly 'modular' way which may be confusing for those not so familiar with Python in general. A usable template will be added soon for more general usage.
Keyframing settings (i.e. 'visual', 'needed') can now be specified on a per-path basis now, which is especially useful for Absolute Keying Sets, where control over this is often beneficial.
Most of the places where Auto-Keyframing is performed have been tidied up for consistency. I'm sure quite a few issues still exist there, but these I'll clean up over the next few days.
2010-03-16 06:18:49 +00:00
|
|
|
/* forward decl. for this struct which is declared a bit later... */
|
|
|
|
|
struct KeyingSetInfo;
|
2010-03-16 08:07:43 +00:00
|
|
|
struct ExtensionRNA;
|
== Massive Keying Sets Recode ==
After a few days of wrong turns and learning the finer points of RNA-type-subclassing the hard way, this commit finally presents a refactored version of the Keying Sets system (now version 2) based on some requirements from Cessen.
For a more thorough discussion of this commit, see
http://sites.google.com/site/aligorith/keyingsets_2.pdf?attredirects=0&d=1
------
The main highlight of this refactor is that relative Keying Sets have now been recoded so that Python callbacks are run to generate the Keying Set's list of paths everytime the Keying Set is used (to insert or delete keyframes), allowing complex heuristics to be used to determine whether a property gets keyframed based on the current context. These checks may include checking on selection status of related entities, or transform locks.
Built-In KeyingSets have also been recoded, and moved from C and out into Python. These are now coded as Relative Keying Sets, and can to some extent serve as basis for adding new relative Keying Sets. However, these have mostly been coded in a slightly 'modular' way which may be confusing for those not so familiar with Python in general. A usable template will be added soon for more general usage.
Keyframing settings (i.e. 'visual', 'needed') can now be specified on a per-path basis now, which is especially useful for Absolute Keying Sets, where control over this is often beneficial.
Most of the places where Auto-Keyframing is performed have been tidied up for consistency. I'm sure quite a few issues still exist there, but these I'll clean up over the next few days.
2010-03-16 06:18:49 +00:00
|
|
|
|
|
|
|
|
/* Polling Callback for KeyingSets */
|
|
|
|
|
typedef int (*cbKeyingSet_Poll)(struct KeyingSetInfo *ksi, struct bContext *C);
|
|
|
|
|
/* Context Iterator Callback for KeyingSets */
|
|
|
|
|
typedef void (*cbKeyingSet_Iterator)(struct KeyingSetInfo *ksi, struct bContext *C, struct KeyingSet *ks);
|
|
|
|
|
/* Property Specifier Callback for KeyingSets (called from iterators) */
|
|
|
|
|
typedef void (*cbKeyingSet_Generate)(struct KeyingSetInfo *ksi, struct bContext *C, struct KeyingSet *ks, struct PointerRNA *ptr);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Callback info for 'Procedural' KeyingSets to use */
|
|
|
|
|
typedef struct KeyingSetInfo {
|
|
|
|
|
struct KeyingSetInfo *next, *prev;
|
|
|
|
|
|
|
|
|
|
/* info */
|
|
|
|
|
/* identifier so that user can hook this up to a KeyingSet */
|
|
|
|
|
char name[64];
|
2010-03-24 12:48:03 +00:00
|
|
|
/* identifier used for class name, which KeyingSet instances reference as "Typeinfo Name" */
|
|
|
|
|
char idname[64];
|
== Massive Keying Sets Recode ==
After a few days of wrong turns and learning the finer points of RNA-type-subclassing the hard way, this commit finally presents a refactored version of the Keying Sets system (now version 2) based on some requirements from Cessen.
For a more thorough discussion of this commit, see
http://sites.google.com/site/aligorith/keyingsets_2.pdf?attredirects=0&d=1
------
The main highlight of this refactor is that relative Keying Sets have now been recoded so that Python callbacks are run to generate the Keying Set's list of paths everytime the Keying Set is used (to insert or delete keyframes), allowing complex heuristics to be used to determine whether a property gets keyframed based on the current context. These checks may include checking on selection status of related entities, or transform locks.
Built-In KeyingSets have also been recoded, and moved from C and out into Python. These are now coded as Relative Keying Sets, and can to some extent serve as basis for adding new relative Keying Sets. However, these have mostly been coded in a slightly 'modular' way which may be confusing for those not so familiar with Python in general. A usable template will be added soon for more general usage.
Keyframing settings (i.e. 'visual', 'needed') can now be specified on a per-path basis now, which is especially useful for Absolute Keying Sets, where control over this is often beneficial.
Most of the places where Auto-Keyframing is performed have been tidied up for consistency. I'm sure quite a few issues still exist there, but these I'll clean up over the next few days.
2010-03-16 06:18:49 +00:00
|
|
|
/* keying settings */
|
|
|
|
|
short keyingflag;
|
|
|
|
|
|
|
|
|
|
/* polling callbacks */
|
|
|
|
|
/* callback for polling the context for whether the right data is available */
|
|
|
|
|
cbKeyingSet_Poll poll;
|
2009-04-15 01:10:36 +00:00
|
|
|
|
== Massive Keying Sets Recode ==
After a few days of wrong turns and learning the finer points of RNA-type-subclassing the hard way, this commit finally presents a refactored version of the Keying Sets system (now version 2) based on some requirements from Cessen.
For a more thorough discussion of this commit, see
http://sites.google.com/site/aligorith/keyingsets_2.pdf?attredirects=0&d=1
------
The main highlight of this refactor is that relative Keying Sets have now been recoded so that Python callbacks are run to generate the Keying Set's list of paths everytime the Keying Set is used (to insert or delete keyframes), allowing complex heuristics to be used to determine whether a property gets keyframed based on the current context. These checks may include checking on selection status of related entities, or transform locks.
Built-In KeyingSets have also been recoded, and moved from C and out into Python. These are now coded as Relative Keying Sets, and can to some extent serve as basis for adding new relative Keying Sets. However, these have mostly been coded in a slightly 'modular' way which may be confusing for those not so familiar with Python in general. A usable template will be added soon for more general usage.
Keyframing settings (i.e. 'visual', 'needed') can now be specified on a per-path basis now, which is especially useful for Absolute Keying Sets, where control over this is often beneficial.
Most of the places where Auto-Keyframing is performed have been tidied up for consistency. I'm sure quite a few issues still exist there, but these I'll clean up over the next few days.
2010-03-16 06:18:49 +00:00
|
|
|
/* generate callbacks */
|
|
|
|
|
/* iterator to use to go through collections of data in context
|
|
|
|
|
* - this callback is separate from the 'adding' stage, allowing
|
|
|
|
|
* BuiltIn KeyingSets to be manually specified to use
|
|
|
|
|
*/
|
|
|
|
|
cbKeyingSet_Iterator iter;
|
|
|
|
|
/* generator to use to add properties based on the data found by iterator */
|
|
|
|
|
cbKeyingSet_Generate generate;
|
|
|
|
|
|
|
|
|
|
/* RNA integration */
|
2010-03-16 08:07:43 +00:00
|
|
|
struct ExtensionRNA ext;
|
== Massive Keying Sets Recode ==
After a few days of wrong turns and learning the finer points of RNA-type-subclassing the hard way, this commit finally presents a refactored version of the Keying Sets system (now version 2) based on some requirements from Cessen.
For a more thorough discussion of this commit, see
http://sites.google.com/site/aligorith/keyingsets_2.pdf?attredirects=0&d=1
------
The main highlight of this refactor is that relative Keying Sets have now been recoded so that Python callbacks are run to generate the Keying Set's list of paths everytime the Keying Set is used (to insert or delete keyframes), allowing complex heuristics to be used to determine whether a property gets keyframed based on the current context. These checks may include checking on selection status of related entities, or transform locks.
Built-In KeyingSets have also been recoded, and moved from C and out into Python. These are now coded as Relative Keying Sets, and can to some extent serve as basis for adding new relative Keying Sets. However, these have mostly been coded in a slightly 'modular' way which may be confusing for those not so familiar with Python in general. A usable template will be added soon for more general usage.
Keyframing settings (i.e. 'visual', 'needed') can now be specified on a per-path basis now, which is especially useful for Absolute Keying Sets, where control over this is often beneficial.
Most of the places where Auto-Keyframing is performed have been tidied up for consistency. I'm sure quite a few issues still exist there, but these I'll clean up over the next few days.
2010-03-16 06:18:49 +00:00
|
|
|
} KeyingSetInfo;
|
2009-04-15 01:10:36 +00:00
|
|
|
|
|
|
|
|
/* -------- */
|
|
|
|
|
|
== Massive Keying Sets Recode ==
After a few days of wrong turns and learning the finer points of RNA-type-subclassing the hard way, this commit finally presents a refactored version of the Keying Sets system (now version 2) based on some requirements from Cessen.
For a more thorough discussion of this commit, see
http://sites.google.com/site/aligorith/keyingsets_2.pdf?attredirects=0&d=1
------
The main highlight of this refactor is that relative Keying Sets have now been recoded so that Python callbacks are run to generate the Keying Set's list of paths everytime the Keying Set is used (to insert or delete keyframes), allowing complex heuristics to be used to determine whether a property gets keyframed based on the current context. These checks may include checking on selection status of related entities, or transform locks.
Built-In KeyingSets have also been recoded, and moved from C and out into Python. These are now coded as Relative Keying Sets, and can to some extent serve as basis for adding new relative Keying Sets. However, these have mostly been coded in a slightly 'modular' way which may be confusing for those not so familiar with Python in general. A usable template will be added soon for more general usage.
Keyframing settings (i.e. 'visual', 'needed') can now be specified on a per-path basis now, which is especially useful for Absolute Keying Sets, where control over this is often beneficial.
Most of the places where Auto-Keyframing is performed have been tidied up for consistency. I'm sure quite a few issues still exist there, but these I'll clean up over the next few days.
2010-03-16 06:18:49 +00:00
|
|
|
/* Add another data source for Relative Keying Sets to be evaluated with */
|
|
|
|
|
void ANIM_relative_keyingset_add_source(ListBase *dsources, struct ID *id, struct StructRNA *srna, void *data);
|
|
|
|
|
|
|
|
|
|
|
2009-04-15 01:10:36 +00:00
|
|
|
/* mode for modify_keyframes */
|
2009-10-27 16:13:50 +00:00
|
|
|
typedef enum eModifyKey_Modes {
|
2009-04-15 01:10:36 +00:00
|
|
|
MODIFYKEY_MODE_INSERT = 0,
|
|
|
|
|
MODIFYKEY_MODE_DELETE,
|
|
|
|
|
} eModifyKey_Modes;
|
|
|
|
|
|
== Massive Keying Sets Recode ==
After a few days of wrong turns and learning the finer points of RNA-type-subclassing the hard way, this commit finally presents a refactored version of the Keying Sets system (now version 2) based on some requirements from Cessen.
For a more thorough discussion of this commit, see
http://sites.google.com/site/aligorith/keyingsets_2.pdf?attredirects=0&d=1
------
The main highlight of this refactor is that relative Keying Sets have now been recoded so that Python callbacks are run to generate the Keying Set's list of paths everytime the Keying Set is used (to insert or delete keyframes), allowing complex heuristics to be used to determine whether a property gets keyframed based on the current context. These checks may include checking on selection status of related entities, or transform locks.
Built-In KeyingSets have also been recoded, and moved from C and out into Python. These are now coded as Relative Keying Sets, and can to some extent serve as basis for adding new relative Keying Sets. However, these have mostly been coded in a slightly 'modular' way which may be confusing for those not so familiar with Python in general. A usable template will be added soon for more general usage.
Keyframing settings (i.e. 'visual', 'needed') can now be specified on a per-path basis now, which is especially useful for Absolute Keying Sets, where control over this is often beneficial.
Most of the places where Auto-Keyframing is performed have been tidied up for consistency. I'm sure quite a few issues still exist there, but these I'll clean up over the next few days.
2010-03-16 06:18:49 +00:00
|
|
|
/* return codes for errors (with Relative KeyingSets) */
|
|
|
|
|
typedef enum eModifyKey_Returns {
|
|
|
|
|
/* context info was invalid for using the Keying Set */
|
|
|
|
|
MODIFYKEY_INVALID_CONTEXT = -1,
|
|
|
|
|
/* there isn't any typeinfo for generating paths from context */
|
|
|
|
|
MODIFYKEY_MISSING_TYPEINFO = -2,
|
|
|
|
|
} eModifyKey_Returns;
|
2009-04-15 01:10:36 +00:00
|
|
|
|
== Massive Keying Sets Recode ==
After a few days of wrong turns and learning the finer points of RNA-type-subclassing the hard way, this commit finally presents a refactored version of the Keying Sets system (now version 2) based on some requirements from Cessen.
For a more thorough discussion of this commit, see
http://sites.google.com/site/aligorith/keyingsets_2.pdf?attredirects=0&d=1
------
The main highlight of this refactor is that relative Keying Sets have now been recoded so that Python callbacks are run to generate the Keying Set's list of paths everytime the Keying Set is used (to insert or delete keyframes), allowing complex heuristics to be used to determine whether a property gets keyframed based on the current context. These checks may include checking on selection status of related entities, or transform locks.
Built-In KeyingSets have also been recoded, and moved from C and out into Python. These are now coded as Relative Keying Sets, and can to some extent serve as basis for adding new relative Keying Sets. However, these have mostly been coded in a slightly 'modular' way which may be confusing for those not so familiar with Python in general. A usable template will be added soon for more general usage.
Keyframing settings (i.e. 'visual', 'needed') can now be specified on a per-path basis now, which is especially useful for Absolute Keying Sets, where control over this is often beneficial.
Most of the places where Auto-Keyframing is performed have been tidied up for consistency. I'm sure quite a few issues still exist there, but these I'll clean up over the next few days.
2010-03-16 06:18:49 +00:00
|
|
|
/* use the specified KeyingSet to add/remove various Keyframes on the specified frame */
|
|
|
|
|
int ANIM_apply_keyingset(struct bContext *C, ListBase *dsources, struct bAction *act, struct KeyingSet *ks, short mode, float cfra);
|
2009-04-15 01:10:36 +00:00
|
|
|
|
== Massive Keying Sets Recode ==
After a few days of wrong turns and learning the finer points of RNA-type-subclassing the hard way, this commit finally presents a refactored version of the Keying Sets system (now version 2) based on some requirements from Cessen.
For a more thorough discussion of this commit, see
http://sites.google.com/site/aligorith/keyingsets_2.pdf?attredirects=0&d=1
------
The main highlight of this refactor is that relative Keying Sets have now been recoded so that Python callbacks are run to generate the Keying Set's list of paths everytime the Keying Set is used (to insert or delete keyframes), allowing complex heuristics to be used to determine whether a property gets keyframed based on the current context. These checks may include checking on selection status of related entities, or transform locks.
Built-In KeyingSets have also been recoded, and moved from C and out into Python. These are now coded as Relative Keying Sets, and can to some extent serve as basis for adding new relative Keying Sets. However, these have mostly been coded in a slightly 'modular' way which may be confusing for those not so familiar with Python in general. A usable template will be added soon for more general usage.
Keyframing settings (i.e. 'visual', 'needed') can now be specified on a per-path basis now, which is especially useful for Absolute Keying Sets, where control over this is often beneficial.
Most of the places where Auto-Keyframing is performed have been tidied up for consistency. I'm sure quite a few issues still exist there, but these I'll clean up over the next few days.
2010-03-16 06:18:49 +00:00
|
|
|
/* -------- */
|
2009-04-15 01:10:36 +00:00
|
|
|
|
|
|
|
|
/* Get the first builtin KeyingSet with the given name, which occurs after the given one (or start of list if none given) */
|
== Massive Keying Sets Recode ==
After a few days of wrong turns and learning the finer points of RNA-type-subclassing the hard way, this commit finally presents a refactored version of the Keying Sets system (now version 2) based on some requirements from Cessen.
For a more thorough discussion of this commit, see
http://sites.google.com/site/aligorith/keyingsets_2.pdf?attredirects=0&d=1
------
The main highlight of this refactor is that relative Keying Sets have now been recoded so that Python callbacks are run to generate the Keying Set's list of paths everytime the Keying Set is used (to insert or delete keyframes), allowing complex heuristics to be used to determine whether a property gets keyframed based on the current context. These checks may include checking on selection status of related entities, or transform locks.
Built-In KeyingSets have also been recoded, and moved from C and out into Python. These are now coded as Relative Keying Sets, and can to some extent serve as basis for adding new relative Keying Sets. However, these have mostly been coded in a slightly 'modular' way which may be confusing for those not so familiar with Python in general. A usable template will be added soon for more general usage.
Keyframing settings (i.e. 'visual', 'needed') can now be specified on a per-path basis now, which is especially useful for Absolute Keying Sets, where control over this is often beneficial.
Most of the places where Auto-Keyframing is performed have been tidied up for consistency. I'm sure quite a few issues still exist there, but these I'll clean up over the next few days.
2010-03-16 06:18:49 +00:00
|
|
|
struct KeyingSet *ANIM_builtin_keyingset_get_named(struct KeyingSet *prevKS, const char name[]);
|
|
|
|
|
|
|
|
|
|
/* Find KeyingSet type info given a name */
|
|
|
|
|
KeyingSetInfo *ANIM_keyingset_info_find_named(const char name[]);
|
2009-04-15 01:10:36 +00:00
|
|
|
|
== Massive Keying Sets Recode ==
After a few days of wrong turns and learning the finer points of RNA-type-subclassing the hard way, this commit finally presents a refactored version of the Keying Sets system (now version 2) based on some requirements from Cessen.
For a more thorough discussion of this commit, see
http://sites.google.com/site/aligorith/keyingsets_2.pdf?attredirects=0&d=1
------
The main highlight of this refactor is that relative Keying Sets have now been recoded so that Python callbacks are run to generate the Keying Set's list of paths everytime the Keying Set is used (to insert or delete keyframes), allowing complex heuristics to be used to determine whether a property gets keyframed based on the current context. These checks may include checking on selection status of related entities, or transform locks.
Built-In KeyingSets have also been recoded, and moved from C and out into Python. These are now coded as Relative Keying Sets, and can to some extent serve as basis for adding new relative Keying Sets. However, these have mostly been coded in a slightly 'modular' way which may be confusing for those not so familiar with Python in general. A usable template will be added soon for more general usage.
Keyframing settings (i.e. 'visual', 'needed') can now be specified on a per-path basis now, which is especially useful for Absolute Keying Sets, where control over this is often beneficial.
Most of the places where Auto-Keyframing is performed have been tidied up for consistency. I'm sure quite a few issues still exist there, but these I'll clean up over the next few days.
2010-03-16 06:18:49 +00:00
|
|
|
/* for RNA type registrations... */
|
2010-10-16 14:32:17 +00:00
|
|
|
void ANIM_keyingset_info_register(KeyingSetInfo *ksi);
|
2011-05-18 10:56:26 +00:00
|
|
|
void ANIM_keyingset_info_unregister(struct Main *bmain, KeyingSetInfo *ksi);
|
2009-04-15 01:10:36 +00:00
|
|
|
|
== Massive Keying Sets Recode ==
After a few days of wrong turns and learning the finer points of RNA-type-subclassing the hard way, this commit finally presents a refactored version of the Keying Sets system (now version 2) based on some requirements from Cessen.
For a more thorough discussion of this commit, see
http://sites.google.com/site/aligorith/keyingsets_2.pdf?attredirects=0&d=1
------
The main highlight of this refactor is that relative Keying Sets have now been recoded so that Python callbacks are run to generate the Keying Set's list of paths everytime the Keying Set is used (to insert or delete keyframes), allowing complex heuristics to be used to determine whether a property gets keyframed based on the current context. These checks may include checking on selection status of related entities, or transform locks.
Built-In KeyingSets have also been recoded, and moved from C and out into Python. These are now coded as Relative Keying Sets, and can to some extent serve as basis for adding new relative Keying Sets. However, these have mostly been coded in a slightly 'modular' way which may be confusing for those not so familiar with Python in general. A usable template will be added soon for more general usage.
Keyframing settings (i.e. 'visual', 'needed') can now be specified on a per-path basis now, which is especially useful for Absolute Keying Sets, where control over this is often beneficial.
Most of the places where Auto-Keyframing is performed have been tidied up for consistency. I'm sure quite a few issues still exist there, but these I'll clean up over the next few days.
2010-03-16 06:18:49 +00:00
|
|
|
/* cleanup on exit */
|
|
|
|
|
void ANIM_keyingset_infos_exit(void);
|
2009-10-08 06:39:45 +00:00
|
|
|
|
|
|
|
|
/* -------- */
|
|
|
|
|
|
|
|
|
|
/* Get the active KeyingSet for the given scene */
|
|
|
|
|
struct KeyingSet *ANIM_scene_get_active_keyingset(struct Scene *scene);
|
|
|
|
|
|
Keying Sets: BuiltIn vs Absolute Tweaks
This commit clarifies the somewhat "murky" separation between "builtin" and "absolute" KeyingSets as a result of discussions with Cessen.
* "Builtin" Keying Sets are now just the Keying Sets which in the past have been known as PyKeyingSets or Relative KeyingSets. These are registered from Py Scripts at startup, and will use the context info to determine what data they should be keyframing. These are stored per Blender session, independent of files, since usually these will be coded specific to sets of rigs used at a studio.
* "Absolute" Keying Sets are the ones that you can create from the Scene buttons and/or KKEY or RMB over any property. They specify the exact set of properties which should always get keyframed together. These are stored in the scene.
In relation to this, I've made it possible to now set one of the builtin Keying Set types as the active Keying Set.
* For now, this can only be done via the box beside the insert/delete key operator buttons on the TimeLine header (now complete with an recycled icon - HINT TO ICON DESIGNERS, to make this a bit more obvious). Later on I'll commit an operator to set this via a hotkey.
* The "IKEY" menu will only show up when there is no active Keying Set. When there is one, keying will happen silently (with info notice at the top of the screen). Later on, I'll hook this menu up to a hotkey, so that that active Keying Set can be changed without inserting keyframes or clearing active Keying Set...
* By default, there isn't any default Keying Set enabled. IMO, this is probably a good default, though some might like to have LocRotScale instead.
* I'm not terribly impressed with the search menu for the items being SORTED (and of all things, alphabetically!) currently, since this does break muscle-memory with the menu (and jumbles up order of closely related vs not closely related).
* The Scene buttons for KeyingSets still need some changes to fully cope with users setting builtin KeyingSets as active sometimes. Controls which are useless or shouldn't be used when a builtin set is shown are being shown.
Builtin set registrations have been tweaked a bit:
* Renamed "bl_idname" to "bl_label" for consistency with rest of API. Note that this is the identifier used by Blender internally when searching for the KeyingSet, and is also what the user sees.
2010-03-23 11:59:34 +00:00
|
|
|
/* Get the index of the Keying Set provided, for the given Scene */
|
|
|
|
|
int ANIM_scene_get_keyingset_index(struct Scene *scene, struct KeyingSet *ks);
|
|
|
|
|
|
2010-09-30 11:56:39 +00:00
|
|
|
/* Get Keying Set to use for Auto-Keyframing some transforms */
|
|
|
|
|
struct KeyingSet *ANIM_get_keyingset_for_autokeying(struct Scene *scene, const char *tranformKSName);
|
|
|
|
|
|
2010-03-25 11:34:18 +00:00
|
|
|
/* Create (and show) a menu containing all the Keying Sets which can be used in the current context */
|
2010-11-17 09:45:45 +00:00
|
|
|
void ANIM_keying_sets_menu_setup(struct bContext *C, const char title[], const char op_name[]);
|
2010-03-25 11:34:18 +00:00
|
|
|
|
2011-01-03 05:36:52 +00:00
|
|
|
/* Dynamically populate an enum of Keying Sets */
|
|
|
|
|
struct EnumPropertyItem *ANIM_keying_sets_enum_itemf(struct bContext *C, struct PointerRNA *ptr, int *free);
|
|
|
|
|
|
== Massive Keying Sets Recode ==
After a few days of wrong turns and learning the finer points of RNA-type-subclassing the hard way, this commit finally presents a refactored version of the Keying Sets system (now version 2) based on some requirements from Cessen.
For a more thorough discussion of this commit, see
http://sites.google.com/site/aligorith/keyingsets_2.pdf?attredirects=0&d=1
------
The main highlight of this refactor is that relative Keying Sets have now been recoded so that Python callbacks are run to generate the Keying Set's list of paths everytime the Keying Set is used (to insert or delete keyframes), allowing complex heuristics to be used to determine whether a property gets keyframed based on the current context. These checks may include checking on selection status of related entities, or transform locks.
Built-In KeyingSets have also been recoded, and moved from C and out into Python. These are now coded as Relative Keying Sets, and can to some extent serve as basis for adding new relative Keying Sets. However, these have mostly been coded in a slightly 'modular' way which may be confusing for those not so familiar with Python in general. A usable template will be added soon for more general usage.
Keyframing settings (i.e. 'visual', 'needed') can now be specified on a per-path basis now, which is especially useful for Absolute Keying Sets, where control over this is often beneficial.
Most of the places where Auto-Keyframing is performed have been tidied up for consistency. I'm sure quite a few issues still exist there, but these I'll clean up over the next few days.
2010-03-16 06:18:49 +00:00
|
|
|
/* Check if KeyingSet can be used in the current context */
|
|
|
|
|
short ANIM_keyingset_context_ok_poll(struct bContext *C, struct KeyingSet *ks);
|
|
|
|
|
|
2009-04-10 13:08:12 +00:00
|
|
|
/* ************ Drivers ********************** */
|
|
|
|
|
|
2010-12-28 05:45:15 +00:00
|
|
|
/* Flags for use by driver creation calls */
|
|
|
|
|
typedef enum eCreateDriverFlags {
|
|
|
|
|
CREATEDRIVER_WITH_DEFAULT_DVAR = (1<<0), /* create drivers with a default variable for nicer UI */
|
|
|
|
|
} eCreateDriverFlags;
|
|
|
|
|
|
|
|
|
|
/* -------- */
|
|
|
|
|
|
2009-09-25 04:51:04 +00:00
|
|
|
/* Returns whether there is a driver in the copy/paste buffer to paste */
|
|
|
|
|
short ANIM_driver_can_paste(void);
|
|
|
|
|
|
2009-04-10 13:08:12 +00:00
|
|
|
/* Main Driver Management API calls:
|
|
|
|
|
* Add a new driver for the specified property on the given ID block
|
|
|
|
|
*/
|
2010-12-28 05:45:15 +00:00
|
|
|
short ANIM_add_driver(struct ReportList *reports, struct ID *id, const char rna_path[], int array_index, short flag, int type);
|
2009-04-10 13:08:12 +00:00
|
|
|
|
|
|
|
|
/* Main Driver Management API calls:
|
|
|
|
|
* Remove the driver for the specified property on the given ID block (if available)
|
|
|
|
|
*/
|
2010-12-28 05:45:15 +00:00
|
|
|
short ANIM_remove_driver(struct ReportList *reports, struct ID *id, const char rna_path[], int array_index, short flag);
|
2009-09-25 04:51:04 +00:00
|
|
|
|
|
|
|
|
/* Main Driver Management API calls:
|
|
|
|
|
* Make a copy of the driver for the specified property on the given ID block
|
|
|
|
|
*/
|
2010-12-28 05:45:15 +00:00
|
|
|
short ANIM_copy_driver(struct ReportList *reports, struct ID *id, const char rna_path[], int array_index, short flag);
|
2009-09-25 04:51:04 +00:00
|
|
|
|
|
|
|
|
/* Main Driver Management API calls:
|
|
|
|
|
* Add a new driver for the specified property on the given ID block or replace an existing one
|
|
|
|
|
* with the driver + driver-curve data from the buffer
|
|
|
|
|
*/
|
2010-12-28 05:45:15 +00:00
|
|
|
short ANIM_paste_driver(struct ReportList *reports, struct ID *id, const char rna_path[], int array_index, short flag);
|
2009-04-10 13:08:12 +00:00
|
|
|
|
2008-12-20 08:24:24 +00:00
|
|
|
/* ************ Auto-Keyframing ********************** */
|
|
|
|
|
/* Notes:
|
|
|
|
|
* - All the defines for this (User-Pref settings and Per-Scene settings)
|
|
|
|
|
* are defined in DNA_userdef_types.h
|
|
|
|
|
* - Scene settings take presidence over those for userprefs, with old files
|
|
|
|
|
* inheriting userpref settings for the scene settings
|
|
|
|
|
* - "On/Off + Mode" are stored per Scene, but "settings" are currently stored
|
|
|
|
|
* as userprefs
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/* Auto-Keying macros for use by various tools */
|
|
|
|
|
/* check if auto-keyframing is enabled (per scene takes presidence) */
|
2009-06-23 00:41:55 +00:00
|
|
|
#define IS_AUTOKEY_ON(scene) ((scene) ? (scene->toolsettings->autokey_mode & AUTOKEY_ON) : (U.autokey_mode & AUTOKEY_ON))
|
2008-12-20 08:24:24 +00:00
|
|
|
/* check the mode for auto-keyframing (per scene takes presidence) */
|
2009-06-23 00:41:55 +00:00
|
|
|
#define IS_AUTOKEY_MODE(scene, mode) ((scene) ? (scene->toolsettings->autokey_mode == AUTOKEY_MODE_##mode) : (U.autokey_mode == AUTOKEY_MODE_##mode))
|
2011-02-04 08:33:07 +00:00
|
|
|
/* check if a flag is set for auto-keyframing (per scene takes presidence) */
|
|
|
|
|
#define IS_AUTOKEY_FLAG(scene, flag) \
|
|
|
|
|
((scene)? \
|
|
|
|
|
((scene->toolsettings->autokey_flag & AUTOKEY_FLAG_##flag) || (U.autokey_flag & AUTOKEY_FLAG_##flag)) \
|
|
|
|
|
: \
|
|
|
|
|
(U.autokey_flag & AUTOKEY_FLAG_##flag))
|
2008-12-20 08:24:24 +00:00
|
|
|
|
2009-07-12 02:06:15 +00:00
|
|
|
/* auto-keyframing feature - checks for whether anything should be done for the current frame */
|
|
|
|
|
int autokeyframe_cfra_can_key(struct Scene *scene, struct ID *id);
|
|
|
|
|
|
2008-12-20 08:24:24 +00:00
|
|
|
/* ************ Keyframe Checking ******************** */
|
|
|
|
|
|
2009-07-08 12:30:09 +00:00
|
|
|
/* Lesser Keyframe Checking API call:
|
|
|
|
|
* - Used for the buttons to check for keyframes...
|
|
|
|
|
*/
|
|
|
|
|
short fcurve_frame_has_keyframe(struct FCurve *fcu, float frame, short filter);
|
|
|
|
|
|
2008-12-20 08:24:24 +00:00
|
|
|
/* Main Keyframe Checking API call:
|
|
|
|
|
* Checks whether a keyframe exists for the given ID-block one the given frame.
|
|
|
|
|
* - It is recommended to call this method over the other keyframe-checkers directly,
|
|
|
|
|
* in case some detail of the implementation changes...
|
2010-06-27 05:39:55 +00:00
|
|
|
* - frame: the value of this is quite often result of BKE_curframe()
|
2008-12-20 08:24:24 +00:00
|
|
|
*/
|
|
|
|
|
short id_frame_has_keyframe(struct ID *id, float frame, short filter);
|
|
|
|
|
|
|
|
|
|
/* filter flags for id_cfra_has_keyframe
|
|
|
|
|
*
|
|
|
|
|
* WARNING: do not alter order of these, as also stored in files
|
|
|
|
|
* (for v3d->keyflags)
|
|
|
|
|
*/
|
2009-10-27 16:13:50 +00:00
|
|
|
typedef enum eAnimFilterFlags {
|
2008-12-20 08:24:24 +00:00
|
|
|
/* general */
|
2008-12-21 04:11:19 +00:00
|
|
|
ANIMFILTER_KEYS_LOCAL = (1<<0), /* only include locally available anim data */
|
|
|
|
|
ANIMFILTER_KEYS_MUTED = (1<<1), /* include muted elements */
|
|
|
|
|
ANIMFILTER_KEYS_ACTIVE = (1<<2), /* only include active-subelements */
|
2008-12-20 08:24:24 +00:00
|
|
|
|
|
|
|
|
/* object specific */
|
2008-12-21 04:11:19 +00:00
|
|
|
ANIMFILTER_KEYS_NOMAT = (1<<9), /* don't include material keyframes */
|
|
|
|
|
ANIMFILTER_KEYS_NOSKEY = (1<<10), /* don't include shape keys (for geometry) */
|
2008-12-20 08:24:24 +00:00
|
|
|
} eAnimFilterFlags;
|
|
|
|
|
|
2010-10-05 00:05:14 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2009-01-06 10:31:25 +00:00
|
|
|
#endif /* ED_KEYFRAMING_H */
|