@@ -398,6 +398,7 @@ impl Model {
398398 & control_macro_in_fixture. label, control_macro_in_scene
399399 ) ;
400400 if let Some ( ms) = animation_ms {
401+ debug ! ( "Scene includes animation; animate Control Value over {}ms" , ms) ;
401402 control_macro_in_fixture. animation =
402403 Some ( Animation :: new (
403404 Duration :: from_millis ( ms) ,
@@ -410,7 +411,7 @@ impl Model {
410411 Box :: new ( SineInOut ) ,
411412 ) )
412413 } else {
413- debug ! ( "No Animation specified; change immediate " ) ;
414+ debug ! ( "No Animation specified; change Control Value immediately " ) ;
414415 control_macro_in_fixture. current_value =
415416 * control_macro_in_scene;
416417 }
@@ -439,8 +440,27 @@ impl Model {
439440 & fixture. label,
440441 & colour_macro_in_fixture. label, colour_macro_in_scene
441442 ) ;
442- colour_macro_in_fixture. current_value =
443- * colour_macro_in_scene;
443+ if let Some ( ms) = animation_ms {
444+ debug ! ( "Scene includes animation; animate Colour over {}ms" , ms) ;
445+ let animation = Animation :: new (
446+ Duration :: from_millis ( ms) ,
447+ 0.0 ,
448+ 1.0 ,
449+ Box :: new ( SineInOut ) ,
450+ ) ;
451+ let start_colour =
452+ colour_macro_in_fixture. current_value ;
453+ let end_colour = * colour_macro_in_scene;
454+ colour_macro_in_fixture. animation = Some ( (
455+ animation,
456+ start_colour,
457+ end_colour,
458+ ) ) ;
459+ } else {
460+ debug ! ( "No Animation specified; change Colour immediately" ) ;
461+ colour_macro_in_fixture. current_value =
462+ * colour_macro_in_scene;
463+ }
444464 }
445465 }
446466 }
0 commit comments