|
Blender
V2.59
|
00001 /* 00002 * $Id: nla_private.h 35247 2011-02-27 20:40:57Z 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 00035 #ifndef NLA_PRIVATE 00036 #define NLA_PRIVATE 00037 00038 /* --------------- NLA Evaluation DataTypes ----------------------- */ 00039 00040 /* used for list of strips to accumulate at current time */ 00041 typedef struct NlaEvalStrip { 00042 struct NlaEvalStrip *next, *prev; 00043 00044 NlaTrack *track; /* track that this strip belongs to */ 00045 NlaStrip *strip; /* strip that's being used */ 00046 00047 short track_index; /* the index of the track within the list */ 00048 short strip_mode; /* which end of the strip are we looking at */ 00049 00050 float strip_time; /* time at which which strip is being evaluated */ 00051 } NlaEvalStrip; 00052 00053 /* NlaEvalStrip->strip_mode */ 00054 enum { 00055 /* standard evaluation */ 00056 NES_TIME_BEFORE = -1, 00057 NES_TIME_WITHIN, 00058 NES_TIME_AFTER, 00059 00060 /* transition-strip evaluations */ 00061 NES_TIME_TRANSITION_START, 00062 NES_TIME_TRANSITION_END, 00063 } eNlaEvalStrip_StripMode; 00064 00065 00066 /* temp channel for accumulating data from NLA (avoids needing to clear all values first) */ 00067 // TODO: maybe this will be used as the 'cache' stuff needed for editable values too? 00068 typedef struct NlaEvalChannel { 00069 struct NlaEvalChannel *next, *prev; 00070 00071 PointerRNA ptr; /* pointer to struct containing property to use */ 00072 PropertyRNA *prop; /* RNA-property type to use (should be in the struct given) */ 00073 int index; /* array index (where applicable) */ 00074 00075 float value; /* value of this channel */ 00076 } NlaEvalChannel; 00077 00078 /* --------------- NLA Functions (not to be used as a proper API) ----------------------- */ 00079 00080 /* convert from strip time <-> global time */ 00081 float nlastrip_get_frame(NlaStrip *strip, float cframe, short mode); 00082 00083 /* --------------- NLA Evaluation (very-private stuff) ----------------------- */ 00084 /* these functions are only defined here to avoid problems with the order in which they get defined... */ 00085 00086 NlaEvalStrip *nlastrips_ctime_get_strip(ListBase *list, ListBase *strips, short index, float ctime); 00087 void nlastrip_evaluate(PointerRNA *ptr, ListBase *channels, ListBase *modifiers, NlaEvalStrip *nes); 00088 void nladata_flush_channels(ListBase *channels); 00089 00090 #endif // NLA_PRIVATE