Blender V2.61 - r43446

BKE_nla.h

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