diff --git a/.idea/rg3d-core.iml b/.idea/rg3d-core.iml
index a9ad7420a..19864a77b 100644
--- a/.idea/rg3d-core.iml
+++ b/.idea/rg3d-core.iml
@@ -31,6 +31,7 @@
+
diff --git a/Cargo.toml b/Cargo.toml
index c689867bb..f71adce6a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -23,6 +23,7 @@ members = [
"fyrox-ui",
"fyrox-resource",
"fyrox-scripts",
+ "fyrox-animation",
"editor",
"editor-standalone",
"template"
@@ -41,6 +42,7 @@ fyrox-core = { path = "fyrox-core", version = "0.26.0", features = ["serde"] }
fyrox-sound = { path = "fyrox-sound", version = "0.33.0" }
fyrox-ui = { path = "fyrox-ui", version = "0.23.0" }
fyrox-resource = { path = "fyrox-resource", version = "0.10.0" }
+fyrox-animation = { path = "fyrox-animation", version = "0.1.0" }
rapier2d = { version = "0.17", features = ["debug-render"] }
rapier3d = { version = "0.17", features = ["debug-render"] }
image = { version = "0.24.3", default-features = false, features = ["gif", "jpeg", "png", "tga", "tiff", "bmp"] }
@@ -58,7 +60,6 @@ fxhash = "0.2.1"
strum = "0.25.0"
strum_macros = "0.25.0"
clap = { version = "4", features = ["derive"] }
-spade = "2.1.0"
winit = { version = "0.29.2", features = ["serde"] }
half = "2.2.1"
fast_image_resize = "2.7.0"
diff --git a/editor/src/absm/blendspace.rs b/editor/src/absm/blendspace.rs
index 7373a7e1a..726bcaa3e 100644
--- a/editor/src/absm/blendspace.rs
+++ b/editor/src/absm/blendspace.rs
@@ -11,6 +11,7 @@ use crate::{
send_sync_message,
};
use fyrox::core::uuid_provider;
+use fyrox::scene::node::Node;
use fyrox::{
animation::machine::{
node::blendspace::BlendSpacePoint, Machine, MachineLayer, Parameter, ParameterContainer,
@@ -811,7 +812,7 @@ impl BlendSpaceEditor {
pub fn sync_to_model(
&mut self,
parameters: &ParameterContainer,
- layer: &MachineLayer,
+ layer: &MachineLayer>,
selection: &AbsmSelection,
ui: &mut UserInterface,
) {
@@ -893,7 +894,7 @@ impl BlendSpaceEditor {
selection: &AbsmSelection,
message: &UiMessage,
sender: &MessageSender,
- machine: &mut Machine,
+ machine: &mut Machine>,
is_preview_mode_active: bool,
) {
if let Some(SelectedEntity::PoseNode(first)) = selection.entities.first() {
diff --git a/editor/src/absm/command/blend.rs b/editor/src/absm/command/blend.rs
index 5033432e9..ad89d1b4c 100644
--- a/editor/src/absm/command/blend.rs
+++ b/editor/src/absm/command/blend.rs
@@ -13,7 +13,7 @@ use fyrox::{
scene::node::Node,
};
-define_push_element_to_collection_command!(AddInputCommand, IndexedBlendInput>(self, context) {
+define_push_element_to_collection_command!(AddInputCommand>>, IndexedBlendInput>>(self, context) {
let machine = fetch_machine(context, self.node_handle);
match &mut machine.layers_mut()[self.layer_index].nodes_mut()[self.handle] {
PoseNode::BlendAnimationsByIndex(definition) => &mut definition.inputs,
@@ -21,7 +21,7 @@ define_push_element_to_collection_command!(AddInputCommand, Ind
}
});
-define_push_element_to_collection_command!(AddPoseSourceCommand, BlendPose>(self, context) {
+define_push_element_to_collection_command!(AddPoseSourceCommand>>, BlendPose>>(self, context) {
let machine = fetch_machine(context, self.node_handle);
match &mut machine.layers_mut()[self.layer_index].nodes_mut()[self.handle] {
PoseNode::BlendAnimations(definition) => &mut definition.pose_sources,
@@ -29,7 +29,7 @@ define_push_element_to_collection_command!(AddPoseSourceCommand
}
});
-define_push_element_to_collection_command!(AddBlendSpacePointCommand, BlendSpacePoint>(self, context) {
+define_push_element_to_collection_command!(AddBlendSpacePointCommand>>, BlendSpacePoint>>(self, context) {
let machine = fetch_machine(context, self.node_handle);
match &mut machine.layers_mut()[self.layer_index].nodes_mut()[self.handle] {
PoseNode::BlendSpace(definition) => definition.points_mut(),
@@ -38,7 +38,7 @@ define_push_element_to_collection_command!(AddBlendSpacePointCommand, Handle>(self, context) {
+ SetBlendAnimationByIndexInputPoseSourceCommand>>, Handle>>>(self, context) {
let machine = fetch_machine(context, self.node_handle);
if let PoseNode::BlendAnimationsByIndex(ref mut definition) = machine.layers_mut()[self.layer_index].nodes_mut()[self.handle] {
std::mem::swap(&mut definition.inputs[self.index].pose_source, &mut self.value)
@@ -47,7 +47,7 @@ define_set_collection_element_command!(
);
define_set_collection_element_command!(
- SetBlendAnimationsPoseSourceCommand, Handle>(self, context) {
+ SetBlendAnimationsPoseSourceCommand>>, Handle>>>(self, context) {
let machine = fetch_machine(context, self.node_handle);
if let PoseNode::BlendAnimations(ref mut definition) = machine.layers_mut()[self.layer_index].nodes_mut()[self.handle] {
std::mem::swap(&mut definition.pose_sources[self.index].pose_source, &mut self.value);
@@ -56,7 +56,7 @@ define_set_collection_element_command!(
);
define_set_collection_element_command!(
- SetBlendSpacePoseSourceCommand, Handle>(self, context) {
+ SetBlendSpacePoseSourceCommand>>, Handle>>>(self, context) {
let machine = fetch_machine(context, self.node_handle);
if let PoseNode::BlendSpace(ref mut definition) = machine.layers_mut()[self.layer_index].nodes_mut()[self.handle] {
std::mem::swap( &mut definition.points_mut()[self.index].pose_source, &mut self.value);
@@ -65,7 +65,7 @@ define_set_collection_element_command!(
);
define_set_collection_element_command!(
- SetBlendSpacePointPositionCommand, Vector2>(self, context) {
+ SetBlendSpacePointPositionCommand>>, Vector2>(self, context) {
let machine = fetch_machine(context, self.node_handle);
if let PoseNode::BlendSpace(ref mut definition) = machine.layers_mut()[self.layer_index].nodes_mut()[self.handle] {
std::mem::swap( &mut definition.points_mut()[self.index].position, &mut self.value);
@@ -78,9 +78,9 @@ define_set_collection_element_command!(
pub struct RemoveBlendSpacePointCommand {
pub scene_node_handle: Handle,
pub layer_index: usize,
- pub node_handle: Handle,
+ pub node_handle: Handle>>,
pub point_index: usize,
- pub point: Option,
+ pub point: Option>>,
}
impl GameSceneCommandTrait for RemoveBlendSpacePointCommand {
diff --git a/editor/src/absm/command/mod.rs b/editor/src/absm/command/mod.rs
index 5fc1b1922..9d2c77a39 100644
--- a/editor/src/absm/command/mod.rs
+++ b/editor/src/absm/command/mod.rs
@@ -126,7 +126,11 @@ macro_rules! define_spawn_command {
};
}
-define_spawn_command!(AddTransitionCommand, Transition, transitions_mut);
+define_spawn_command!(
+ AddTransitionCommand,
+ Transition>,
+ transitions_mut
+);
#[derive(Debug)]
pub enum AddStateCommand {
@@ -134,24 +138,24 @@ pub enum AddStateCommand {
NonExecuted {
node_handle: Handle,
layer_index: usize,
- state: State,
+ state: State>,
},
Executed {
node_handle: Handle,
layer_index: usize,
- handle: Handle,
- prev_entry_state: Handle,
+ handle: Handle>>,
+ prev_entry_state: Handle>>,
},
Reverted {
node_handle: Handle,
layer_index: usize,
- ticket: Ticket,
- state: State,
+ ticket: Ticket>>,
+ state: State>,
},
}
impl AddStateCommand {
- pub fn new(node_handle: Handle, layer_index: usize, state: State) -> Self {
+ pub fn new(node_handle: Handle, layer_index: usize, state: State>) -> Self {
Self::NonExecuted {
node_handle,
layer_index,
@@ -163,7 +167,7 @@ impl AddStateCommand {
fn fetch_machine<'a>(
context: &'a mut GameSceneContext,
node_handle: Handle,
-) -> &'a mut Machine {
+) -> &'a mut Machine> {
context.scene.graph[node_handle]
.query_component_mut::()
.unwrap()
@@ -279,24 +283,28 @@ pub enum AddPoseNodeCommand {
NonExecuted {
node_handle: Handle,
layer_index: usize,
- node: PoseNode,
+ node: PoseNode>,
},
Executed {
node_handle: Handle,
layer_index: usize,
- handle: Handle,
- prev_root_node: Handle,
+ handle: Handle>>,
+ prev_root_node: Handle>>,
},
Reverted {
node_handle: Handle,
layer_index: usize,
- ticket: Ticket,
- node: PoseNode,
+ ticket: Ticket>>,
+ node: PoseNode>,
},
}
impl AddPoseNodeCommand {
- pub fn new(node_handle: Handle, layer_index: usize, node: PoseNode) -> Self {
+ pub fn new(
+ node_handle: Handle,
+ layer_index: usize,
+ node: PoseNode>,
+ ) -> Self {
Self::NonExecuted {
node_handle,
layer_index,
@@ -464,8 +472,8 @@ macro_rules! define_move_command {
};
}
-define_move_command!(MoveStateNodeCommand, State, states_mut);
-define_move_command!(MovePoseNodeCommand, PoseNode, nodes_mut);
+define_move_command!(MoveStateNodeCommand, State>, states_mut);
+define_move_command!(MovePoseNodeCommand, PoseNode>, nodes_mut);
macro_rules! define_free_command {
($name:ident, $ent_type:ty, $container:ident) => {
@@ -578,9 +586,13 @@ macro_rules! define_free_command {
};
}
-define_free_command!(DeleteStateCommand, State, states_mut);
-define_free_command!(DeletePoseNodeCommand, PoseNode, nodes_mut);
-define_free_command!(DeleteTransitionCommand, Transition, transitions_mut);
+define_free_command!(DeleteStateCommand, State>, states_mut);
+define_free_command!(DeletePoseNodeCommand, PoseNode>, nodes_mut);
+define_free_command!(
+ DeleteTransitionCommand,
+ Transition>,
+ transitions_mut
+);
#[macro_export]
macro_rules! define_push_element_to_collection_command {
@@ -700,7 +712,7 @@ macro_rules! define_set_collection_element_command {
pub struct SetMachineEntryStateCommand {
pub node_handle: Handle,
pub layer: usize,
- pub entry: Handle,
+ pub entry: Handle>>,
}
impl SetMachineEntryStateCommand {
@@ -765,7 +777,7 @@ macro_rules! define_absm_swap_command {
};
}
-define_absm_swap_command!(SetStateRootPoseCommand, Handle>[layer_index: usize](self, context) {
+define_absm_swap_command!(SetStateRootPoseCommand>>, Handle>>>[layer_index: usize](self, context) {
let machine = fetch_machine(context, self.node_handle);
&mut machine.layers_mut()[self.layer_index].states_mut()[self.handle].root
});
@@ -804,7 +816,7 @@ impl GameSceneCommandTrait for SetLayerNameCommand {
#[derive(Debug)]
pub struct AddLayerCommand {
pub absm_node_handle: Handle,
- pub layer: Option,
+ pub layer: Option>>,
}
impl GameSceneCommandTrait for AddLayerCommand {
@@ -825,7 +837,7 @@ impl GameSceneCommandTrait for AddLayerCommand {
pub struct RemoveLayerCommand {
pub absm_node_handle: Handle,
pub layer_index: usize,
- pub layer: Option,
+ pub layer: Option>>,
}
impl RemoveLayerCommand {
@@ -858,7 +870,7 @@ impl GameSceneCommandTrait for RemoveLayerCommand {
pub struct SetLayerMaskCommand {
pub absm_node_handle: Handle,
pub layer_index: usize,
- pub mask: LayerMask,
+ pub mask: LayerMask>,
}
impl SetLayerMaskCommand {
diff --git a/editor/src/absm/command/pose.rs b/editor/src/absm/command/pose.rs
index 44e136424..d5ad0d434 100644
--- a/editor/src/absm/command/pose.rs
+++ b/editor/src/absm/command/pose.rs
@@ -15,7 +15,7 @@ define_universal_commands! {
GameSceneCommandTrait,
GameSceneCommand,
GameSceneContext,
- Handle,
+ Handle>>,
ctx,
handle,
self,
diff --git a/editor/src/absm/command/state.rs b/editor/src/absm/command/state.rs
index b233ef35e..6162f4459 100644
--- a/editor/src/absm/command/state.rs
+++ b/editor/src/absm/command/state.rs
@@ -15,7 +15,7 @@ define_universal_commands!(
GameSceneCommandTrait,
GameSceneCommand,
GameSceneContext,
- Handle,
+ Handle>>,
ctx,
handle,
self,
diff --git a/editor/src/absm/command/transition.rs b/editor/src/absm/command/transition.rs
index bba55e217..a3cc07937 100644
--- a/editor/src/absm/command/transition.rs
+++ b/editor/src/absm/command/transition.rs
@@ -15,7 +15,7 @@ define_universal_commands!(
GameSceneCommandTrait,
GameSceneCommand,
GameSceneContext,
- Handle,
+ Handle>>,
ctx,
handle,
self,
diff --git a/editor/src/absm/mod.rs b/editor/src/absm/mod.rs
index 9ffed0d86..e2b867074 100644
--- a/editor/src/absm/mod.rs
+++ b/editor/src/absm/mod.rs
@@ -59,7 +59,7 @@ const NORMAL_ROOT_COLOR: Color = Color::opaque(40, 80, 0);
const SELECTED_ROOT_COLOR: Color = Color::opaque(60, 100, 0);
struct PreviewModeData {
- machine: Machine,
+ machine: Machine>,
nodes: Vec<(Handle, Node)>,
}
@@ -175,7 +175,7 @@ impl AbsmEditor {
fn enter_preview_mode(
&mut self,
- machine: Machine,
+ machine: Machine>,
animation_targets: FxHashSet>,
scene: &Scene,
ui: &UserInterface,
@@ -525,7 +525,7 @@ impl AbsmEditor {
AbsmNodeMessage::Enter => {
if let Some(node) = ui
.node(message.destination())
- .query_component::>()
+ .query_component::>>>()
{
if let Some(layer_index) = selection.layer {
self.state_viewer.set_state(
@@ -541,7 +541,7 @@ impl AbsmEditor {
AbsmNodeMessage::Edit => {
if let Some(node) = ui
.node(message.destination())
- .query_component::>()
+ .query_component::>>>()
{
if let Some(layer_index) = selection.layer {
let model_ref = &absm_node.machine().layers()[layer_index].nodes()
@@ -556,7 +556,7 @@ impl AbsmEditor {
AbsmNodeMessage::AddInput => {
if let Some(node) = ui
.node(message.destination())
- .query_component::>()
+ .query_component::>>>()
{
if let Some(layer_index) = selection.layer {
let model_ref = &absm_node.machine().layers()[layer_index].nodes()
diff --git a/editor/src/absm/selection.rs b/editor/src/absm/selection.rs
index fbe4712a5..58fe60426 100644
--- a/editor/src/absm/selection.rs
+++ b/editor/src/absm/selection.rs
@@ -6,9 +6,9 @@ use fyrox::{
#[derive(PartialEq, Eq, Debug, Clone)]
pub enum SelectedEntity {
- Transition(Handle),
- State(Handle),
- PoseNode(Handle),
+ Transition(Handle>>),
+ State(Handle>>),
+ PoseNode(Handle>>),
}
#[derive(Debug, Clone, PartialEq, Eq, Default)]
diff --git a/editor/src/absm/socket.rs b/editor/src/absm/socket.rs
index 2a72a2ec2..d96becb15 100644
--- a/editor/src/absm/socket.rs
+++ b/editor/src/absm/socket.rs
@@ -1,4 +1,5 @@
use fyrox::core::uuid_provider;
+use fyrox::scene::node::Node;
use fyrox::{
animation::machine::PoseNode,
core::{algebra::Vector2, color::Color, pool::Handle},
@@ -44,7 +45,7 @@ pub enum SocketDirection {
pub struct Socket {
widget: Widget,
click_position: Option>,
- pub parent_node: Handle,
+ pub parent_node: Handle>>,
pub direction: SocketDirection,
#[allow(dead_code)] // TODO
editor: Handle,
@@ -124,7 +125,7 @@ impl Control for Socket {
pub struct SocketBuilder {
widget_builder: WidgetBuilder,
- parent_node: Handle,
+ parent_node: Handle>>,
direction: SocketDirection,
editor: Handle,
index: usize,
@@ -143,7 +144,7 @@ impl SocketBuilder {
}
}
- pub fn with_parent_node(mut self, parent_node: Handle) -> Self {
+ pub fn with_parent_node(mut self, parent_node: Handle>>) -> Self {
self.parent_node = parent_node;
self
}
diff --git a/editor/src/absm/state_graph/context.rs b/editor/src/absm/state_graph/context.rs
index 30a4a3389..8b00a1e8d 100644
--- a/editor/src/absm/state_graph/context.rs
+++ b/editor/src/absm/state_graph/context.rs
@@ -277,7 +277,7 @@ impl NodeContextMenu {
layer: layer_index,
entry: ui
.node(self.placement_target)
- .query_component::>()
+ .query_component::>>>()
.unwrap()
.model_handle,
});
@@ -296,7 +296,7 @@ impl NodeContextMenu {
.children()
.iter()
.cloned()
- .filter(|c| ui.node(*c).has_component::>())
+ .filter(|c| ui.node(*c).has_component::>>>())
.collect::>();
ui.send_message(AbsmCanvasMessage::commit_transition_to_all_nodes(
self.canvas,
diff --git a/editor/src/absm/state_graph/mod.rs b/editor/src/absm/state_graph/mod.rs
index 944b0a0a1..5a6f28504 100644
--- a/editor/src/absm/state_graph/mod.rs
+++ b/editor/src/absm/state_graph/mod.rs
@@ -41,9 +41,12 @@ pub struct StateGraphViewer {
last_selection: AbsmSelection,
}
-fn fetch_state_node_model_handle(handle: Handle, ui: &UserInterface) -> Handle {
+fn fetch_state_node_model_handle(
+ handle: Handle,
+ ui: &UserInterface,
+) -> Handle>> {
ui.node(handle)
- .query_component::>()
+ .query_component::>>>()
.unwrap()
.model_handle
}
@@ -93,7 +96,11 @@ impl StateGraphViewer {
}
}
- pub fn activate_transition(&self, ui: &UserInterface, transition: Handle) {
+ pub fn activate_transition(
+ &self,
+ ui: &UserInterface,
+ transition: Handle>>,
+ ) {
if let Some(view_handle) = ui.node(self.canvas).children().iter().cloned().find(|c| {
ui.node(*c)
.query_component::()
@@ -108,7 +115,7 @@ impl StateGraphViewer {
}
}
- pub fn activate_state(&self, ui: &UserInterface, state: Handle) {
+ pub fn activate_state(&self, ui: &UserInterface, state: Handle>>) {
for (state_view_handle, state_view_ref) in ui
.node(self.canvas)
.children()
@@ -116,7 +123,7 @@ impl StateGraphViewer {
.cloned()
.filter_map(|c| {
ui.node(c)
- .query_component::>()
+ .query_component::>>>()
.map(|state_view_ref| (c, state_view_ref))
})
{
@@ -184,8 +191,8 @@ impl StateGraphViewer {
.filter_map(|n| {
let node_ref = ui.node(*n);
- if let Some(state_node) =
- node_ref.query_component::>()
+ if let Some(state_node) = node_ref
+ .query_component::>>>()
{
Some(SelectedEntity::State(state_node.model_handle))
} else {
@@ -263,7 +270,7 @@ impl StateGraphViewer {
pub fn sync_to_model(
&mut self,
- machine_layer: &MachineLayer,
+ machine_layer: &MachineLayer>,
ui: &mut UserInterface,
editor_selection: &Selection,
) {
@@ -287,7 +294,7 @@ impl StateGraphViewer {
.children()
.iter()
.cloned()
- .filter(|c| ui.node(*c).has_component::>())
+ .filter(|c| ui.node(*c).has_component::>>>())
.collect::>();
transitions = canvas
@@ -307,7 +314,7 @@ impl StateGraphViewer {
for (state_handle, state) in machine_layer.states().pair_iter() {
if states.iter().all(|state_view| {
ui.node(*state_view)
- .query_component::>()
+ .query_component::>>>()
.unwrap()
.model_handle
!= state_handle
@@ -351,7 +358,7 @@ impl StateGraphViewer {
(
state_view,
ui.node(state_view)
- .query_component::>()
+ .query_component::>>>()
.unwrap()
.model_handle,
)
@@ -381,7 +388,7 @@ impl StateGraphViewer {
for state in states.iter() {
let state_node = ui
.node(*state)
- .query_component::>()
+ .query_component::>>>()
.unwrap();
let state_model_handle = state_node.model_handle;
let state_model_ref = &machine_layer.states()[state_node.model_handle];
@@ -451,7 +458,7 @@ impl StateGraphViewer {
!= transition_handle
}) {
fn find_state_view(
- state_handle: Handle,
+ state_handle: Handle>>,
states: &[Handle],
ui: &UserInterface,
) -> Handle {
@@ -459,7 +466,7 @@ impl StateGraphViewer {
.iter()
.find(|s| {
ui.node(**s)
- .query_component::>()
+ .query_component::>>>()
.unwrap()
.model_handle
== state_handle
@@ -547,7 +554,7 @@ impl StateGraphViewer {
}),
SelectedEntity::State(state) => states.iter().cloned().find(|s| {
ui.node(*s)
- .query_component::>()
+ .query_component::>>>()
.unwrap()
.model_handle
== *state
diff --git a/editor/src/absm/state_viewer/context.rs b/editor/src/absm/state_viewer/context.rs
index 09dc0bbf0..78ff95e12 100644
--- a/editor/src/absm/state_viewer/context.rs
+++ b/editor/src/absm/state_viewer/context.rs
@@ -99,7 +99,7 @@ impl CanvasContextMenu {
&mut self,
sender: &MessageSender,
message: &UiMessage,
- current_state: Handle,
+ current_state: Handle>>,
ui: &mut UserInterface,
absm_node_handle: Handle,
layer_index: usize,
@@ -221,7 +221,7 @@ impl NodeContextMenu {
pub fn handle_ui_message(
&mut self,
message: &UiMessage,
- machine_layer: &MachineLayer,
+ machine_layer: &MachineLayer>,
sender: &MessageSender,
ui: &UserInterface,
editor_selection: &Selection,
@@ -256,7 +256,7 @@ impl NodeContextMenu {
} else if message.destination() == self.set_as_root {
let root = ui
.node(self.placement_target)
- .query_component::>()
+ .query_component::>>>()
.unwrap()
.model_handle;
@@ -307,7 +307,7 @@ impl ConnectionContextMenu {
message: &UiMessage,
ui: &mut UserInterface,
sender: &MessageSender,
- machine_layer: &MachineLayer,
+ machine_layer: &MachineLayer>,
absm_node_handle: Handle,
layer_index: usize,
) {
@@ -320,7 +320,7 @@ impl ConnectionContextMenu {
let dest_node_ref = ui
.node(connection_ref.dest_node)
- .query_component::>()
+ .query_component::>>>()
.unwrap();
let index = dest_node_ref
diff --git a/editor/src/absm/state_viewer/mod.rs b/editor/src/absm/state_viewer/mod.rs
index 743bcfbfc..d8694b19d 100644
--- a/editor/src/absm/state_viewer/mod.rs
+++ b/editor/src/absm/state_viewer/mod.rs
@@ -49,7 +49,7 @@ mod context;
pub struct StateViewer {
pub window: Handle,
canvas: Handle,
- state: Handle,
+ state: Handle>>,
canvas_context_menu: CanvasContextMenu,
node_context_menu: NodeContextMenu,
connection_context_menu: ConnectionContextMenu,
@@ -60,7 +60,7 @@ fn create_socket(
direction: SocketDirection,
index: usize,
show_index: bool,
- parent_node: Handle,
+ parent_node: Handle>>,
ui: &mut UserInterface,
) -> Handle {
SocketBuilder::new(WidgetBuilder::new().with_margin(Thickness::uniform(2.0)))
@@ -74,7 +74,7 @@ fn create_socket(
fn create_sockets(
count: usize,
direction: SocketDirection,
- parent_node: Handle,
+ parent_node: Handle>>,
ui: &mut UserInterface,
) -> Vec> {
(0..count)
@@ -82,9 +82,12 @@ fn create_sockets(
.collect::>()
}
-fn fetch_pose_node_model_handle(handle: Handle, ui: &UserInterface) -> Handle {
+fn fetch_pose_node_model_handle(
+ handle: Handle,
+ ui: &UserInterface,
+) -> Handle>> {
ui.node(handle)
- .query_component::>()
+ .query_component::>>>()
.unwrap()
.model_handle
}
@@ -92,7 +95,7 @@ fn fetch_pose_node_model_handle(handle: Handle, ui: &UserInterface) -> H
fn fetch_socket_pose_node_model_handle(
handle: Handle,
ui: &UserInterface,
-) -> Handle {
+) -> Handle>> {
ui.node(handle)
.query_component::()
.unwrap()
@@ -102,7 +105,7 @@ fn fetch_socket_pose_node_model_handle(
fn make_play_animation_name(
graph: &Graph,
absm_node: &AnimationBlendingStateMachine,
- animation: Handle,
+ animation: Handle>>,
) -> String {
if let Some(animation) = graph
.try_get_of_type::(absm_node.animation_player())
@@ -115,7 +118,7 @@ fn make_play_animation_name(
}
fn make_pose_node_name(
- model_ref: &PoseNode,
+ model_ref: &PoseNode>,
graph: &Graph,
absm_node: &AnimationBlendingStateMachine,
) -> String {
@@ -177,7 +180,7 @@ impl StateViewer {
pub fn set_state(
&mut self,
- state: Handle,
+ state: Handle>>,
absm_node: &AnimationBlendingStateMachine,
layer_index: usize,
ui: &UserInterface,
@@ -280,7 +283,7 @@ impl StateViewer {
.filter_map(|n| {
let node_ref = ui.node(*n);
- node_ref.query_component::>().map(
+ node_ref.query_component::>>>().map(
|state_node| {
SelectedEntity::PoseNode(
state_node.model_handle,
@@ -380,7 +383,7 @@ impl StateViewer {
pub fn sync_to_model(
&mut self,
ui: &mut UserInterface,
- machine_layer: &MachineLayer,
+ machine_layer: &MachineLayer>,
editor_selection: &Selection,
absm_node: &AnimationBlendingStateMachine,
graph: &Graph,
@@ -401,7 +404,9 @@ impl StateViewer {
.iter()
.cloned()
.filter(|h| {
- if let Some(pose_node) = ui.node(*h).query_component::>()
+ if let Some(pose_node) = ui
+ .node(*h)
+ .query_component::>>>()
{
if machine_layer
.nodes()
@@ -444,7 +449,7 @@ impl StateViewer {
for &pose_definition in models.iter() {
if views.iter().all(|v| {
ui.node(*v)
- .query_component::>()
+ .query_component::>>>()
.unwrap()
.model_handle
!= pose_definition
@@ -527,7 +532,7 @@ impl StateViewer {
for &view in views.clone().iter() {
let view_ref = ui
.node(view)
- .query_component::>()
+ .query_component::>>>()
.unwrap();
if machine_layer
@@ -553,7 +558,7 @@ impl StateViewer {
for &view in &views {
let view_ref = ui
.node(view)
- .query_component::>()
+ .query_component::>>>()
.unwrap();
let model_handle = view_ref.model_handle;
let model_ref = &machine_layer.nodes()[model_handle];
@@ -640,7 +645,10 @@ impl StateViewer {
for model in models.iter().cloned() {
let dest_ref = views
.iter()
- .filter_map(|v| ui.node(*v).query_component::>())
+ .filter_map(|v| {
+ ui.node(*v)
+ .query_component::>>>()
+ })
.find(|v| v.model_handle == model)
.unwrap();
let dest_handle = dest_ref.handle();
@@ -654,7 +662,10 @@ impl StateViewer {
if machine_layer.nodes().is_valid_handle(child) {
let source = views
.iter()
- .filter_map(|v| ui.node(*v).query_component::>())
+ .filter_map(|v| {
+ ui.node(*v)
+ .query_component::>>>()
+ })
.find(|v| v.model_handle == child)
.unwrap();
@@ -695,7 +706,7 @@ impl StateViewer {
}
SelectedEntity::PoseNode(pose_node) => views.iter().cloned().find(|s| {
ui.node(*s)
- .query_component::>()
+ .query_component::>>>()
.unwrap()
.model_handle
== *pose_node
diff --git a/editor/src/absm/toolbar.rs b/editor/src/absm/toolbar.rs
index 287eca6eb..c559896ba 100644
--- a/editor/src/absm/toolbar.rs
+++ b/editor/src/absm/toolbar.rs
@@ -1,4 +1,3 @@
-use crate::message::MessageSender;
use crate::{
absm::{
command::{AddLayerCommand, RemoveLayerCommand, SetLayerMaskCommand, SetLayerNameCommand},
@@ -7,6 +6,7 @@ use crate::{
},
gui::make_dropdown_list_option,
load_image,
+ message::MessageSender,
scene::{
commands::{ChangeSelectionCommand, CommandGroup, GameSceneCommand},
selector::{HierarchyNode, NodeSelectorMessage, NodeSelectorWindowBuilder},
@@ -287,7 +287,8 @@ impl Toolbar {
.mask()
.inner()
.iter()
- .map(|h| ErasedHandle::from(*h))
+ .cloned()
+ .map(ErasedHandle::from)
.collect::>();
ui.send_message(NodeSelectorMessage::selection(
diff --git a/editor/src/absm/transition.rs b/editor/src/absm/transition.rs
index e0ecb7b5c..8229e31f5 100644
--- a/editor/src/absm/transition.rs
+++ b/editor/src/absm/transition.rs
@@ -7,6 +7,7 @@ use crate::{
};
use fyrox::animation::machine::Transition;
use fyrox::core::uuid_provider;
+use fyrox::scene::node::Node;
use fyrox::{
core::{algebra::Vector2, color::Color, color::Hsv, math::Rect, pool::Handle},
core::{reflect::prelude::*, visitor::prelude::*},
@@ -46,7 +47,7 @@ impl TransitionMessage {
pub struct TransitionView {
widget: Widget,
pub segment: Segment,
- pub model_handle: Handle,
+ pub model_handle: Handle>>,
selectable: Selectable,
activity_factor: f32,
}
@@ -182,7 +183,11 @@ impl TransitionBuilder {
self
}
- pub fn build(self, model_handle: Handle, ctx: &mut BuildContext) -> Handle {
+ pub fn build(
+ self,
+ model_handle: Handle>>,
+ ctx: &mut BuildContext,
+ ) -> Handle {
let transition = TransitionView {
widget: self
.widget_builder
diff --git a/editor/src/animation/command/mod.rs b/editor/src/animation/command/mod.rs
index 5020682b0..1f7450362 100644
--- a/editor/src/animation/command/mod.rs
+++ b/editor/src/animation/command/mod.rs
@@ -34,12 +34,16 @@ fn fetch_animation_player<'a>(
#[derive(Debug)]
pub struct AddTrackCommand {
animation_player: Handle,
- animation: Handle,
- track: Option