From 59e0793758f54f47a5609590bf8c31dad040810f Mon Sep 17 00:00:00 2001 From: aecsocket Date: Thu, 23 Jan 2025 15:43:31 +0000 Subject: [PATCH 1/3] Move type into inner for animation nodes --- .../custom_node_example.animgraph.ron | 28 +-- .../animation_graphs/human_ik.animgraph.ron | 22 +- .../animation_graphs/human_new.animgraph.ron | 198 ++++++++++-------- assets/animation_graphs/run.animgraph.ron | 66 +++--- .../animation_graphs/toplevel.animgraph.ron | 11 +- .../velocity_to_params.animgraph.ron | 101 +++++---- assets/animation_graphs/walk.animgraph.ron | 66 +++--- .../walk_to_run.animgraph.ron | 33 +-- .../src/core/animation_graph/serial.rs | 72 ++----- 9 files changed, 309 insertions(+), 288 deletions(-) diff --git a/assets/animation_graphs/custom_node_example.animgraph.ron b/assets/animation_graphs/custom_node_example.animgraph.ron index f9c9d90..c907658 100644 --- a/assets/animation_graphs/custom_node_example.animgraph.ron +++ b/assets/animation_graphs/custom_node_example.animgraph.ron @@ -1,18 +1,20 @@ ( - nodes: [ - ( - name: "Custom node", - ty: "editor_as_a_plugin::MyCustomNode", - inner: (), - ), - ( - name: "Human animation", - ty: "bevy_animation_graph::nodes::graph_node::GraphNode", - inner: ( +nodes: [ + ( + name: "Custom node", + inner: { + "editor_as_a_plugin::MyCustomNode": (), + }, + ), + ( + name: "Human animation", + inner: { + "bevy_animation_graph::nodes::graph_node::GraphNode": ( graph: "animation_graphs/human_new.animgraph.ron", ), - ), - ], + }, + ), +], edges_inverted: { NodeTime("Custom node", "time"): NodeTime("Human animation"), OutputTime: NodeTime("Custom node"), @@ -39,4 +41,4 @@ }, output_pose_order: {}, ), -) \ No newline at end of file +) diff --git a/assets/animation_graphs/human_ik.animgraph.ron b/assets/animation_graphs/human_ik.animgraph.ron index 48650b7..6ac9f72 100644 --- a/assets/animation_graphs/human_ik.animgraph.ron +++ b/assets/animation_graphs/human_ik.animgraph.ron @@ -1,17 +1,19 @@ ( nodes: [ - ( - name: "base anim", - ty: "bevy_animation_graph::nodes::graph_node::GraphNode", - inner: ( + ( + name: "base anim", + inner: { + "bevy_animation_graph::nodes::graph_node::GraphNode": ( graph: "animation_graphs/human_new.animgraph.ron", ) - ), - ( - name: "arm ik", - ty: "bevy_animation_graph::nodes::twoboneik_node::TwoBoneIKNode", - inner: (), - ), + } + ), + ( + name: "arm ik", + inner: { + "bevy_animation_graph::nodes::twoboneik_node::TwoBoneIKNode": () + } + ), ], edges_inverted: { NodeData("arm ik", "Target Path"): InputData("right hand path"), diff --git a/assets/animation_graphs/human_new.animgraph.ron b/assets/animation_graphs/human_new.animgraph.ron index 9dec971..94bf4f7 100644 --- a/assets/animation_graphs/human_new.animgraph.ron +++ b/assets/animation_graphs/human_new.animgraph.ron @@ -1,32 +1,35 @@ ( nodes: [ - ( - name: "speed", - ty: "bevy_animation_graph::nodes::speed_node::SpeedNode", - inner: (), - ), - ( - name: "walk clip 1", - ty: "bevy_animation_graph::nodes::clip_node::ClipNode", - inner: ( + ( + name: "speed", + inner: { + "bevy_animation_graph::nodes::speed_node::SpeedNode": (), + }, + ), + ( + name: "walk clip 1", + inner: { + "bevy_animation_graph::nodes::clip_node::ClipNode": ( clip: "animations/human_walk.anim.ron", ), - ), - ( - name: "Rotate", - ty: "bevy_animation_graph::nodes::rotation_node::RotationNode", - inner: ( + }, + ), + ( + name: "Rotate", + inner: { + "bevy_animation_graph::nodes::rotation_node::RotationNode": ( application_mode: Compose, rotation_space: Character, chain_decay: Linear, chain_length: 1, base_weight: 1.0, ), - ), - ( - name: "flip walk", - ty: "bevy_animation_graph::nodes::flip_lr_node::FlipLRNode", - inner: ( + }, + ), + ( + name: "flip walk", + inner: { + "bevy_animation_graph::nodes::flip_lr_node::FlipLRNode": ( config: ( name_mapper: Pattern(( key_1: "L", @@ -36,18 +39,20 @@ )), ), ), - ), - ( - name: "wave additive", - ty: "bevy_animation_graph::nodes::blend_node::BlendNode", - inner: ( + }, + ), + ( + name: "wave additive", + inner: { + "bevy_animation_graph::nodes::blend_node::BlendNode": ( mode: Additive, ), - ), - ( - name: "flip run", - ty: "bevy_animation_graph::nodes::flip_lr_node::FlipLRNode", - inner: ( + }, + ), + ( + name: "flip run", + inner: { + "bevy_animation_graph::nodes::flip_lr_node::FlipLRNode": ( config: ( name_mapper: Pattern(( key_1: "L", @@ -57,89 +62,102 @@ )), ), ), - ), - ( - name: "run clip 2", - ty: "bevy_animation_graph::nodes::clip_node::ClipNode", - inner: ( + }, + ), + ( + name: "run clip 2", + inner: { + "bevy_animation_graph::nodes::clip_node::ClipNode": ( clip: "animations/human_run.anim.ron", ), - ), - ( - name: "blend", - ty: "bevy_animation_graph::nodes::blend_node::BlendNode", - inner: ( + }, + ), + ( + name: "blend", + inner: { + "bevy_animation_graph::nodes::blend_node::BlendNode": ( mode: LinearInterpolate, ), - ), - ( - name: "loop", - ty: "bevy_animation_graph::nodes::loop_node::LoopNode", - inner: ( + }, + ), + ( + name: "loop", + inner: { + "bevy_animation_graph::nodes::loop_node::LoopNode": ( interpolation_period: 0.5, ), - ), - ( - name: "stand", - ty: "bevy_animation_graph::nodes::clip_node::ClipNode", - inner: ( + }, + ), + ( + name: "stand", + inner: { + "bevy_animation_graph::nodes::clip_node::ClipNode": ( clip: "animations/human_stand.anim.ron", ), - ), - ( - name: "chain walk", - ty: "bevy_animation_graph::nodes::chain_node::ChainNode", - inner: ( + }, + ), + ( + name: "chain walk", + inner: { + "bevy_animation_graph::nodes::chain_node::ChainNode": ( interpolation_period: 0.5, ), - ), - ( - name: "Parameters", - ty: "bevy_animation_graph::nodes::graph_node::GraphNode", - inner: ( + }, + ), + ( + name: "Parameters", + inner: { + "bevy_animation_graph::nodes::graph_node::GraphNode": ( graph: "animation_graphs/velocity_to_params.animgraph.ron", ), - ), - ( - name: "chain run", - ty: "bevy_animation_graph::nodes::chain_node::ChainNode", - inner: ( + }, + ), + ( + name: "chain run", + inner: { + "bevy_animation_graph::nodes::chain_node::ChainNode": ( interpolation_period: 0.5, ), - ), - ( - name: "run clip 1", - ty: "bevy_animation_graph::nodes::clip_node::ClipNode", - inner: ( + }, + ), + ( + name: "run clip 1", + inner: { + "bevy_animation_graph::nodes::clip_node::ClipNode": ( clip: "animations/human_run.anim.ron", ), - ), - ( - name: "wave diff", - ty: "bevy_animation_graph::nodes::blend_node::BlendNode", - inner: ( + }, + ), + ( + name: "wave diff", + inner: { + "bevy_animation_graph::nodes::blend_node::BlendNode": ( mode: Difference, ), - ), - ( - name: "wave", - ty: "bevy_animation_graph::nodes::clip_node::ClipNode", - inner: ( + }, + ), + ( + name: "wave", + inner: { + "bevy_animation_graph::nodes::clip_node::ClipNode": ( clip: "animations/human_wave.anim.ron", ), - ), - ( - name: "walk clip 2", - ty: "bevy_animation_graph::nodes::clip_node::ClipNode", - inner: ( + }, + ), + ( + name: "walk clip 2", + inner: { + "bevy_animation_graph::nodes::clip_node::ClipNode": ( clip: "animations/human_walk.anim.ron", ), - ), - ( - name: "Make Rotation", - ty: "bevy_animation_graph::nodes::arithmetic::vec3::rotation_arc::RotationArcNode", - inner: (), - ), + }, + ), + ( + name: "Make Rotation", + inner: { + "bevy_animation_graph::nodes::arithmetic::vec3::rotation_arc::RotationArcNode": (), + }, + ), ], edges_inverted: { NodeData("Rotate", "Bone Mask"): InputData("rotation_bone"), diff --git a/assets/animation_graphs/run.animgraph.ron b/assets/animation_graphs/run.animgraph.ron index d969ab1..6ef82e9 100644 --- a/assets/animation_graphs/run.animgraph.ron +++ b/assets/animation_graphs/run.animgraph.ron @@ -1,9 +1,9 @@ ( nodes: [ - ( - name: "flip run", - ty: "bevy_animation_graph::nodes::flip_lr_node::FlipLRNode", - inner: ( + ( + name: "flip run", + inner: { + "bevy_animation_graph::nodes::flip_lr_node::FlipLRNode": ( config: ( name_mapper: Pattern(( key_1: "L", @@ -13,40 +13,46 @@ )), ), ), - ), - ( - name: "chain run", - ty: "bevy_animation_graph::nodes::chain_node::ChainNode", - inner: ( + }, + ), + ( + name: "chain run", + inner: { + "bevy_animation_graph::nodes::chain_node::ChainNode": ( interpolation_period: 0.5, ), - ), - ( - name: "speed", - ty: "bevy_animation_graph::nodes::speed_node::SpeedNode", - inner: (), - ), - ( - name: "run clip 1", - ty: "bevy_animation_graph::nodes::clip_node::ClipNode", - inner: ( + }, + ), + ( + name: "speed", + inner: { + "bevy_animation_graph::nodes::speed_node::SpeedNode": (), + }, + ), + ( + name: "run clip 1", + inner: { + "bevy_animation_graph::nodes::clip_node::ClipNode": ( clip: "animations/human_run.anim.ron", ), - ), - ( - name: "loop", - ty: "bevy_animation_graph::nodes::loop_node::LoopNode", - inner: ( + }, + ), + ( + name: "loop", + inner: { + "bevy_animation_graph::nodes::loop_node::LoopNode": ( interpolation_period: 0.5, ), - ), - ( - name: "run clip 2", - ty: "bevy_animation_graph::nodes::clip_node::ClipNode", - inner: ( + }, + ), + ( + name: "run clip 2", + inner: { + "bevy_animation_graph::nodes::clip_node::ClipNode": ( clip: "animations/human_run.anim.ron", ), - ), + }, + ), ], edges_inverted: { NodeData("speed", "pose"): NodeData("loop", "pose"), diff --git a/assets/animation_graphs/toplevel.animgraph.ron b/assets/animation_graphs/toplevel.animgraph.ron index 7ed73fc..6789291 100644 --- a/assets/animation_graphs/toplevel.animgraph.ron +++ b/assets/animation_graphs/toplevel.animgraph.ron @@ -1,12 +1,13 @@ ( nodes: [ - ( - name: "Locomotion FSM", - ty: "bevy_animation_graph::nodes::fsm_node::FSMNode", - inner: ( + ( + name: "Locomotion FSM", + inner: { + "bevy_animation_graph::nodes::fsm_node::FSMNode": ( fsm: "fsm/locomotion.fsm.ron", ), - ), + }, + ), ], edges_inverted: { OutputData("pose"): NodeData("Locomotion FSM", "pose"), diff --git a/assets/animation_graphs/velocity_to_params.animgraph.ron b/assets/animation_graphs/velocity_to_params.animgraph.ron index ee88036..902efc2 100644 --- a/assets/animation_graphs/velocity_to_params.animgraph.ron +++ b/assets/animation_graphs/velocity_to_params.animgraph.ron @@ -1,50 +1,59 @@ ( nodes: [ - ( - name: "speed_fac div", - ty: "bevy_animation_graph::nodes::arithmetic::f32::div_f32::DivF32", - inner: (), - ), - ( - name: "Blend fac div", - ty: "bevy_animation_graph::nodes::arithmetic::f32::div_f32::DivF32", - inner: (), - ), - ( - name: "Base speed", - ty: "bevy_animation_graph::nodes::arithmetic::f32::add_f32::AddF32", - inner: (), - ), - ( - name: "1 - blend_fac", - ty: "bevy_animation_graph::nodes::arithmetic::f32::sub_f32::SubF32", - inner: (), - ), - ( - name: "Amount into blend", - ty: "bevy_animation_graph::nodes::arithmetic::f32::sub_f32::SubF32", - inner: (), - ), - ( - name: "Clamp blend_fac", - ty: "bevy_animation_graph::nodes::arithmetic::f32::clamp_f32::ClampF32", - inner: (), - ), - ( - name: "Factored walk_speed", - ty: "bevy_animation_graph::nodes::arithmetic::f32::mul_f32::MulF32", - inner: (), - ), - ( - name: "Factored run_speed", - ty: "bevy_animation_graph::nodes::arithmetic::f32::mul_f32::MulF32", - inner: (), - ), - ( - name: "Blend range size", - ty: "bevy_animation_graph::nodes::arithmetic::f32::sub_f32::SubF32", - inner: (), - ), + ( + name: "speed_fac div", + inner: { + "bevy_animation_graph::nodes::arithmetic::f32::div_f32::DivF32": (), + }, + ), + ( + name: "Blend fac div", + inner: { + "bevy_animation_graph::nodes::arithmetic::f32::div_f32::DivF32": (), + }, + ), + ( + name: "Base speed", + inner: { + "bevy_animation_graph::nodes::arithmetic::f32::add_f32::AddF32": (), + }, + ), + ( + name: "1 - blend_fac", + inner: { + "bevy_animation_graph::nodes::arithmetic::f32::sub_f32::SubF32": (), + }, + ), + ( + name: "Amount into blend", + inner: { + "bevy_animation_graph::nodes::arithmetic::f32::sub_f32::SubF32": (), + }, + ), + ( + name: "Clamp blend_fac", + inner: { + "bevy_animation_graph::nodes::arithmetic::f32::clamp_f32::ClampF32": (), + }, + ), + ( + name: "Factored walk_speed", + inner: { + "bevy_animation_graph::nodes::arithmetic::f32::mul_f32::MulF32": (), + }, + ), + ( + name: "Factored run_speed", + inner: { + "bevy_animation_graph::nodes::arithmetic::f32::mul_f32::MulF32": (), + }, + ), + ( + name: "Blend range size", + inner: { + "bevy_animation_graph::nodes::arithmetic::f32::sub_f32::SubF32": (), + }, + ), ], edges_inverted: { NodeData("Amount into blend", "F32 In 1"): InputData("speed"), @@ -99,4 +108,4 @@ input_position: (-194.76935, -21.23082), output_position: (967.38446, 101.53839), ), -) \ No newline at end of file +) diff --git a/assets/animation_graphs/walk.animgraph.ron b/assets/animation_graphs/walk.animgraph.ron index 9316f9f..11043ca 100644 --- a/assets/animation_graphs/walk.animgraph.ron +++ b/assets/animation_graphs/walk.animgraph.ron @@ -1,16 +1,17 @@ ( nodes: [ - ( - name: "chain walk", - ty: "bevy_animation_graph::nodes::chain_node::ChainNode", - inner: ( + ( + name: "chain walk", + inner: { + "bevy_animation_graph::nodes::chain_node::ChainNode": ( interpolation_period: 0.5, ), - ), - ( - name: "flip walk", - ty: "bevy_animation_graph::nodes::flip_lr_node::FlipLRNode", - inner: ( + }, + ), + ( + name: "flip walk", + inner: { + "bevy_animation_graph::nodes::flip_lr_node::FlipLRNode": ( config: ( name_mapper: Pattern(( key_1: "L", @@ -20,33 +21,38 @@ )), ), ), - ), - ( - name: "walk clip 1", - ty: "bevy_animation_graph::nodes::clip_node::ClipNode", - inner: ( + }, + ), + ( + name: "walk clip 1", + inner: { + "bevy_animation_graph::nodes::clip_node::ClipNode": ( clip: "animations/human_walk.anim.ron", ), - ), - ( - name: "walk clip 2", - ty: "bevy_animation_graph::nodes::clip_node::ClipNode", - inner: ( + }, + ), + ( + name: "walk clip 2", + inner: { + "bevy_animation_graph::nodes::clip_node::ClipNode": ( clip: "animations/human_walk.anim.ron", ), - ), - ( - name: "speed", - ty: "bevy_animation_graph::nodes::speed_node::SpeedNode", - inner: (), - ), - ( - name: "loop", - ty: "bevy_animation_graph::nodes::loop_node::LoopNode", - inner: ( + }, + ), + ( + name: "speed", + inner: { + "bevy_animation_graph::nodes::speed_node::SpeedNode": (), + }, + ), + ( + name: "loop", + inner: { + "bevy_animation_graph::nodes::loop_node::LoopNode": ( interpolation_period: 0.5, ), - ), + }, + ), ], edges_inverted: { NodeData("loop", "pose"): NodeData("chain walk", "pose"), diff --git a/assets/animation_graphs/walk_to_run.animgraph.ron b/assets/animation_graphs/walk_to_run.animgraph.ron index 0f94cb7..9e523ae 100644 --- a/assets/animation_graphs/walk_to_run.animgraph.ron +++ b/assets/animation_graphs/walk_to_run.animgraph.ron @@ -1,24 +1,27 @@ ( nodes: [ - ( - name: "Done", - ty: "bevy_animation_graph::nodes::arithmetic::event_queue::fire_event::FireEventNode", - inner: ( + ( + name: "Done", + inner: { + "bevy_animation_graph::nodes::arithmetic::event_queue::fire_event::FireEventNode": ( event: EndTransition, ), - ), - ( - name: "Blend", - ty: "bevy_animation_graph::nodes::blend_node::BlendNode", - inner: (), - ), - ( - name: "Is it done?", - ty: "bevy_animation_graph::nodes::arithmetic::f32::compare_f32::CompareF32", - inner: ( + }, + ), + ( + name: "Blend", + inner: { + "bevy_animation_graph::nodes::blend_node::BlendNode": (), + }, + ), + ( + name: "Is it done?", + inner: { + "bevy_animation_graph::nodes::arithmetic::f32::compare_f32::CompareF32": ( op: MoreEqual, ), - ), + }, + ), ], edges_inverted: { NodeData("Is it done?", "F32 In 2"): InputData("1"), diff --git a/crates/bevy_animation_graph/src/core/animation_graph/serial.rs b/crates/bevy_animation_graph/src/core/animation_graph/serial.rs index e19ab7e..56f28c0 100644 --- a/crates/bevy_animation_graph/src/core/animation_graph/serial.rs +++ b/crates/bevy_animation_graph/src/core/animation_graph/serial.rs @@ -7,7 +7,7 @@ use bevy::{ prelude::*, reflect::{ serde::{ - ReflectDeserializerProcessor, ReflectSerializerProcessor, TypedReflectDeserializer, + ReflectDeserializer, ReflectDeserializerProcessor, ReflectSerializerProcessor, TypedReflectSerializer, }, ReflectFromReflect, TypeRegistration, TypeRegistry, @@ -143,13 +143,12 @@ impl<'de> DeserializeSeed<'de> for AnimationNodeLoadDeserializer<'_, '_> { where D: serde::Deserializer<'de>, { - struct NodeInnerDeserializer<'a, 'b, 'c> { + struct NodeInnerDeserializer<'a, 'b> { type_registry: &'a TypeRegistry, load_context: &'a mut LoadContext<'b>, - ty: &'c str, } - impl<'de> DeserializeSeed<'de> for NodeInnerDeserializer<'_, '_, '_> { + impl<'de> DeserializeSeed<'de> for NodeInnerDeserializer<'_, '_> { type Value = Box; fn deserialize(self, deserializer: D) -> Result @@ -159,15 +158,20 @@ impl<'de> DeserializeSeed<'de> for AnimationNodeLoadDeserializer<'_, '_> { let Self { type_registry, load_context, - ty, } = self; - let type_registration = - type_registry - .get_with_type_path(self.ty) - .ok_or(de::Error::custom(format!( - "no type registration for `{ty}`" - )))?; + let mut processor = HandleDeserializeProcessor { load_context }; + let reflect_deserializer = + ReflectDeserializer::with_processor(type_registry, &mut processor); + let inner = reflect_deserializer.deserialize(deserializer)?; + + let type_info = inner + .get_represented_type_info() + .ok_or_else(|| de::Error::custom("value is not a concrete type"))?; + let ty = type_info.type_path(); + let type_registration = type_registry + .get(type_info.type_id()) + .ok_or_else(|| de::Error::custom(format!("`{ty}` is not registered")))?; let node_like = type_registration .data::() .ok_or(de::Error::custom(format!("`{ty}` is not a `NodeLike`")))?; @@ -177,21 +181,12 @@ impl<'de> DeserializeSeed<'de> for AnimationNodeLoadDeserializer<'_, '_> { .ok_or(de::Error::custom(format!( "`{ty}` cannot be created from reflection" )))?; - - let mut processor = HandleDeserializeProcessor { load_context }; - let reflect_deserializer = TypedReflectDeserializer::with_processor( - type_registration, - type_registry, - &mut processor, - ); - let inner = reflect_deserializer.deserialize(deserializer)?; - let inner = from_reflect.from_reflect(inner.as_partial_reflect()).unwrap_or_else(|| { - panic!( - "from reflect mismatch - reflecting from a `{}` into a `{ty}` - value: {inner:?}", - inner.reflect_type_path() - ) - }); + panic!( + "from reflect mismatch - reflecting from a `{}` into a `{ty}` - value: {inner:?}", + inner.reflect_type_path() + ) + }); let inner = node_like.get_boxed(inner).unwrap_or_else(|value| { panic!("value of type `{ty}` should be a `NodeLike` - value: {value:?}") }); @@ -201,12 +196,10 @@ impl<'de> DeserializeSeed<'de> for AnimationNodeLoadDeserializer<'_, '_> { } const NAME: &str = "name"; - const TY: &str = "ty"; const INNER: &str = "inner"; enum Field { Name, - Ty, Inner, _Ignore, } @@ -226,8 +219,7 @@ impl<'de> DeserializeSeed<'de> for AnimationNodeLoadDeserializer<'_, '_> { { match v { 0 => Ok(Field::Name), - 1 => Ok(Field::Ty), - 2 => Ok(Field::Inner), + 1 => Ok(Field::Inner), _ => Ok(Field::_Ignore), } } @@ -238,7 +230,6 @@ impl<'de> DeserializeSeed<'de> for AnimationNodeLoadDeserializer<'_, '_> { { match v { NAME => Ok(Field::Name), - TY => Ok(Field::Ty), INNER => Ok(Field::Inner), _ => Ok(Field::_Ignore), } @@ -275,16 +266,12 @@ impl<'de> DeserializeSeed<'de> for AnimationNodeLoadDeserializer<'_, '_> { let name = seq .next_element::()? .ok_or(de::Error::invalid_length(0, &INVALID_LENGTH))?; - let ty = seq - .next_element::<&str>()? - .ok_or(de::Error::invalid_length(1, &INVALID_LENGTH))?; let inner = seq .next_element_seed(NodeInnerDeserializer { type_registry: self.type_registry, load_context: self.load_context, - ty, })? - .ok_or(de::Error::invalid_length(2, &INVALID_LENGTH))?; + .ok_or(de::Error::invalid_length(1, &INVALID_LENGTH))?; Ok(AnimationNode { name, @@ -297,10 +284,7 @@ impl<'de> DeserializeSeed<'de> for AnimationNodeLoadDeserializer<'_, '_> { where A: de::MapAccess<'de>, { - // unfortunately, this code is field-order-dependent - // `ty` MUST be defined before `inner` let mut name = None::; - let mut ty = None::<&str>; let mut inner = None::>; while let Some(key) = map.next_key::()? { match key { @@ -310,23 +294,13 @@ impl<'de> DeserializeSeed<'de> for AnimationNodeLoadDeserializer<'_, '_> { } name = Some(map.next_value::()?); } - Field::Ty => { - if ty.is_some() { - return Err(de::Error::duplicate_field(TY)); - } - ty = Some(map.next_value::<&str>()?); - } Field::Inner => { if inner.is_some() { return Err(de::Error::duplicate_field(INNER)); } - inner = Some(map.next_value_seed(NodeInnerDeserializer { type_registry: self.type_registry, load_context: self.load_context, - ty: ty.ok_or(de::Error::custom( - "`ty` must be defined before `inner`", - ))?, })?); } _ => { @@ -347,7 +321,7 @@ impl<'de> DeserializeSeed<'de> for AnimationNodeLoadDeserializer<'_, '_> { type_registry: self.type_registry, load_context: self.load_context, }; - deserializer.deserialize_struct("AnimationNode", &[NAME, TY, INNER], visitor) + deserializer.deserialize_struct("AnimationNode", &[NAME, INNER], visitor) } } From 1d32f89b1223c882757044ba206f669408a85184 Mon Sep 17 00:00:00 2001 From: aecsocket Date: Sun, 2 Feb 2025 10:38:51 +0000 Subject: [PATCH 2/3] correct some issues --- .../custom_node_example.animgraph.ron | 32 +- .../animation_graphs/human_ik.animgraph.ron | 28 +- .../animation_graphs/human_new.animgraph.ron | 316 +++++++++--------- assets/animation_graphs/run.animgraph.ron | 104 +++--- .../animation_graphs/toplevel.animgraph.ron | 16 +- .../velocity_to_params.animgraph.ron | 108 +++--- assets/animation_graphs/walk.animgraph.ron | 104 +++--- .../walk_to_run.animgraph.ron | 44 +-- .../src/core/animation_node.rs | 12 +- 9 files changed, 377 insertions(+), 387 deletions(-) diff --git a/assets/animation_graphs/custom_node_example.animgraph.ron b/assets/animation_graphs/custom_node_example.animgraph.ron index c907658..faf812b 100644 --- a/assets/animation_graphs/custom_node_example.animgraph.ron +++ b/assets/animation_graphs/custom_node_example.animgraph.ron @@ -1,20 +1,20 @@ ( -nodes: [ - ( - name: "Custom node", - inner: { - "editor_as_a_plugin::MyCustomNode": (), - }, - ), - ( - name: "Human animation", - inner: { - "bevy_animation_graph::nodes::graph_node::GraphNode": ( - graph: "animation_graphs/human_new.animgraph.ron", - ), - }, - ), -], + nodes: [ + ( + name: "Custom node", + inner: { + "editor_as_a_plugin::MyCustomNode": (), + }, + ), + ( + name: "Human animation", + inner: { + "bevy_animation_graph::nodes::graph_node::GraphNode": ( + graph: "animation_graphs/human_new.animgraph.ron", + ), + }, + ), + ], edges_inverted: { NodeTime("Custom node", "time"): NodeTime("Human animation"), OutputTime: NodeTime("Custom node"), diff --git a/assets/animation_graphs/human_ik.animgraph.ron b/assets/animation_graphs/human_ik.animgraph.ron index 6ac9f72..3a767ef 100644 --- a/assets/animation_graphs/human_ik.animgraph.ron +++ b/assets/animation_graphs/human_ik.animgraph.ron @@ -1,19 +1,19 @@ ( nodes: [ - ( - name: "base anim", - inner: { - "bevy_animation_graph::nodes::graph_node::GraphNode": ( - graph: "animation_graphs/human_new.animgraph.ron", - ) - } - ), - ( - name: "arm ik", - inner: { - "bevy_animation_graph::nodes::twoboneik_node::TwoBoneIKNode": () - } - ), + ( + name: "base anim", + inner: { + "bevy_animation_graph::nodes::graph_node::GraphNode": ( + graph: "animation_graphs/human_new.animgraph.ron", + ) + } + ), + ( + name: "arm ik", + inner: { + "bevy_animation_graph::nodes::twoboneik_node::TwoBoneIKNode": () + } + ), ], edges_inverted: { NodeData("arm ik", "Target Path"): InputData("right hand path"), diff --git a/assets/animation_graphs/human_new.animgraph.ron b/assets/animation_graphs/human_new.animgraph.ron index 94bf4f7..fee7058 100644 --- a/assets/animation_graphs/human_new.animgraph.ron +++ b/assets/animation_graphs/human_new.animgraph.ron @@ -1,163 +1,163 @@ ( nodes: [ - ( - name: "speed", - inner: { - "bevy_animation_graph::nodes::speed_node::SpeedNode": (), - }, - ), - ( - name: "walk clip 1", - inner: { - "bevy_animation_graph::nodes::clip_node::ClipNode": ( - clip: "animations/human_walk.anim.ron", - ), - }, - ), - ( - name: "Rotate", - inner: { - "bevy_animation_graph::nodes::rotation_node::RotationNode": ( - application_mode: Compose, - rotation_space: Character, - chain_decay: Linear, - chain_length: 1, - base_weight: 1.0, - ), - }, - ), - ( - name: "flip walk", - inner: { - "bevy_animation_graph::nodes::flip_lr_node::FlipLRNode": ( - config: ( - name_mapper: Pattern(( - key_1: "L", - key_2: "R", - pattern_before: "^.*", - pattern_after: "$", - )), - ), - ), - }, - ), - ( - name: "wave additive", - inner: { - "bevy_animation_graph::nodes::blend_node::BlendNode": ( - mode: Additive, - ), - }, - ), - ( - name: "flip run", - inner: { - "bevy_animation_graph::nodes::flip_lr_node::FlipLRNode": ( - config: ( - name_mapper: Pattern(( - key_1: "L", - key_2: "R", - pattern_before: "^.*", - pattern_after: "$", - )), - ), - ), - }, - ), - ( - name: "run clip 2", - inner: { - "bevy_animation_graph::nodes::clip_node::ClipNode": ( - clip: "animations/human_run.anim.ron", - ), - }, - ), - ( - name: "blend", - inner: { - "bevy_animation_graph::nodes::blend_node::BlendNode": ( - mode: LinearInterpolate, - ), - }, - ), - ( - name: "loop", - inner: { - "bevy_animation_graph::nodes::loop_node::LoopNode": ( - interpolation_period: 0.5, - ), - }, - ), - ( - name: "stand", - inner: { - "bevy_animation_graph::nodes::clip_node::ClipNode": ( - clip: "animations/human_stand.anim.ron", - ), - }, - ), - ( - name: "chain walk", - inner: { - "bevy_animation_graph::nodes::chain_node::ChainNode": ( - interpolation_period: 0.5, - ), - }, - ), - ( - name: "Parameters", - inner: { - "bevy_animation_graph::nodes::graph_node::GraphNode": ( - graph: "animation_graphs/velocity_to_params.animgraph.ron", - ), - }, - ), - ( - name: "chain run", - inner: { - "bevy_animation_graph::nodes::chain_node::ChainNode": ( - interpolation_period: 0.5, - ), - }, - ), - ( - name: "run clip 1", - inner: { - "bevy_animation_graph::nodes::clip_node::ClipNode": ( - clip: "animations/human_run.anim.ron", - ), - }, - ), - ( - name: "wave diff", - inner: { - "bevy_animation_graph::nodes::blend_node::BlendNode": ( - mode: Difference, - ), - }, - ), - ( - name: "wave", - inner: { - "bevy_animation_graph::nodes::clip_node::ClipNode": ( - clip: "animations/human_wave.anim.ron", - ), - }, - ), - ( - name: "walk clip 2", - inner: { - "bevy_animation_graph::nodes::clip_node::ClipNode": ( - clip: "animations/human_walk.anim.ron", - ), - }, - ), - ( - name: "Make Rotation", - inner: { - "bevy_animation_graph::nodes::arithmetic::vec3::rotation_arc::RotationArcNode": (), - }, - ), + ( + name: "speed", + inner: { + "bevy_animation_graph::nodes::speed_node::SpeedNode": (), + }, + ), + ( + name: "walk clip 1", + inner: { + "bevy_animation_graph::nodes::clip_node::ClipNode": ( + clip: "animations/human_walk.anim.ron", + ), + }, + ), + ( + name: "Rotate", + inner: { + "bevy_animation_graph::nodes::rotation_node::RotationNode": ( + application_mode: Compose, + rotation_space: Character, + chain_decay: Linear, + chain_length: 1, + base_weight: 1.0, + ), + }, + ), + ( + name: "flip walk", + inner: { + "bevy_animation_graph::nodes::flip_lr_node::FlipLRNode": ( + config: ( + name_mapper: Pattern(( + key_1: "L", + key_2: "R", + pattern_before: "^.*", + pattern_after: "$", + )), + ), + ), + }, + ), + ( + name: "wave additive", + inner: { + "bevy_animation_graph::nodes::blend_node::BlendNode": ( + mode: Additive, + ), + }, + ), + ( + name: "flip run", + inner: { + "bevy_animation_graph::nodes::flip_lr_node::FlipLRNode": ( + config: ( + name_mapper: Pattern(( + key_1: "L", + key_2: "R", + pattern_before: "^.*", + pattern_after: "$", + )), + ), + ), + }, + ), + ( + name: "run clip 2", + inner: { + "bevy_animation_graph::nodes::clip_node::ClipNode": ( + clip: "animations/human_run.anim.ron", + ), + }, + ), + ( + name: "blend", + inner: { + "bevy_animation_graph::nodes::blend_node::BlendNode": ( + mode: LinearInterpolate, + ), + }, + ), + ( + name: "loop", + inner: { + "bevy_animation_graph::nodes::loop_node::LoopNode": ( + interpolation_period: 0.5, + ), + }, + ), + ( + name: "stand", + inner: { + "bevy_animation_graph::nodes::clip_node::ClipNode": ( + clip: "animations/human_stand.anim.ron", + ), + }, + ), + ( + name: "chain walk", + inner: { + "bevy_animation_graph::nodes::chain_node::ChainNode": ( + interpolation_period: 0.5, + ), + }, + ), + ( + name: "Parameters", + inner: { + "bevy_animation_graph::nodes::graph_node::GraphNode": ( + graph: "animation_graphs/velocity_to_params.animgraph.ron", + ), + }, + ), + ( + name: "chain run", + inner: { + "bevy_animation_graph::nodes::chain_node::ChainNode": ( + interpolation_period: 0.5, + ), + }, + ), + ( + name: "run clip 1", + inner: { + "bevy_animation_graph::nodes::clip_node::ClipNode": ( + clip: "animations/human_run.anim.ron", + ), + }, + ), + ( + name: "wave diff", + inner: { + "bevy_animation_graph::nodes::blend_node::BlendNode": ( + mode: Difference, + ), + }, + ), + ( + name: "wave", + inner: { + "bevy_animation_graph::nodes::clip_node::ClipNode": ( + clip: "animations/human_wave.anim.ron", + ), + }, + ), + ( + name: "walk clip 2", + inner: { + "bevy_animation_graph::nodes::clip_node::ClipNode": ( + clip: "animations/human_walk.anim.ron", + ), + }, + ), + ( + name: "Make Rotation", + inner: { + "bevy_animation_graph::nodes::arithmetic::vec3::rotation_arc::RotationArcNode": (), + }, + ), ], edges_inverted: { NodeData("Rotate", "Bone Mask"): InputData("rotation_bone"), diff --git a/assets/animation_graphs/run.animgraph.ron b/assets/animation_graphs/run.animgraph.ron index 6ef82e9..35422a3 100644 --- a/assets/animation_graphs/run.animgraph.ron +++ b/assets/animation_graphs/run.animgraph.ron @@ -1,58 +1,58 @@ ( nodes: [ - ( - name: "flip run", - inner: { - "bevy_animation_graph::nodes::flip_lr_node::FlipLRNode": ( - config: ( - name_mapper: Pattern(( - key_1: "L", - key_2: "R", - pattern_before: "^.*", - pattern_after: "$", - )), + ( + name: "flip run", + inner: { + "bevy_animation_graph::nodes::flip_lr_node::FlipLRNode": ( + config: ( + name_mapper: Pattern(( + key_1: "L", + key_2: "R", + pattern_before: "^.*", + pattern_after: "$", + )), + ), ), - ), - }, - ), - ( - name: "chain run", - inner: { - "bevy_animation_graph::nodes::chain_node::ChainNode": ( - interpolation_period: 0.5, - ), - }, - ), - ( - name: "speed", - inner: { - "bevy_animation_graph::nodes::speed_node::SpeedNode": (), - }, - ), - ( - name: "run clip 1", - inner: { - "bevy_animation_graph::nodes::clip_node::ClipNode": ( - clip: "animations/human_run.anim.ron", - ), - }, - ), - ( - name: "loop", - inner: { - "bevy_animation_graph::nodes::loop_node::LoopNode": ( - interpolation_period: 0.5, - ), - }, - ), - ( - name: "run clip 2", - inner: { - "bevy_animation_graph::nodes::clip_node::ClipNode": ( - clip: "animations/human_run.anim.ron", - ), - }, - ), + }, + ), + ( + name: "chain run", + inner: { + "bevy_animation_graph::nodes::chain_node::ChainNode": ( + interpolation_period: 0.5, + ), + }, + ), + ( + name: "speed", + inner: { + "bevy_animation_graph::nodes::speed_node::SpeedNode": (), + }, + ), + ( + name: "run clip 1", + inner: { + "bevy_animation_graph::nodes::clip_node::ClipNode": ( + clip: "animations/human_run.anim.ron", + ), + }, + ), + ( + name: "loop", + inner: { + "bevy_animation_graph::nodes::loop_node::LoopNode": ( + interpolation_period: 0.5, + ), + }, + ), + ( + name: "run clip 2", + inner: { + "bevy_animation_graph::nodes::clip_node::ClipNode": ( + clip: "animations/human_run.anim.ron", + ), + }, + ), ], edges_inverted: { NodeData("speed", "pose"): NodeData("loop", "pose"), diff --git a/assets/animation_graphs/toplevel.animgraph.ron b/assets/animation_graphs/toplevel.animgraph.ron index 6789291..715dff4 100644 --- a/assets/animation_graphs/toplevel.animgraph.ron +++ b/assets/animation_graphs/toplevel.animgraph.ron @@ -1,13 +1,13 @@ ( nodes: [ - ( - name: "Locomotion FSM", - inner: { - "bevy_animation_graph::nodes::fsm_node::FSMNode": ( - fsm: "fsm/locomotion.fsm.ron", - ), - }, - ), + ( + name: "Locomotion FSM", + inner: { + "bevy_animation_graph::nodes::fsm_node::FSMNode": ( + fsm: "fsm/locomotion.fsm.ron", + ), + }, + ), ], edges_inverted: { OutputData("pose"): NodeData("Locomotion FSM", "pose"), diff --git a/assets/animation_graphs/velocity_to_params.animgraph.ron b/assets/animation_graphs/velocity_to_params.animgraph.ron index 902efc2..b5eeebc 100644 --- a/assets/animation_graphs/velocity_to_params.animgraph.ron +++ b/assets/animation_graphs/velocity_to_params.animgraph.ron @@ -1,59 +1,59 @@ ( nodes: [ - ( - name: "speed_fac div", - inner: { - "bevy_animation_graph::nodes::arithmetic::f32::div_f32::DivF32": (), - }, - ), - ( - name: "Blend fac div", - inner: { - "bevy_animation_graph::nodes::arithmetic::f32::div_f32::DivF32": (), - }, - ), - ( - name: "Base speed", - inner: { - "bevy_animation_graph::nodes::arithmetic::f32::add_f32::AddF32": (), - }, - ), - ( - name: "1 - blend_fac", - inner: { - "bevy_animation_graph::nodes::arithmetic::f32::sub_f32::SubF32": (), - }, - ), - ( - name: "Amount into blend", - inner: { - "bevy_animation_graph::nodes::arithmetic::f32::sub_f32::SubF32": (), - }, - ), - ( - name: "Clamp blend_fac", - inner: { - "bevy_animation_graph::nodes::arithmetic::f32::clamp_f32::ClampF32": (), - }, - ), - ( - name: "Factored walk_speed", - inner: { - "bevy_animation_graph::nodes::arithmetic::f32::mul_f32::MulF32": (), - }, - ), - ( - name: "Factored run_speed", - inner: { - "bevy_animation_graph::nodes::arithmetic::f32::mul_f32::MulF32": (), - }, - ), - ( - name: "Blend range size", - inner: { - "bevy_animation_graph::nodes::arithmetic::f32::sub_f32::SubF32": (), - }, - ), + ( + name: "speed_fac div", + inner: { + "bevy_animation_graph::nodes::arithmetic::f32::div_f32::DivF32": (), + }, + ), + ( + name: "Blend fac div", + inner: { + "bevy_animation_graph::nodes::arithmetic::f32::div_f32::DivF32": (), + }, + ), + ( + name: "Base speed", + inner: { + "bevy_animation_graph::nodes::arithmetic::f32::add_f32::AddF32": (), + }, + ), + ( + name: "1 - blend_fac", + inner: { + "bevy_animation_graph::nodes::arithmetic::f32::sub_f32::SubF32": (), + }, + ), + ( + name: "Amount into blend", + inner: { + "bevy_animation_graph::nodes::arithmetic::f32::sub_f32::SubF32": (), + }, + ), + ( + name: "Clamp blend_fac", + inner: { + "bevy_animation_graph::nodes::arithmetic::f32::clamp_f32::ClampF32": (), + }, + ), + ( + name: "Factored walk_speed", + inner: { + "bevy_animation_graph::nodes::arithmetic::f32::mul_f32::MulF32": (), + }, + ), + ( + name: "Factored run_speed", + inner: { + "bevy_animation_graph::nodes::arithmetic::f32::mul_f32::MulF32": (), + }, + ), + ( + name: "Blend range size", + inner: { + "bevy_animation_graph::nodes::arithmetic::f32::sub_f32::SubF32": (), + }, + ), ], edges_inverted: { NodeData("Amount into blend", "F32 In 1"): InputData("speed"), diff --git a/assets/animation_graphs/walk.animgraph.ron b/assets/animation_graphs/walk.animgraph.ron index 11043ca..2ee4b9c 100644 --- a/assets/animation_graphs/walk.animgraph.ron +++ b/assets/animation_graphs/walk.animgraph.ron @@ -1,58 +1,58 @@ ( nodes: [ - ( - name: "chain walk", - inner: { - "bevy_animation_graph::nodes::chain_node::ChainNode": ( - interpolation_period: 0.5, - ), - }, - ), - ( - name: "flip walk", - inner: { - "bevy_animation_graph::nodes::flip_lr_node::FlipLRNode": ( - config: ( - name_mapper: Pattern(( - key_1: "L", - key_2: "R", - pattern_before: "^.*", - pattern_after: "$", - )), + ( + name: "chain walk", + inner: { + "bevy_animation_graph::nodes::chain_node::ChainNode": ( + interpolation_period: 0.5, ), - ), - }, - ), - ( - name: "walk clip 1", - inner: { - "bevy_animation_graph::nodes::clip_node::ClipNode": ( - clip: "animations/human_walk.anim.ron", - ), - }, - ), - ( - name: "walk clip 2", - inner: { - "bevy_animation_graph::nodes::clip_node::ClipNode": ( - clip: "animations/human_walk.anim.ron", - ), - }, - ), - ( - name: "speed", - inner: { - "bevy_animation_graph::nodes::speed_node::SpeedNode": (), - }, - ), - ( - name: "loop", - inner: { - "bevy_animation_graph::nodes::loop_node::LoopNode": ( - interpolation_period: 0.5, - ), - }, - ), + }, + ), + ( + name: "flip walk", + inner: { + "bevy_animation_graph::nodes::flip_lr_node::FlipLRNode": ( + config: ( + name_mapper: Pattern(( + key_1: "L", + key_2: "R", + pattern_before: "^.*", + pattern_after: "$", + )), + ), + ), + }, + ), + ( + name: "walk clip 1", + inner: { + "bevy_animation_graph::nodes::clip_node::ClipNode": ( + clip: "animations/human_walk.anim.ron", + ), + }, + ), + ( + name: "walk clip 2", + inner: { + "bevy_animation_graph::nodes::clip_node::ClipNode": ( + clip: "animations/human_walk.anim.ron", + ), + }, + ), + ( + name: "speed", + inner: { + "bevy_animation_graph::nodes::speed_node::SpeedNode": (), + }, + ), + ( + name: "loop", + inner: { + "bevy_animation_graph::nodes::loop_node::LoopNode": ( + interpolation_period: 0.5, + ), + }, + ), ], edges_inverted: { NodeData("loop", "pose"): NodeData("chain walk", "pose"), diff --git a/assets/animation_graphs/walk_to_run.animgraph.ron b/assets/animation_graphs/walk_to_run.animgraph.ron index 9e523ae..a8b3d8e 100644 --- a/assets/animation_graphs/walk_to_run.animgraph.ron +++ b/assets/animation_graphs/walk_to_run.animgraph.ron @@ -1,27 +1,27 @@ ( nodes: [ - ( - name: "Done", - inner: { - "bevy_animation_graph::nodes::arithmetic::event_queue::fire_event::FireEventNode": ( - event: EndTransition, - ), - }, - ), - ( - name: "Blend", - inner: { - "bevy_animation_graph::nodes::blend_node::BlendNode": (), - }, - ), - ( - name: "Is it done?", - inner: { - "bevy_animation_graph::nodes::arithmetic::f32::compare_f32::CompareF32": ( - op: MoreEqual, - ), - }, - ), + ( + name: "Done", + inner: { + "bevy_animation_graph::nodes::arithmetic::event_queue::fire_event::FireEventNode": ( + event: EndTransition, + ), + }, + ), + ( + name: "Blend", + inner: { + "bevy_animation_graph::nodes::blend_node::BlendNode": (), + }, + ), + ( + name: "Is it done?", + inner: { + "bevy_animation_graph::nodes::arithmetic::f32::compare_f32::CompareF32": ( + op: MoreEqual, + ), + }, + ), ], edges_inverted: { NodeData("Is it done?", "F32 In 2"): InputData("1"), diff --git a/crates/bevy_animation_graph/src/core/animation_node.rs b/crates/bevy_animation_graph/src/core/animation_node.rs index f9affb0..56b6064 100644 --- a/crates/bevy_animation_graph/src/core/animation_node.rs +++ b/crates/bevy_animation_graph/src/core/animation_node.rs @@ -134,7 +134,7 @@ impl PinOrdering { } } -#[derive(Debug, Deref, DerefMut)] +#[derive(Debug, Clone, Deref, DerefMut)] // #[derive(Reflect)] // manual reflect impl (see below) pub struct AnimationNode { pub name: String, @@ -161,16 +161,6 @@ impl Default for AnimationNode { } } -impl Clone for AnimationNode { - fn clone(&self) -> Self { - Self { - name: self.name.clone(), - inner: self.inner.clone(), - should_debug: self.should_debug, - } - } -} - const _: () = { #[allow(unused_mut)] impl bevy::reflect::GetTypeRegistration for AnimationNode From 3916064403188535f8feb0d584637996c9cbd061 Mon Sep 17 00:00:00 2001 From: aecsocket Date: Sun, 2 Feb 2025 10:52:39 +0000 Subject: [PATCH 3/3] Standardise node pin naming scheme --- .../animation_graphs/human_ik.animgraph.ron | 12 ++-- .../animation_graphs/human_new.animgraph.ron | 56 +++++++++---------- assets/animation_graphs/run.animgraph.ron | 10 ++-- .../velocity_to_params.animgraph.ron | 42 +++++++------- assets/animation_graphs/walk.animgraph.ron | 10 ++-- .../walk_to_run.animgraph.ron | 14 ++--- .../src/nodes/arithmetic/f32/abs_f32.rs | 4 +- .../src/nodes/arithmetic/f32/add_f32.rs | 6 +- .../src/nodes/arithmetic/f32/clamp_f32.rs | 8 +-- .../src/nodes/arithmetic/f32/compare_f32.rs | 6 +- .../src/nodes/arithmetic/f32/div_f32.rs | 6 +- .../src/nodes/arithmetic/f32/mul_f32.rs | 6 +- .../src/nodes/arithmetic/f32/select_f32.rs | 4 +- .../src/nodes/arithmetic/f32/sub_f32.rs | 6 +- .../src/nodes/arithmetic/vec3/rotation_arc.rs | 6 +- .../src/nodes/blend_node.rs | 8 +-- .../src/nodes/chain_node.rs | 8 +-- .../src/nodes/rotation_node.rs | 4 +- .../nodes/space_conversion/extend_skeleton.rs | 2 +- .../src/nodes/space_conversion/into_bone.rs | 2 +- .../nodes/space_conversion/into_character.rs | 2 +- .../src/nodes/space_conversion/into_global.rs | 2 +- .../src/nodes/speed_node.rs | 2 +- .../src/nodes/twoboneik_node.rs | 4 +- examples/human/examples/human.rs | 4 +- examples/human_fsm/examples/human_fsm.rs | 2 +- examples/human_ik/examples/human_ik.rs | 4 +- 27 files changed, 120 insertions(+), 120 deletions(-) diff --git a/assets/animation_graphs/human_ik.animgraph.ron b/assets/animation_graphs/human_ik.animgraph.ron index 3a767ef..8c0b30f 100644 --- a/assets/animation_graphs/human_ik.animgraph.ron +++ b/assets/animation_graphs/human_ik.animgraph.ron @@ -16,18 +16,18 @@ ), ], edges_inverted: { - NodeData("arm ik", "Target Path"): InputData("right hand path"), - NodeData("base anim", "Target Speed"): InputData("Target Speed"), + NodeData("arm ik", "target_path"): InputData("right hand path"), + NodeData("base anim", "target_speed"): InputData("target_speed"), OutputTime: NodeTime("arm ik"), - NodeData("base anim", "Target Direction"): InputData("Target Direction"), + NodeData("base anim", "target_direction"): InputData("target_direction"), OutputData("pose"): NodeData("arm ik", "pose"), NodeData("arm ik", "pose"): NodeData("base anim", "pose"), - NodeData("arm ik", "Target Position"): InputData("target hand pos"), + NodeData("arm ik", "target_position"): InputData("target hand pos"), NodeTime("arm ik", "time"): NodeTime("base anim"), }, default_parameters: { - "Target Speed": F32(1.0), - "Target Direction": Vec3((1.0, 0.0, 0.0)), + "target_speed": F32(1.0), + "target_direction": Vec3((1.0, 0.0, 0.0)), "right hand path": EntityPath([ "metarig", "spine", diff --git a/assets/animation_graphs/human_new.animgraph.ron b/assets/animation_graphs/human_new.animgraph.ron index fee7058..5e7efe4 100644 --- a/assets/animation_graphs/human_new.animgraph.ron +++ b/assets/animation_graphs/human_new.animgraph.ron @@ -160,50 +160,50 @@ ), ], edges_inverted: { - NodeData("Rotate", "Bone Mask"): InputData("rotation_bone"), + NodeData("Rotate", "bone_mask"): InputData("rotation_bone"), NodeTime("speed", "time"): NodeTime("loop"), - NodeData("Make Rotation", "Vec3 In 2"): InputData("Target Direction"), + NodeData("Make Rotation", "in_b"): InputData("target_direction"), OutputData("pose"): NodeData("Rotate", "pose"), - NodeTime("chain run", "time B"): NodeTime("flip run"), - NodeData("chain walk", "pose B"): NodeData("flip walk", "pose"), - NodeTime("blend", "time A"): NodeTime("chain walk"), - NodeData("chain walk", "pose A"): NodeData("walk clip 1", "pose"), + NodeTime("chain run", "time_b"): NodeTime("flip run"), + NodeData("chain walk", "pose_b"): NodeData("flip walk", "pose"), + NodeTime("blend", "time_a"): NodeTime("chain walk"), + NodeData("chain walk", "pose_a"): NodeData("walk clip 1", "pose"), NodeData("blend", "factor"): NodeData("Parameters", "blend_fac"), - NodeData("Parameters", "speed"): InputData("Target Speed"), - NodeData("blend", "pose A"): NodeData("chain walk", "pose"), - NodeTime("wave additive", "time A"): NodeTime("speed"), + NodeData("Parameters", "speed"): InputData("target_speed"), + NodeData("blend", "pose_a"): NodeData("chain walk", "pose"), + NodeTime("wave additive", "time_a"): NodeTime("speed"), OutputTime: NodeTime("Rotate"), - NodeData("wave additive", "pose A"): NodeData("speed", "pose"), - NodeData("wave diff", "pose B"): NodeData("wave", "pose"), + NodeData("wave additive", "pose_a"): NodeData("speed", "pose"), + NodeData("wave diff", "pose_b"): NodeData("wave", "pose"), NodeData("flip run", "pose"): NodeData("run clip 2", "pose"), - NodeData("blend", "pose B"): NodeData("chain run", "pose"), - NodeData("speed", "Speed"): NodeData("Parameters", "speed_fac"), - NodeData("wave additive", "pose B"): NodeData("wave diff", "pose"), - NodeTime("wave diff", "time A"): NodeTime("stand"), - NodeTime("wave diff", "time B"): NodeTime("wave"), - NodeTime("chain walk", "time B"): NodeTime("flip walk"), - NodeData("wave diff", "pose A"): NodeData("stand", "pose"), - NodeTime("wave additive", "time B"): NodeTime("wave diff"), - NodeTime("chain walk", "time A"): NodeTime("walk clip 1"), - NodeData("Rotate", "Rotation"): NodeData("Make Rotation", "Quat Out"), + NodeData("blend", "pose_b"): NodeData("chain run", "pose"), + NodeData("speed", "speed"): NodeData("Parameters", "speed_fac"), + NodeData("wave additive", "pose_b"): NodeData("wave diff", "pose"), + NodeTime("wave diff", "time_a"): NodeTime("stand"), + NodeTime("wave diff", "time_b"): NodeTime("wave"), + NodeTime("chain walk", "time_b"): NodeTime("flip walk"), + NodeData("wave diff", "pose_a"): NodeData("stand", "pose"), + NodeTime("wave additive", "time_b"): NodeTime("wave diff"), + NodeTime("chain walk", "time_a"): NodeTime("walk clip 1"), + NodeData("Rotate", "rotation"): NodeData("Make Rotation", "out"), NodeTime("loop", "time"): NodeTime("blend"), - NodeData("chain run", "pose B"): NodeData("flip run", "pose"), - NodeTime("blend", "time B"): NodeTime("chain run"), + NodeData("chain run", "pose_b"): NodeData("flip run", "pose"), + NodeTime("blend", "time_b"): NodeTime("chain run"), NodeData("loop", "pose"): NodeData("blend", "pose"), NodeTime("Rotate", "time"): NodeTime("wave additive"), NodeData("wave additive", "factor"): InputData("1"), - NodeTime("chain run", "time A"): NodeTime("run clip 1"), + NodeTime("chain run", "time_a"): NodeTime("run clip 1"), NodeData("flip walk", "pose"): NodeData("walk clip 2", "pose"), NodeTime("flip walk", "time"): NodeTime("walk clip 2"), NodeData("Rotate", "pose"): NodeData("wave additive", "pose"), NodeData("speed", "pose"): NodeData("loop", "pose"), - NodeData("Make Rotation", "Vec3 In 1"): InputData("Z"), + NodeData("Make Rotation", "in_a"): InputData("Z"), NodeTime("flip run", "time"): NodeTime("run clip 2"), - NodeData("chain run", "pose A"): NodeData("run clip 1", "pose"), + NodeData("chain run", "pose_a"): NodeData("run clip 1", "pose"), }, default_parameters: { - "Target Speed": F32(1.6), - "Target Direction": Vec3((1.0, 0.0, 0.0)), + "target_speed": F32(1.6), + "target_direction": Vec3((1.0, 0.0, 0.0)), "rotation_bone": EntityPath([ "metarig", "spine", diff --git a/assets/animation_graphs/run.animgraph.ron b/assets/animation_graphs/run.animgraph.ron index 35422a3..0f722a0 100644 --- a/assets/animation_graphs/run.animgraph.ron +++ b/assets/animation_graphs/run.animgraph.ron @@ -58,16 +58,16 @@ NodeData("speed", "pose"): NodeData("loop", "pose"), NodeTime("flip run", "time"): NodeTime("run clip 2"), NodeTime("loop", "time"): NodeTime("chain run"), - NodeTime("chain run", "time B"): NodeTime("flip run"), + NodeTime("chain run", "time_b"): NodeTime("flip run"), OutputTime: NodeTime("speed"), NodeData("flip run", "pose"): NodeData("run clip 2", "pose"), - NodeData("chain run", "pose B"): NodeData("flip run", "pose"), + NodeData("chain run", "pose_b"): NodeData("flip run", "pose"), OutputData("pose"): NodeData("speed", "pose"), NodeTime("speed", "time"): NodeTime("loop"), NodeData("loop", "pose"): NodeData("chain run", "pose"), - NodeData("speed", "Speed"): InputData("speed"), - NodeTime("chain run", "time A"): NodeTime("run clip 1"), - NodeData("chain run", "pose A"): NodeData("run clip 1", "pose"), + NodeData("speed", "speed"): InputData("speed"), + NodeTime("chain run", "time_a"): NodeTime("run clip 1"), + NodeData("chain run", "pose_a"): NodeData("run clip 1", "pose"), }, default_parameters: { "blend": F32(0.2), diff --git a/assets/animation_graphs/velocity_to_params.animgraph.ron b/assets/animation_graphs/velocity_to_params.animgraph.ron index b5eeebc..b2d2250 100644 --- a/assets/animation_graphs/velocity_to_params.animgraph.ron +++ b/assets/animation_graphs/velocity_to_params.animgraph.ron @@ -56,27 +56,27 @@ ), ], edges_inverted: { - NodeData("Amount into blend", "F32 In 1"): InputData("speed"), - NodeData("Blend fac div", "F32 In 1"): NodeData("Amount into blend", "F32 Out"), - NodeData("Clamp blend_fac", "Min"): InputData("0"), - NodeData("Factored walk_speed", "F32 In 1"): NodeData("1 - blend_fac", "F32 Out"), - NodeData("Blend fac div", "F32 In 2"): NodeData("Blend range size", "F32 Out"), - NodeData("speed_fac div", "F32 In 2"): NodeData("Base speed", "F32 Out"), - NodeData("speed_fac div", "F32 In 1"): InputData("speed"), - NodeData("Factored run_speed", "F32 In 1"): NodeData("Clamp blend_fac", "F32 Out"), - NodeData("Clamp blend_fac", "Max"): InputData("1"), - NodeData("1 - blend_fac", "F32 In 2"): NodeData("Clamp blend_fac", "F32 Out"), - NodeData("Base speed", "F32 In 1"): NodeData("Factored run_speed", "F32 Out"), - NodeData("Blend range size", "F32 In 2"): InputData("blend_start"), - NodeData("Amount into blend", "F32 In 2"): InputData("blend_start"), - NodeData("Blend range size", "F32 In 1"): InputData("blend_end"), - NodeData("Base speed", "F32 In 2"): NodeData("Factored walk_speed", "F32 Out"), - NodeData("Clamp blend_fac", "F32 In"): NodeData("Blend fac div", "F32 Out"), - NodeData("Factored walk_speed", "F32 In 2"): InputData("walk_speed"), - OutputData("blend_fac"): NodeData("Clamp blend_fac", "F32 Out"), - NodeData("1 - blend_fac", "F32 In 1"): InputData("1"), - NodeData("Factored run_speed", "F32 In 2"): InputData("run_speed"), - OutputData("speed_fac"): NodeData("speed_fac div", "F32 Out"), + NodeData("Amount into blend", "in_a"): InputData("speed"), + NodeData("Blend fac div", "in_a"): NodeData("Amount into blend", "out"), + NodeData("Clamp blend_fac", "min"): InputData("0"), + NodeData("Factored walk_speed", "in_a"): NodeData("1 - blend_fac", "out"), + NodeData("Blend fac div", "in_b"): NodeData("Blend range size", "out"), + NodeData("speed_fac div", "in_b"): NodeData("Base speed", "out"), + NodeData("speed_fac div", "in_a"): InputData("speed"), + NodeData("Factored run_speed", "in_a"): NodeData("Clamp blend_fac", "out"), + NodeData("Clamp blend_fac", "max"): InputData("1"), + NodeData("1 - blend_fac", "in_b"): NodeData("Clamp blend_fac", "out"), + NodeData("Base speed", "in_a"): NodeData("Factored run_speed", "out"), + NodeData("Blend range size", "in_b"): InputData("blend_start"), + NodeData("Amount into blend", "in_b"): InputData("blend_start"), + NodeData("Blend range size", "in_a"): InputData("blend_end"), + NodeData("Base speed", "in_b"): NodeData("Factored walk_speed", "out"), + NodeData("Clamp blend_fac", "in"): NodeData("Blend fac div", "out"), + NodeData("Factored walk_speed", "in_b"): InputData("walk_speed"), + OutputData("blend_fac"): NodeData("Clamp blend_fac", "out"), + NodeData("1 - blend_fac", "in_a"): InputData("1"), + NodeData("Factored run_speed", "in_b"): InputData("run_speed"), + OutputData("speed_fac"): NodeData("speed_fac div", "out"), }, default_parameters: { "speed": F32(1.0), diff --git a/assets/animation_graphs/walk.animgraph.ron b/assets/animation_graphs/walk.animgraph.ron index 2ee4b9c..3fc9978 100644 --- a/assets/animation_graphs/walk.animgraph.ron +++ b/assets/animation_graphs/walk.animgraph.ron @@ -59,15 +59,15 @@ OutputData("pose"): NodeData("speed", "pose"), OutputTime: NodeTime("speed"), NodeData("flip walk", "pose"): NodeData("walk clip 2", "pose"), - NodeTime("chain walk", "time B"): NodeTime("flip walk"), + NodeTime("chain walk", "time_b"): NodeTime("flip walk"), NodeTime("loop", "time"): NodeTime("chain walk"), NodeData("speed", "pose"): NodeData("loop", "pose"), - NodeData("chain walk", "pose A"): NodeData("walk clip 1", "pose"), - NodeTime("chain walk", "time A"): NodeTime("walk clip 1"), - NodeData("speed", "Speed"): InputData("speed"), + NodeData("chain walk", "pose_a"): NodeData("walk clip 1", "pose"), + NodeTime("chain walk", "time_a"): NodeTime("walk clip 1"), + NodeData("speed", "speed"): InputData("speed"), NodeTime("speed", "time"): NodeTime("loop"), NodeTime("flip walk", "time"): NodeTime("walk clip 2"), - NodeData("chain walk", "pose B"): NodeData("flip walk", "pose"), + NodeData("chain walk", "pose_b"): NodeData("flip walk", "pose"), }, default_parameters: { "speed": F32(1.0), diff --git a/assets/animation_graphs/walk_to_run.animgraph.ron b/assets/animation_graphs/walk_to_run.animgraph.ron index a8b3d8e..2fe276d 100644 --- a/assets/animation_graphs/walk_to_run.animgraph.ron +++ b/assets/animation_graphs/walk_to_run.animgraph.ron @@ -24,16 +24,16 @@ ), ], edges_inverted: { - NodeData("Is it done?", "F32 In 2"): InputData("1"), - NodeTime("Blend", "time A"): InputTime("source time"), + NodeData("Is it done?", "in_b"): InputData("1"), + NodeTime("Blend", "time_a"): InputTime("source time"), OutputData("pose"): NodeData("Blend", "pose"), - NodeData("Done", "condition"): NodeData("Is it done?", "Bool Out"), - NodeData("Is it done?", "F32 In 1"): InputData("elapsed percent"), - NodeTime("Blend", "time B"): InputTime("target time"), + NodeData("Done", "condition"): NodeData("Is it done?", "out"), + NodeData("Is it done?", "in_a"): InputData("elapsed percent"), + NodeTime("Blend", "time_b"): InputTime("target time"), OutputTime: NodeTime("Blend"), - NodeData("Blend", "pose B"): InputData("target pose"), + NodeData("Blend", "pose_b"): InputData("target pose"), NodeData("Blend", "factor"): InputData("elapsed percent"), - NodeData("Blend", "pose A"): InputData("source pose"), + NodeData("Blend", "pose_a"): InputData("source pose"), OutputData("driver events"): NodeData("Done", "event"), }, default_parameters: { diff --git a/crates/bevy_animation_graph/src/nodes/arithmetic/f32/abs_f32.rs b/crates/bevy_animation_graph/src/nodes/arithmetic/f32/abs_f32.rs index d08fdf2..03a9b39 100644 --- a/crates/bevy_animation_graph/src/nodes/arithmetic/f32/abs_f32.rs +++ b/crates/bevy_animation_graph/src/nodes/arithmetic/f32/abs_f32.rs @@ -10,8 +10,8 @@ use bevy::prelude::*; pub struct AbsF32; impl AbsF32 { - pub const INPUT: &'static str = "F32 In"; - pub const OUTPUT: &'static str = "F32 Out"; + pub const INPUT: &'static str = "in"; + pub const OUTPUT: &'static str = "out"; pub fn new() -> Self { Self diff --git a/crates/bevy_animation_graph/src/nodes/arithmetic/f32/add_f32.rs b/crates/bevy_animation_graph/src/nodes/arithmetic/f32/add_f32.rs index 950ce5e..de80cf8 100644 --- a/crates/bevy_animation_graph/src/nodes/arithmetic/f32/add_f32.rs +++ b/crates/bevy_animation_graph/src/nodes/arithmetic/f32/add_f32.rs @@ -10,9 +10,9 @@ use bevy::prelude::*; pub struct AddF32; impl AddF32 { - pub const INPUT_1: &'static str = "F32 In 1"; - pub const INPUT_2: &'static str = "F32 In 2"; - pub const OUTPUT: &'static str = "F32 Out"; + pub const INPUT_1: &'static str = "in_a"; + pub const INPUT_2: &'static str = "in_b"; + pub const OUTPUT: &'static str = "out"; pub fn new() -> Self { Self diff --git a/crates/bevy_animation_graph/src/nodes/arithmetic/f32/clamp_f32.rs b/crates/bevy_animation_graph/src/nodes/arithmetic/f32/clamp_f32.rs index 94a082e..29fe2ad 100644 --- a/crates/bevy_animation_graph/src/nodes/arithmetic/f32/clamp_f32.rs +++ b/crates/bevy_animation_graph/src/nodes/arithmetic/f32/clamp_f32.rs @@ -10,10 +10,10 @@ use bevy::prelude::*; pub struct ClampF32; impl ClampF32 { - pub const INPUT: &'static str = "F32 In"; - pub const CLAMP_MIN: &'static str = "Min"; - pub const CLAMP_MAX: &'static str = "Max"; - pub const OUTPUT: &'static str = "F32 Out"; + pub const INPUT: &'static str = "in"; + pub const CLAMP_MIN: &'static str = "min"; + pub const CLAMP_MAX: &'static str = "max"; + pub const OUTPUT: &'static str = "out"; pub fn new() -> Self { Self diff --git a/crates/bevy_animation_graph/src/nodes/arithmetic/f32/compare_f32.rs b/crates/bevy_animation_graph/src/nodes/arithmetic/f32/compare_f32.rs index 94ea3c3..164ef66 100644 --- a/crates/bevy_animation_graph/src/nodes/arithmetic/f32/compare_f32.rs +++ b/crates/bevy_animation_graph/src/nodes/arithmetic/f32/compare_f32.rs @@ -23,9 +23,9 @@ pub struct CompareF32 { } impl CompareF32 { - pub const INPUT_1: &'static str = "F32 In 1"; - pub const INPUT_2: &'static str = "F32 In 2"; - pub const OUTPUT: &'static str = "Bool Out"; + pub const INPUT_1: &'static str = "in_a"; + pub const INPUT_2: &'static str = "in_b"; + pub const OUTPUT: &'static str = "out"; pub fn new(op: CompareOp) -> Self { Self { op } diff --git a/crates/bevy_animation_graph/src/nodes/arithmetic/f32/div_f32.rs b/crates/bevy_animation_graph/src/nodes/arithmetic/f32/div_f32.rs index 1b8d50a..0b850de 100644 --- a/crates/bevy_animation_graph/src/nodes/arithmetic/f32/div_f32.rs +++ b/crates/bevy_animation_graph/src/nodes/arithmetic/f32/div_f32.rs @@ -10,9 +10,9 @@ use bevy::prelude::*; pub struct DivF32; impl DivF32 { - pub const INPUT_1: &'static str = "F32 In 1"; - pub const INPUT_2: &'static str = "F32 In 2"; - pub const OUTPUT: &'static str = "F32 Out"; + pub const INPUT_1: &'static str = "in_a"; + pub const INPUT_2: &'static str = "in_b"; + pub const OUTPUT: &'static str = "out"; pub fn new() -> Self { Self diff --git a/crates/bevy_animation_graph/src/nodes/arithmetic/f32/mul_f32.rs b/crates/bevy_animation_graph/src/nodes/arithmetic/f32/mul_f32.rs index c0d72c8..2aa153b 100644 --- a/crates/bevy_animation_graph/src/nodes/arithmetic/f32/mul_f32.rs +++ b/crates/bevy_animation_graph/src/nodes/arithmetic/f32/mul_f32.rs @@ -10,9 +10,9 @@ use bevy::prelude::*; pub struct MulF32; impl MulF32 { - pub const INPUT_1: &'static str = "F32 In 1"; - pub const INPUT_2: &'static str = "F32 In 2"; - pub const OUTPUT: &'static str = "F32 Out"; + pub const INPUT_1: &'static str = "in_a"; + pub const INPUT_2: &'static str = "in_b"; + pub const OUTPUT: &'static str = "out"; pub fn new() -> Self { Self diff --git a/crates/bevy_animation_graph/src/nodes/arithmetic/f32/select_f32.rs b/crates/bevy_animation_graph/src/nodes/arithmetic/f32/select_f32.rs index 9e4bb61..df2a876 100644 --- a/crates/bevy_animation_graph/src/nodes/arithmetic/f32/select_f32.rs +++ b/crates/bevy_animation_graph/src/nodes/arithmetic/f32/select_f32.rs @@ -12,8 +12,8 @@ pub struct SelectF32; impl SelectF32 { pub const INPUT_BOOL: &'static str = "bool"; - pub const INPUT_FALSE: &'static str = "if false"; - pub const INPUT_TRUE: &'static str = "if true"; + pub const INPUT_FALSE: &'static str = "if_false"; + pub const INPUT_TRUE: &'static str = "if_true"; pub const OUTPUT: &'static str = "out"; pub fn new() -> Self { diff --git a/crates/bevy_animation_graph/src/nodes/arithmetic/f32/sub_f32.rs b/crates/bevy_animation_graph/src/nodes/arithmetic/f32/sub_f32.rs index 0321b70..61c2e84 100644 --- a/crates/bevy_animation_graph/src/nodes/arithmetic/f32/sub_f32.rs +++ b/crates/bevy_animation_graph/src/nodes/arithmetic/f32/sub_f32.rs @@ -10,9 +10,9 @@ use bevy::prelude::*; pub struct SubF32; impl SubF32 { - pub const INPUT_1: &'static str = "F32 In 1"; - pub const INPUT_2: &'static str = "F32 In 2"; - pub const OUTPUT: &'static str = "F32 Out"; + pub const INPUT_1: &'static str = "in_a"; + pub const INPUT_2: &'static str = "in_b"; + pub const OUTPUT: &'static str = "out"; pub fn new() -> Self { Self diff --git a/crates/bevy_animation_graph/src/nodes/arithmetic/vec3/rotation_arc.rs b/crates/bevy_animation_graph/src/nodes/arithmetic/vec3/rotation_arc.rs index af28988..404f941 100644 --- a/crates/bevy_animation_graph/src/nodes/arithmetic/vec3/rotation_arc.rs +++ b/crates/bevy_animation_graph/src/nodes/arithmetic/vec3/rotation_arc.rs @@ -11,9 +11,9 @@ use bevy::prelude::*; pub struct RotationArcNode; impl RotationArcNode { - pub const INPUT_1: &'static str = "Vec3 In 1"; - pub const INPUT_2: &'static str = "Vec3 In 2"; - pub const OUTPUT: &'static str = "Quat Out"; + pub const INPUT_1: &'static str = "in_a"; + pub const INPUT_2: &'static str = "in_b"; + pub const OUTPUT: &'static str = "out"; pub fn new() -> Self { Self diff --git a/crates/bevy_animation_graph/src/nodes/blend_node.rs b/crates/bevy_animation_graph/src/nodes/blend_node.rs index 8e06a55..36352a6 100644 --- a/crates/bevy_animation_graph/src/nodes/blend_node.rs +++ b/crates/bevy_animation_graph/src/nodes/blend_node.rs @@ -36,10 +36,10 @@ pub struct BlendNode { impl BlendNode { pub const FACTOR: &'static str = "factor"; - pub const IN_POSE_A: &'static str = "pose A"; - pub const IN_TIME_A: &'static str = "time A"; - pub const IN_POSE_B: &'static str = "pose B"; - pub const IN_TIME_B: &'static str = "time B"; + pub const IN_POSE_A: &'static str = "pose_a"; + pub const IN_TIME_A: &'static str = "time_a"; + pub const IN_POSE_B: &'static str = "pose_b"; + pub const IN_TIME_B: &'static str = "time_b"; pub const OUT_POSE: &'static str = "pose"; pub fn new(mode: BlendMode, sync_mode: BlendSyncMode) -> Self { diff --git a/crates/bevy_animation_graph/src/nodes/chain_node.rs b/crates/bevy_animation_graph/src/nodes/chain_node.rs index 679d0c9..b969278 100644 --- a/crates/bevy_animation_graph/src/nodes/chain_node.rs +++ b/crates/bevy_animation_graph/src/nodes/chain_node.rs @@ -16,10 +16,10 @@ pub struct ChainNode { } impl ChainNode { - pub const IN_POSE_A: &'static str = "pose A"; - pub const IN_TIME_A: &'static str = "time A"; - pub const IN_POSE_B: &'static str = "pose B"; - pub const IN_TIME_B: &'static str = "time B"; + pub const IN_POSE_A: &'static str = "pose_a"; + pub const IN_TIME_A: &'static str = "time_a"; + pub const IN_POSE_B: &'static str = "pose_b"; + pub const IN_TIME_B: &'static str = "time_b"; pub const OUT_POSE: &'static str = "pose"; pub fn new(interpolation_period: f32) -> Self { diff --git a/crates/bevy_animation_graph/src/nodes/rotation_node.rs b/crates/bevy_animation_graph/src/nodes/rotation_node.rs index 0f08a3c..23275ba 100644 --- a/crates/bevy_animation_graph/src/nodes/rotation_node.rs +++ b/crates/bevy_animation_graph/src/nodes/rotation_node.rs @@ -58,8 +58,8 @@ impl Default for RotationNode { } impl RotationNode { - pub const TARGET: &'static str = "Bone Mask"; - pub const ROTATION: &'static str = "Rotation"; + pub const TARGET: &'static str = "bone_mask"; + pub const ROTATION: &'static str = "rotation"; pub const IN_TIME: &'static str = "time"; pub const IN_POSE: &'static str = "pose"; pub const OUT_POSE: &'static str = "pose"; diff --git a/crates/bevy_animation_graph/src/nodes/space_conversion/extend_skeleton.rs b/crates/bevy_animation_graph/src/nodes/space_conversion/extend_skeleton.rs index 95494f3..bd3216f 100644 --- a/crates/bevy_animation_graph/src/nodes/space_conversion/extend_skeleton.rs +++ b/crates/bevy_animation_graph/src/nodes/space_conversion/extend_skeleton.rs @@ -16,7 +16,7 @@ use bevy::reflect::{std_traits::ReflectDefault, Reflect}; pub struct ExtendSkeleton {} impl ExtendSkeleton { - pub const POSE_IN: &'static str = "Pose In"; + pub const POSE_IN: &'static str = "pose_in"; pub fn new() -> Self { Self {} diff --git a/crates/bevy_animation_graph/src/nodes/space_conversion/into_bone.rs b/crates/bevy_animation_graph/src/nodes/space_conversion/into_bone.rs index cdd08e1..9b7e23b 100644 --- a/crates/bevy_animation_graph/src/nodes/space_conversion/into_bone.rs +++ b/crates/bevy_animation_graph/src/nodes/space_conversion/into_bone.rs @@ -15,7 +15,7 @@ use bevy::reflect::{std_traits::ReflectDefault, Reflect}; pub struct IntoBoneSpaceNode {} impl IntoBoneSpaceNode { - pub const POSE_IN: &'static str = "Pose In"; + pub const POSE_IN: &'static str = "pose_in"; pub fn new() -> Self { Self {} diff --git a/crates/bevy_animation_graph/src/nodes/space_conversion/into_character.rs b/crates/bevy_animation_graph/src/nodes/space_conversion/into_character.rs index 879050d..0367501 100644 --- a/crates/bevy_animation_graph/src/nodes/space_conversion/into_character.rs +++ b/crates/bevy_animation_graph/src/nodes/space_conversion/into_character.rs @@ -15,7 +15,7 @@ use bevy::reflect::{std_traits::ReflectDefault, Reflect}; pub struct IntoCharacterSpaceNode {} impl IntoCharacterSpaceNode { - pub const POSE_IN: &'static str = "Pose In"; + pub const POSE_IN: &'static str = "pose_in"; pub fn new() -> Self { Self {} diff --git a/crates/bevy_animation_graph/src/nodes/space_conversion/into_global.rs b/crates/bevy_animation_graph/src/nodes/space_conversion/into_global.rs index 4c3bd2f..84bfb15 100644 --- a/crates/bevy_animation_graph/src/nodes/space_conversion/into_global.rs +++ b/crates/bevy_animation_graph/src/nodes/space_conversion/into_global.rs @@ -15,7 +15,7 @@ use bevy::reflect::{std_traits::ReflectDefault, Reflect}; pub struct IntoGlobalSpaceNode {} impl IntoGlobalSpaceNode { - pub const POSE_IN: &'static str = "Pose In"; + pub const POSE_IN: &'static str = "pose_in"; pub fn new() -> Self { Self {} diff --git a/crates/bevy_animation_graph/src/nodes/speed_node.rs b/crates/bevy_animation_graph/src/nodes/speed_node.rs index 205a509..d321549 100644 --- a/crates/bevy_animation_graph/src/nodes/speed_node.rs +++ b/crates/bevy_animation_graph/src/nodes/speed_node.rs @@ -16,7 +16,7 @@ impl SpeedNode { pub const IN_POSE: &'static str = "pose"; pub const IN_TIME: &'static str = "time"; pub const OUT_POSE: &'static str = "pose"; - pub const SPEED: &'static str = "Speed"; + pub const SPEED: &'static str = "speed"; pub fn new() -> Self { Self diff --git a/crates/bevy_animation_graph/src/nodes/twoboneik_node.rs b/crates/bevy_animation_graph/src/nodes/twoboneik_node.rs index a7378d2..d7d631a 100644 --- a/crates/bevy_animation_graph/src/nodes/twoboneik_node.rs +++ b/crates/bevy_animation_graph/src/nodes/twoboneik_node.rs @@ -26,8 +26,8 @@ impl TwoBoneIKNode { pub const IN_TIME: &'static str = "time"; pub const IN_POSE: &'static str = "pose"; pub const OUT_POSE: &'static str = "pose"; - pub const TARGETBONE: &'static str = "Target Path"; - pub const TARGETPOS: &'static str = "Target Position"; + pub const TARGETBONE: &'static str = "target_path"; + pub const TARGETPOS: &'static str = "target_position"; pub fn new() -> Self { Self {} diff --git a/examples/human/examples/human.rs b/examples/human/examples/human.rs index b962c0e..35c3797 100644 --- a/examples/human/examples/human.rs +++ b/examples/human/examples/human.rs @@ -141,6 +141,6 @@ fn keyboard_animation_control( (Quat::from_rotation_y(-1. * time.delta_secs()) * params.direction).normalize(); } - player.set_input_parameter("Target Speed", params.speed.into()); - player.set_input_parameter("Target Direction", params.direction.into()); + player.set_input_parameter("target_speed", params.speed.into()); + player.set_input_parameter("target_direction", params.direction.into()); } diff --git a/examples/human_fsm/examples/human_fsm.rs b/examples/human_fsm/examples/human_fsm.rs index fc441cf..51cf39a 100644 --- a/examples/human_fsm/examples/human_fsm.rs +++ b/examples/human_fsm/examples/human_fsm.rs @@ -132,5 +132,5 @@ fn keyboard_animation_control( params.direction = Vec3::Z; } - player.set_input_parameter("Target Speed", params.speed.into()); + player.set_input_parameter("target_speed", params.speed.into()); } diff --git a/examples/human_ik/examples/human_ik.rs b/examples/human_ik/examples/human_ik.rs index 1073e43..d026889 100644 --- a/examples/human_ik/examples/human_ik.rs +++ b/examples/human_ik/examples/human_ik.rs @@ -141,6 +141,6 @@ fn keyboard_animation_control( (Quat::from_rotation_y(-1. * time.delta_secs()) * params.direction).normalize(); } - player.set_input_parameter("Target Speed", params.speed.into()); - player.set_input_parameter("Target Direction", params.direction.into()); + player.set_input_parameter("target_speed", params.speed.into()); + player.set_input_parameter("target_direction", params.direction.into()); }