tornavis/source/blender/makesdna/DNA_nla_types.h

72 lines
2.2 KiB
C
Raw Normal View History

2002-10-12 13:37:38 +02:00
/**
* $Id$
*
* ***** BEGIN GPL/BL DUAL 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. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* 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,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#ifndef DNA_NLA_TYPES_H
#define DNA_NLA_TYPES_H
struct bAction;
struct Ipo;
Big commit with work on Groups & Libraries: -> Any Group Duplicate now can get local timing and local NLA override. This enables to control the entire animation system of the Group. Two methods for this have been implemented. 1) The quick way: just give the duplicator a "Startframe" offset. 2) Advanced: in the NLA Editor you can add ActionStrips to the duplicator to override NLA/action of any Grouped Object. For "Group NLA" to work, an ActionStrip needs to know which Object in a group it controls. On adding a strip, the code checks if an Action was already used by an Object in the Group, and assigns it automatic to that Object. You can also set this in the Nkey "Properties" panel for the strip. Change in NLA: the SHIFT+A "Add strip" command now always adds strips to the active Object. (It used to check where mouse was). This allows to add NLA strips to Objects that didn't have actions/nla yet. Important note: In Blender, duplicates are fully procedural and generated on the fly for each redraw. This means that redraw speed equals to stepping through frames, when using animated Duplicated Groups. -> Recoded entire duplicator system The old method was antique and clumsy, using globals and full temporal copies of Object. The new system is nicer in control, faster, and since it doesn't use temporal object copies anymore, it works better with Derived Mesh and DisplayList and rendering. By centralizing the code for duplicating, more options can be easier added. Features to note: - Duplicates now draw selected/unselected based on its Duplicator setting. - Same goes for the drawtype (wire, solid, selection outline, etc) - Duplicated Groups can be normally selected too Bonus goodie: SHIFT+A (Toolbox) now has entry "Add group" too, with a listing of all groups, allowing to add Group instances immediate. -> Library System - SHIFT+F4 data browse now shows the entire path for linked data - Outliner draws Library Icons to denote linked data - Outliner operation added: "Make Local" for library data. - Outliner now also draws Groups in regular view, allowing to unlink too. -> Fixes - depsgraph missed signal update for bone-parented Objects - on reading file, the entire database was tagged to "recalc" fully, causing unnecessary slowdown on reading. Might have missed stuff... :)
2005-12-11 14:23:30 +01:00
struct Object;
2002-10-12 13:37:38 +02:00
typedef struct bActionStrip {
struct bActionStrip *next, *prev;
Three new features: 1) Stride Bone For walkcycles, you could already set an NLA strip to cycle over a path based on a preset distance value. This cycling happens based on a linear interpolation, with constant speed. Not all cycles have a constant speed however, like hopping or jumping. To ensure a perfect slipping-less foot contact, you now can set a Bone in an Armature to define the stride. This "Stride Bone" then becomes a sort-of ruler, a conveyor belt, on which the character walks. When using the NLA "Use Path" option, it then tries to keep the Stride Bone entirely motionless on the path, by cancelling out its motion (for the entire Armature). This means that the animation keys for a Stride Bone have to be exactly negative of the desired path. Only, at choice, the X,Y or Z Ipo curve is used for this stride. Examples: http://www.blender.org/bf/0001_0040.avi The top armature shows the actual Action, the bottom armature has been parented to a Path, using the Stride Bone feature. http://www.blender.org/bf/0001_0080.avi Here the Stride Bone has a number of children, creating a ruler to be used as reference while animating. Test .blend: http://www.blender.org/bf/motionblender1.blend Notes: - Note that action keys for Bones work local, based on the Bone's orientation as set in EditMode. Therefore, an Y translation always goes in the Bone's direction. - To be able to get a "solvable" stride, the animation curve has to be inverse evaluated, using a Newton Raphson root solver. That means you can only create stride curves that keep moving forward, and cannot return halfway. - Set the Stride Bone in the Editing Buttons, Bone Panel. You can set change the name or set the axis in the NLA Window, Strip Properties Panel. - Files in this commit will move to the blender.org release section. 2) Armature Ghosting In EditButtons, Armature Panel, you can set an armature to draw ghosts. The number value denotes the amount of frames that have to be drawn extra (for the active action!) around the current frame. Ghosts only evaluate its own Pose, executing it's Actions, Constraints and IK. No external dependencies are re-evaluated for it. 3) NLA/Action time control If you click in the NLA window on the action (linked to Object), it makes sure the Timing as drawn in the Action editor is not corrected for NLA. If you also set the Object to "Action", this timing will be executed on the Object as well (not NLA time). (It's a bit confusing... will make a good doc & maybe review UI!)
2005-11-01 13:44:30 +01:00
short flag, mode;
short stride_axis, pad; /* axis 0=x, 1=y, 2=z */
2002-10-12 13:37:38 +02:00
struct Ipo *ipo; /* Blending ipo */
struct bAction *act; /* The action referenced by this strip */
Big commit with work on Groups & Libraries: -> Any Group Duplicate now can get local timing and local NLA override. This enables to control the entire animation system of the Group. Two methods for this have been implemented. 1) The quick way: just give the duplicator a "Startframe" offset. 2) Advanced: in the NLA Editor you can add ActionStrips to the duplicator to override NLA/action of any Grouped Object. For "Group NLA" to work, an ActionStrip needs to know which Object in a group it controls. On adding a strip, the code checks if an Action was already used by an Object in the Group, and assigns it automatic to that Object. You can also set this in the Nkey "Properties" panel for the strip. Change in NLA: the SHIFT+A "Add strip" command now always adds strips to the active Object. (It used to check where mouse was). This allows to add NLA strips to Objects that didn't have actions/nla yet. Important note: In Blender, duplicates are fully procedural and generated on the fly for each redraw. This means that redraw speed equals to stepping through frames, when using animated Duplicated Groups. -> Recoded entire duplicator system The old method was antique and clumsy, using globals and full temporal copies of Object. The new system is nicer in control, faster, and since it doesn't use temporal object copies anymore, it works better with Derived Mesh and DisplayList and rendering. By centralizing the code for duplicating, more options can be easier added. Features to note: - Duplicates now draw selected/unselected based on its Duplicator setting. - Same goes for the drawtype (wire, solid, selection outline, etc) - Duplicated Groups can be normally selected too Bonus goodie: SHIFT+A (Toolbox) now has entry "Add group" too, with a listing of all groups, allowing to add Group instances immediate. -> Library System - SHIFT+F4 data browse now shows the entire path for linked data - Outliner draws Library Icons to denote linked data - Outliner operation added: "Make Local" for library data. - Outliner now also draws Groups in regular view, allowing to unlink too. -> Fixes - depsgraph missed signal update for bone-parented Objects - on reading file, the entire database was tagged to "recalc" fully, causing unnecessary slowdown on reading. Might have missed stuff... :)
2005-12-11 14:23:30 +01:00
struct Object *object; /* For groups, the actual object being nla'ed */
2002-10-12 13:37:38 +02:00
float start, end; /* The range of frames covered by this strip */
float actstart, actend; /* The range of frames taken from the action */
float stridelen; /* The stridelength (considered when flag & ACT_USESTRIDE) */
float repeat; /* The number of times to repeat the action range */
float blendin, blendout;
Three new features: 1) Stride Bone For walkcycles, you could already set an NLA strip to cycle over a path based on a preset distance value. This cycling happens based on a linear interpolation, with constant speed. Not all cycles have a constant speed however, like hopping or jumping. To ensure a perfect slipping-less foot contact, you now can set a Bone in an Armature to define the stride. This "Stride Bone" then becomes a sort-of ruler, a conveyor belt, on which the character walks. When using the NLA "Use Path" option, it then tries to keep the Stride Bone entirely motionless on the path, by cancelling out its motion (for the entire Armature). This means that the animation keys for a Stride Bone have to be exactly negative of the desired path. Only, at choice, the X,Y or Z Ipo curve is used for this stride. Examples: http://www.blender.org/bf/0001_0040.avi The top armature shows the actual Action, the bottom armature has been parented to a Path, using the Stride Bone feature. http://www.blender.org/bf/0001_0080.avi Here the Stride Bone has a number of children, creating a ruler to be used as reference while animating. Test .blend: http://www.blender.org/bf/motionblender1.blend Notes: - Note that action keys for Bones work local, based on the Bone's orientation as set in EditMode. Therefore, an Y translation always goes in the Bone's direction. - To be able to get a "solvable" stride, the animation curve has to be inverse evaluated, using a Newton Raphson root solver. That means you can only create stride curves that keep moving forward, and cannot return halfway. - Set the Stride Bone in the Editing Buttons, Bone Panel. You can set change the name or set the axis in the NLA Window, Strip Properties Panel. - Files in this commit will move to the blender.org release section. 2) Armature Ghosting In EditButtons, Armature Panel, you can set an armature to draw ghosts. The number value denotes the amount of frames that have to be drawn extra (for the active action!) around the current frame. Ghosts only evaluate its own Pose, executing it's Actions, Constraints and IK. No external dependencies are re-evaluated for it. 3) NLA/Action time control If you click in the NLA window on the action (linked to Object), it makes sure the Timing as drawn in the Action editor is not corrected for NLA. If you also set the Object to "Action", this timing will be executed on the Object as well (not NLA time). (It's a bit confusing... will make a good doc & maybe review UI!)
2005-11-01 13:44:30 +01:00
char stridechannel[32]; /* Instead of stridelen, it uses an action channel */
2002-10-12 13:37:38 +02:00
} bActionStrip;
#define ACTSTRIPMODE_BLEND 0
#define ACTSTRIPMODE_ADD 1
/* strip->flag */
#define ACTSTRIP_SELECT 0x01
#define ACTSTRIP_USESTRIDE 0x02
#define ACTSTRIP_BLENDTONEXT 0x04
#define ACTSTRIP_HOLDLASTFRAME 0x08
#define ACTSTRIP_ACTIVE 0x10
#define ACTSTRIP_LOCK_ACTION 0x20
2002-10-12 13:37:38 +02:00
Three new features: 1) Stride Bone For walkcycles, you could already set an NLA strip to cycle over a path based on a preset distance value. This cycling happens based on a linear interpolation, with constant speed. Not all cycles have a constant speed however, like hopping or jumping. To ensure a perfect slipping-less foot contact, you now can set a Bone in an Armature to define the stride. This "Stride Bone" then becomes a sort-of ruler, a conveyor belt, on which the character walks. When using the NLA "Use Path" option, it then tries to keep the Stride Bone entirely motionless on the path, by cancelling out its motion (for the entire Armature). This means that the animation keys for a Stride Bone have to be exactly negative of the desired path. Only, at choice, the X,Y or Z Ipo curve is used for this stride. Examples: http://www.blender.org/bf/0001_0040.avi The top armature shows the actual Action, the bottom armature has been parented to a Path, using the Stride Bone feature. http://www.blender.org/bf/0001_0080.avi Here the Stride Bone has a number of children, creating a ruler to be used as reference while animating. Test .blend: http://www.blender.org/bf/motionblender1.blend Notes: - Note that action keys for Bones work local, based on the Bone's orientation as set in EditMode. Therefore, an Y translation always goes in the Bone's direction. - To be able to get a "solvable" stride, the animation curve has to be inverse evaluated, using a Newton Raphson root solver. That means you can only create stride curves that keep moving forward, and cannot return halfway. - Set the Stride Bone in the Editing Buttons, Bone Panel. You can set change the name or set the axis in the NLA Window, Strip Properties Panel. - Files in this commit will move to the blender.org release section. 2) Armature Ghosting In EditButtons, Armature Panel, you can set an armature to draw ghosts. The number value denotes the amount of frames that have to be drawn extra (for the active action!) around the current frame. Ghosts only evaluate its own Pose, executing it's Actions, Constraints and IK. No external dependencies are re-evaluated for it. 3) NLA/Action time control If you click in the NLA window on the action (linked to Object), it makes sure the Timing as drawn in the Action editor is not corrected for NLA. If you also set the Object to "Action", this timing will be executed on the Object as well (not NLA time). (It's a bit confusing... will make a good doc & maybe review UI!)
2005-11-01 13:44:30 +01:00
2002-10-12 13:37:38 +02:00
#endif