(
ctx: &mut ScriptContext<'_, API>,
name: &str,
tint: &str,
)
| 3860 | return values; |
| 3861 | } |
| 3862 | if let Some(values) = scene_value_override_components(data, "rotation") |
| 3863 | && values.len() == 4 |
| 3864 | { |
| 3865 | let parsed = values |
| 3866 | .iter() |
| 3867 | .filter_map(|value| value.parse::<f32>().ok()) |
| 3868 | .collect::<Vec<_>>(); |
| 3869 | if let [x, y, z, w] = parsed.as_slice() { |
| 3870 | return quat_to_euler_deg_components(*x, *y, *z, *w); |
| 3871 | } |
| 3872 | } |
| 3873 | vec!["0".to_string(), "0".to_string(), "0".to_string()] |
| 3874 | } |
| 3875 | |
| 3876 | pub fn quat_to_euler_deg_components(x: f32, y: f32, z: f32, w: f32) -> Vec<String> { |
| 3877 | let len = (x * x + y * y + z * z + w * w).sqrt(); |
| 3878 | if len <= 0.0 { |
no test coverage detected