Page 1 of 1

Flownode Access AND AnimationSequence in C#

Posted: Wed Mar 07, 2018 4:44 pm
by bowlmaster
Can we access or start a designed Flowgraph in Editor from C# in CE 5.4?
And how can I play an Animation Sequence designed in TrackView in C# ?
Please help!

Re: Flownode Access AND AnimationSequence in C#

Posted: Thu Mar 08, 2018 5:36 pm
by cry-miron
Flowgraph isn't completely exposed yet to C#, but what you can try is starting UI Actions from C# instead of the normal Flowgraph actions. For example to start a UI Action called "MyAction" you could use the following code:

Code: Select all

IUIAction action = Global.gEnv.pFlashUI.GetUIAction("MyAction");
Global.gEnv.pFlashUI.GetUIActionManager().EnableAction(action, true);
var arguments = new SUIArguments();
Global.gEnv.pFlashUI.GetUIActionManager().StartAction(action, arguments);
Keep in mind that you have to add the following at the top of your file to be able to use these classes.

Code: Select all

using CryEngine.Common;

Re: Flownode Access AND AnimationSequence in C#

Posted: Sun Mar 11, 2018 8:34 pm
by bowlmaster
Thank you cry-miron!
You can realy access the flowgraph in UI Action like you explain but i went into some problems like switching a camera or the Entity Connection are lost in Flowgraph after reload a level in sandbox.
Also if i start a Level in GameMode starting a UI Action from c# my Screen freeze and i have the mouse cursor on top until i press ESC.
I don't know why these things are happen and so i have maked an deeper search and found out other solutions to access any Flowgraph in C# witch i will explain in my next Post.
Also i have a Solution for playing Animation Sequence in C#!