[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [53943] trunk/blender/source/blender: Bugfix [#33852] Scale of a strip in NLA is changed after moving it long distance

Joshua Leung aligorith at gmail.com
Mon Jan 21 07:31:24 CET 2013


Revision: 53943
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=53943
Author:   aligorith
Date:     2013-01-21 06:31:17 +0000 (Mon, 21 Jan 2013)
Log Message:
-----------
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).

Modified Paths:
--------------
    trunk/blender/source/blender/editors/transform/transform_generics.c
    trunk/blender/source/blender/makesrna/intern/rna_nla.c

Modified: trunk/blender/source/blender/editors/transform/transform_generics.c
===================================================================
--- trunk/blender/source/blender/editors/transform/transform_generics.c	2013-01-21 05:42:19 UTC (rev 53942)
+++ trunk/blender/source/blender/editors/transform/transform_generics.c	2013-01-21 06:31:17 UTC (rev 53943)
@@ -550,13 +550,20 @@
 				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);
 		

Modified: trunk/blender/source/blender/makesrna/intern/rna_nla.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_nla.c	2013-01-21 05:42:19 UTC (rev 53942)
+++ trunk/blender/source/blender/makesrna/intern/rna_nla.c	2013-01-21 06:31:17 UTC (rev 53943)
@@ -115,7 +115,7 @@
 		if (data->prev->type == NLASTRIP_TYPE_TRANSITION) {
 			CLAMP(value, data->prev->start + NLASTRIP_MIN_LEN_THRESH, data->end - NLASTRIP_MIN_LEN_THRESH);
 			
-			/* readjust the transition to stick to the endpoints of the action-clips */
+			/* re-adjust the transition to stick to the endpoints of the action-clips */
 			data->prev->end = value;
 		}
 		else {




More information about the Bf-blender-cvs mailing list