Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault de Villèle <thibaulltt>2022-07-04 13:59:10 +0300
committerSybren A. Stüvel <sybren@blender.org>2022-07-05 11:51:43 +0300
commitbd00324c264c07d7872071e9ef888b6b92e5645f (patch)
tree015874012d38538159173cdafa5a39055bea1c09 /source/blender/blenkernel/BKE_nla.h
parent322abb2e4b5ca145d854284159e198556d03a6c7 (diff)
NLA: change behavior of 'Frame Start' / 'End' sliders
Change the behavior of the "Frame start" and [Frame] "End" fields of an NLA Strip in the NLA editor. Frame Start now behaves like translating with {key G} and moving the mouse. It also updates the Frame End to ensure the strip remains the same length. Frame End changes the length of the strip, based on the Repeat property. If there are no repeats (i.e. number of repeats = 1) the underlying Action will change length, such that more or less of its keyframes will be part of the NLA strip. If there are repeats (i.e. number of repeats smaller or larger than 1), the number of repeats will change. Either way, the effective end frame off the strip will be the one set in the Frame End slider. The old behavior of stretching time has been removed. It is still possible to stretch time of a strip, but this no longer automatically happens when manipulating the Frame Start and Frame End sliders. **Technical details:** new RNA properties `frame_start_ui` and `frame_end_ui` have been added. Changing those values (for example via the sliders, but also via Python) trigger the above behavior. The behavior of the already-existing `frame_start` and `frame_end` properties has been simplified, such that these can be set from Python without many side-effects, simplifying import of data into the NLA. Reviewed By: sybren, RiggingDojo Differential Revision: https://developer.blender.org/D14658
Diffstat (limited to 'source/blender/blenkernel/BKE_nla.h')
-rw-r--r--source/blender/blenkernel/BKE_nla.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_nla.h b/source/blender/blenkernel/BKE_nla.h
index 215adc3e67b..a9444156498 100644
--- a/source/blender/blenkernel/BKE_nla.h
+++ b/source/blender/blenkernel/BKE_nla.h
@@ -7,6 +7,9 @@
* \ingroup bke
*/
+/* temp constant defined for these funcs only... */
+# define NLASTRIP_MIN_LEN_THRESH 0.1f
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -219,6 +222,32 @@ bool BKE_nlatrack_is_nonlocal_in_liboverride(const struct ID *id, const struct N
/* ............ */
/**
+ * Compute the left-hand-side 'frame limit' of that strip, in its NLA track.
+ *
+ * \details This is either :
+ * - the end frame of the previous strip, if the strip's track contains another strip on it left
+ * - the macro MINFRAMEF, if no strips are to the left of this strip in its track
+ *
+ * \param strip The strip to compute the left-hand-side 'frame limit' of.
+ * \return The beginning frame of the previous strip, or MINFRAMEF if no strips are next in that track.
+ */
+float BKE_nlastrip_compute_frame_from_previous_strip(struct NlaStrip *strip);
+/**
+ * Compute the right-hand-side 'frame limit' of that strip, in its NLA track.
+ *
+ * \details This is either :
+ *
+ * - the begin frame of the next strip, if the strip's track contains another strip on it right
+ * - the macro MAXFRAMEF, if no strips are to the right of this strip in its track
+ *
+ * \param strip The strip to compute the right-hand-side 'frame limit' of.
+ * \return The beginning frame of the next strip, or MAXFRAMEF if no strips are next in that track.
+ */
+float BKE_nlastrip_compute_frame_to_next_strip(struct NlaStrip *strip);
+
+/* ............ */
+
+/**
* Find the active NLA-strip within the given track.
*/
struct NlaStrip *BKE_nlastrip_find_active(struct NlaTrack *nlt);