nla_private.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. * ***** BEGIN GPL LICENSE BLOCK *****
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation; either version 2
  7. * of the License, or (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software Foundation,
  16. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  17. *
  18. * The Original Code is Copyright (C) 2009 Blender Foundation, Joshua Leung
  19. * All rights reserved.
  20. *
  21. * The Original Code is: all of this file.
  22. *
  23. * Contributor(s): Joshua Leung (full recode)
  24. *
  25. * ***** END GPL LICENSE BLOCK *****
  26. */
  27. /** \file blender/blenkernel/nla_private.h
  28. * \ingroup bke
  29. */
  30. #ifndef __NLA_PRIVATE_H__
  31. #define __NLA_PRIVATE_H__
  32. /* --------------- NLA Evaluation DataTypes ----------------------- */
  33. /* used for list of strips to accumulate at current time */
  34. typedef struct NlaEvalStrip {
  35. struct NlaEvalStrip *next, *prev;
  36. NlaTrack *track; /* track that this strip belongs to */
  37. NlaStrip *strip; /* strip that's being used */
  38. short track_index; /* the index of the track within the list */
  39. short strip_mode; /* which end of the strip are we looking at */
  40. float strip_time; /* time at which which strip is being evaluated */
  41. } NlaEvalStrip;
  42. /* NlaEvalStrip->strip_mode */
  43. enum eNlaEvalStrip_StripMode {
  44. /* standard evaluation */
  45. NES_TIME_BEFORE = -1,
  46. NES_TIME_WITHIN,
  47. NES_TIME_AFTER,
  48. /* transition-strip evaluations */
  49. NES_TIME_TRANSITION_START,
  50. NES_TIME_TRANSITION_END,
  51. };
  52. /* temp channel for accumulating data from NLA (avoids needing to clear all values first) */
  53. // TODO: maybe this will be used as the 'cache' stuff needed for editable values too?
  54. typedef struct NlaEvalChannel {
  55. struct NlaEvalChannel *next, *prev;
  56. PointerRNA ptr; /* pointer to struct containing property to use */
  57. PropertyRNA *prop; /* RNA-property type to use (should be in the struct given) */
  58. int index; /* array index (where applicable) */
  59. float value; /* value of this channel */
  60. } NlaEvalChannel;
  61. /* --------------- NLA Functions (not to be used as a proper API) ----------------------- */
  62. /* convert from strip time <-> global time */
  63. float nlastrip_get_frame(NlaStrip *strip, float cframe, short mode);
  64. /* --------------- NLA Evaluation (very-private stuff) ----------------------- */
  65. /* these functions are only defined here to avoid problems with the order in which they get defined... */
  66. NlaEvalStrip *nlastrips_ctime_get_strip(ListBase *list, ListBase *strips, short index, float ctime);
  67. void nlastrip_evaluate(PointerRNA *ptr, ListBase *channels, ListBase *modifiers, NlaEvalStrip *nes);
  68. void nladata_flush_channels(ListBase *channels);
  69. #endif /* __NLA_PRIVATE_H__ */