Blender  V2.59
BKE_nla.h
Go to the documentation of this file.
00001 /*
00002  * $Id: BKE_nla.h 34962 2011-02-18 13:05:18Z jesterking $
00003  *
00004  * ***** BEGIN GPL LICENSE BLOCK *****
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software Foundation,
00018  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  *
00020  * The Original Code is Copyright (C) 2009 Blender Foundation, Joshua Leung
00021  * All rights reserved.
00022  *
00023  * The Original Code is: all of this file.
00024  *
00025  * Contributor(s): Joshua Leung (full recode)
00026  *
00027  * ***** END GPL LICENSE BLOCK *****
00028  */
00029 
00030 #ifndef BKE_NLA_H
00031 #define BKE_NLA_H
00032 
00038 struct AnimData;
00039 struct NlaStrip;
00040 struct NlaTrack;
00041 struct bAction;
00042 
00043 /* ----------------------------- */
00044 /* Data Management */
00045 
00046 void free_nlastrip(ListBase *strips, struct NlaStrip *strip);
00047 void free_nlatrack(ListBase *tracks, struct NlaTrack *nlt);
00048 void free_nladata(ListBase *tracks);
00049 
00050 struct NlaStrip *copy_nlastrip(struct NlaStrip *strip);
00051 struct NlaTrack *copy_nlatrack(struct NlaTrack *nlt);
00052 void copy_nladata(ListBase *dst, ListBase *src);
00053 
00054 struct NlaTrack *add_nlatrack(struct AnimData *adt, struct NlaTrack *prev);
00055 struct NlaStrip *add_nlastrip(struct bAction *act);
00056 struct NlaStrip *add_nlastrip_to_stack(struct AnimData *adt, struct bAction *act);
00057 
00058 /* ----------------------------- */
00059 /* API */
00060 
00061 short BKE_nlastrips_has_space(ListBase *strips, float start, float end);
00062 void BKE_nlastrips_sort_strips(ListBase *strips);
00063 
00064 short BKE_nlastrips_add_strip(ListBase *strips, struct NlaStrip *strip);
00065 
00066 
00067 void BKE_nlastrips_make_metas(ListBase *strips, short temp);
00068 void BKE_nlastrips_clear_metas(ListBase *strips, short onlySel, short onlyTemp);
00069 void BKE_nlastrips_clear_metastrip(ListBase *strips, struct NlaStrip *strip);
00070 short BKE_nlameta_add_strip(struct NlaStrip *mstrip, struct NlaStrip *strip);
00071 void BKE_nlameta_flush_transforms(struct NlaStrip *mstrip);
00072 
00073 /* ............ */
00074 
00075 struct NlaTrack *BKE_nlatrack_find_active(ListBase *tracks);
00076 void BKE_nlatrack_set_active(ListBase *tracks, struct NlaTrack *nlt);
00077 
00078 void BKE_nlatrack_solo_toggle(struct AnimData *adt, struct NlaTrack *nlt);
00079 
00080 short BKE_nlatrack_has_space(struct NlaTrack *nlt, float start, float end);
00081 void BKE_nlatrack_sort_strips(struct NlaTrack *nlt);
00082 
00083 short BKE_nlatrack_add_strip(struct NlaTrack *nlt, struct NlaStrip *strip);
00084 
00085 short BKE_nlatrack_get_bounds(struct NlaTrack *nlt, float bounds[2]);
00086 
00087 /* ............ */
00088 
00089 struct NlaStrip *BKE_nlastrip_find_active(struct NlaTrack *nlt);
00090 void BKE_nlastrip_set_active(struct AnimData *adt, struct NlaStrip *strip);
00091 
00092 short BKE_nlastrip_within_bounds(struct NlaStrip *strip, float min, float max);
00093 void BKE_nlastrip_recalculate_bounds(struct NlaStrip *strip);
00094 
00095 void BKE_nlastrip_validate_name(struct AnimData *adt, struct NlaStrip *strip);
00096 
00097 /* ............ */
00098 
00099 short BKE_nlatrack_has_animated_strips(struct NlaTrack *nlt);
00100 short BKE_nlatracks_have_animated_strips(ListBase *tracks);
00101 void BKE_nlastrip_validate_fcurves(struct NlaStrip *strip);
00102 
00103 void BKE_nla_validate_state(struct AnimData *adt);
00104 
00105 /* ............ */
00106 
00107 void BKE_nla_action_pushdown(struct AnimData *adt);
00108 
00109 short BKE_nla_tweakmode_enter(struct AnimData *adt);
00110 void BKE_nla_tweakmode_exit(struct AnimData *adt);
00111 
00112 /* ----------------------------- */
00113 /* Time Mapping */
00114 
00115 /* time mapping conversion modes */
00116 enum {
00117                 /* convert from global time to strip time - for evaluation */
00118         NLATIME_CONVERT_EVAL = 0,
00119                 /* convert from global time to strip time - for editing corrections */
00120                 // XXX old 0 invert
00121         NLATIME_CONVERT_UNMAP,
00122                 /* convert from strip time to global time */
00123                 // xxx old 1 invert
00124         NLATIME_CONVERT_MAP,
00125 } eNlaTime_ConvertModes;
00126 
00127 float BKE_nla_tweakedit_remap(struct AnimData *adt, float cframe, short mode);
00128 
00129 #endif
00130