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:
authorJoshua Leung <aligorith@gmail.com>2013-01-21 10:31:17 +0400
committerJoshua Leung <aligorith@gmail.com>2013-01-21 10:31:17 +0400
commitbfa065f10c572cef89c61742071a11a599cec408 (patch)
treec6b8c13f109c7e8464f8a9180593def70cf5b853 /source/blender/editors/transform/transform_generics.c
parent73a68c95a45c03f05ab8634ffcdb3e2fbd508b5c (diff)
Bugfix [#33852] Scale of a strip in NLA is changed after moving it long distance
using numeric input When using numeric input to move strips, the strip extent clamping code could end up prematurely truncating one endpoint. This was because the clamping code uses the values of the other end (e.g. end for start, and start for end) as one of the limits on its allowable range to prevent inverted strips. Now we just set these values twice - the first time, one of the endpoints may still get truncated (while the other one will be able to go to its correct value), then the second time both will get set correctly (and validated too).
Diffstat (limited to 'source/blender/editors/transform/transform_generics.c')
-rw-r--r--source/blender/editors/transform/transform_generics.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index 2591c61c5ab..d56bb5cb7ef 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -550,13 +550,20 @@ static void recalcData_nla(TransInfo *t)
break;
}
- /* use RNA to write the values... */
- // TODO: do we need to write in 2 passes to make sure that no truncation goes on?
+ /* Use RNA to write the values to ensure that constraints on these are obeyed
+ * (e.g. for transition strips, the values are taken from the neighbours)
+ *
+ * NOTE: we write these twice to avoid truncation errors which can arise when
+ * moving the strips a large distance using numeric input [#33852]
+ */
RNA_pointer_create(NULL, &RNA_NlaStrip, strip, &strip_ptr);
RNA_float_set(&strip_ptr, "frame_start", tdn->h1[0]);
RNA_float_set(&strip_ptr, "frame_end", tdn->h2[0]);
+ RNA_float_set(&strip_ptr, "frame_start", tdn->h1[0]);
+ RNA_float_set(&strip_ptr, "frame_end", tdn->h2[0]);
+
/* flush transforms to child strips (since this should be a meta) */
BKE_nlameta_flush_transforms(strip);