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