[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [24085] trunk/blender/source/blender: Animation Bugfixes - Noise Modifier + Graph Editor:

Joshua Leung aligorith at gmail.com
Mon Oct 26 12:10:04 CET 2009


Revision: 24085
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=24085
Author:   aligorith
Date:     2009-10-26 12:10:04 +0100 (Mon, 26 Oct 2009)

Log Message:
-----------
Animation Bugfixes - Noise Modifier + Graph Editor:

* #19727: Noise modifier does nothing with size 1.0
When the 'Size' and 'Phase' parameters were both 1.0 exactly, and evaltime was an integer (as is the case when doing animation evaluation but not for Graph Editor drawing), the noise calculation function was bailing out. Now, the 'z' component supplied to this function is a decimal value (hardcoded to 0.1 after experimentation) to try and avoid this situation.

* Graph Editor 'Bake' operator was using wrong poll callback, making it useless when trying to use it on a F-Curve that only has modifiers on it (i.e. the main use case of the operator!) 

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/fmodifier.c
    trunk/blender/source/blender/editors/space_graph/graph_edit.c

Modified: trunk/blender/source/blender/blenkernel/intern/fmodifier.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/fmodifier.c	2009-10-26 11:03:12 UTC (rev 24084)
+++ trunk/blender/source/blender/blenkernel/intern/fmodifier.c	2009-10-26 11:10:04 UTC (rev 24085)
@@ -715,8 +715,13 @@
 	FMod_Noise *data= (FMod_Noise *)fcm->data;
 	float noise;
 	
-	noise = BLI_turbulence(data->size, evaltime, data->phase, 0.f, data->depth);
+	/* generate noise using good ol' Blender Noise
+	 *	- 0.1 is passed as the 'z' value, otherwise evaluation fails for size = phase = 1
+	 *	  with evaltime being an integer (which happens when evaluating on frame by frame basis)
+	 */
+	noise = BLI_turbulence(data->size, evaltime, data->phase, 0.1f, data->depth);
 	
+	/* combine the noise with existing motion data */
 	switch (data->modification) {
 		case FCM_NOISE_MODIF_ADD:
 			*cvalue= *cvalue + noise * data->strength;

Modified: trunk/blender/source/blender/editors/space_graph/graph_edit.c
===================================================================
--- trunk/blender/source/blender/editors/space_graph/graph_edit.c	2009-10-26 11:03:12 UTC (rev 24084)
+++ trunk/blender/source/blender/editors/space_graph/graph_edit.c	2009-10-26 11:10:04 UTC (rev 24085)
@@ -976,7 +976,7 @@
 	/* api callbacks */
 	ot->invoke= WM_operator_confirm; // FIXME...
 	ot->exec= graphkeys_bake_exec;
-	ot->poll= graphop_editable_keyframes_poll;
+	ot->poll= graphop_selected_fcurve_poll; 
 	
 	/* flags */
 	ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;





More information about the Bf-blender-cvs mailing list