Skip to content

Commit

Permalink
Handle hi-res value animations between scenes
Browse files Browse the repository at this point in the history
  • Loading branch information
anselanza committed Feb 3, 2025
1 parent e206fe2 commit 041d9ae
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tether-artnet-controller"
version = "0.8.0"
version = "0.8.1"
edition = "2021"
repository = "/~https://github.com/RandomStudio/tether-artnet-controller"
homepage = "/~https://github.com/RandomStudio/tether-artnet-controller"
Expand Down
54 changes: 27 additions & 27 deletions example.project.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@
]
},
"pan": {
"ControlValue": 67
"ControlValue": 17028
},
"tilt": {
"ControlValue": 92
"ControlValue": 24253
},
"zoom": {
"ControlValue": 255
"ControlValue": 61406
}
},
"Hero Right": {
Expand All @@ -157,13 +157,13 @@
]
},
"pan": {
"ControlValue": 15
"ControlValue": 46958
},
"tilt": {
"ControlValue": 73
"ControlValue": 23221
},
"zoom": {
"ControlValue": 255
"ControlValue": 46958
}
},
"Hex Left": {
Expand All @@ -179,18 +179,18 @@
]
},
"Pan": {
"ControlValue": 0
"ControlValue": 13932
},
"Tilt": {
"ControlValue": 0
"ControlValue": 25801
},
"Zoom": {
"ControlValue": 0
"ControlValue": 65535
}
},
"Hex Right": {
"Brightness": {
"ControlValue": 41000
"ControlValue": 65535
},
"Colour": {
"ColourValue": [
Expand All @@ -201,13 +201,13 @@
]
},
"Pan": {
"ControlValue": 0
"ControlValue": 29413
},
"Tilt": {
"ControlValue": 0
"ControlValue": 26317
},
"Zoom": {
"ControlValue": 0
"ControlValue": 41797
}
}
}
Expand All @@ -228,13 +228,13 @@
]
},
"pan": {
"ControlValue": 56500
"ControlValue": 0
},
"tilt": {
"ControlValue": 36000
"ControlValue": 32509
},
"zoom": {
"ControlValue": 54000
"ControlValue": 45410
}
},
"Hero Right": {
Expand All @@ -250,18 +250,18 @@
]
},
"pan": {
"ControlValue": 57500
"ControlValue": 0
},
"tilt": {
"ControlValue": 35500
"ControlValue": 30445
},
"zoom": {
"ControlValue": 41000
"ControlValue": 39217
}
},
"Hex Left": {
"Brightness": {
"ControlValue": 35000
"ControlValue": 65535
},
"Colour": {
"ColourValue": [
Expand All @@ -275,15 +275,15 @@
"ControlValue": 0
},
"Tilt": {
"ControlValue": 34500
"ControlValue": 34057
},
"Zoom": {
"ControlValue": 0
"ControlValue": 38701
}
},
"Hex Right": {
"Brightness": {
"ControlValue": 41000
"ControlValue": 65535
},
"Colour": {
"ColourValue": [
Expand All @@ -297,10 +297,10 @@
"ControlValue": 0
},
"Tilt": {
"ControlValue": 37000
"ControlValue": 31993
},
"Zoom": {
"ControlValue": 0
"ControlValue": 31477
}
}
}
Expand All @@ -312,8 +312,8 @@
},
"artnetConfig": {
"Unicast": [
"127.0.0.1",
"127.0.0.1"
"10.0.0.105",
"10.0.0.99"
]
}
}
6 changes: 3 additions & 3 deletions src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ impl Model {
let duration = Duration::from_millis(ms);
let start_value =
control_macro.current_value as f32 / u16::MAX as f32;
let end_value = target_value as f32 / u16::MAX as f32;
let end_value = target_value / u16::MAX as f32;

control_macro.animation = Some(Animation::new(
duration,
Expand Down Expand Up @@ -500,9 +500,9 @@ impl Model {
control_macro_in_fixture
.current_value
as f32
/ 255.0,
/ u16::MAX as f32,
*control_macro_in_scene as f32
/ 255.0,
/ u16::MAX as f32,
Box::new(SineInOut),
))
} else {
Expand Down

0 comments on commit 041d9ae

Please sign in to comment.