Trouble getting all CallableActionNodes in a graph

FlowCanvas Forums Support Trouble getting all CallableActionNodes in a graph

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2199
    paul_blacklab
    Participant

    Hi

    In a C# script I’m trying to get a list of all of the nodes in a graph that are of type CallableActionNode, or derived from it. (This is so we can perform some validation on values in custom node types)

    If I try :

    flowController.graph.GetAllNodesOfType<FlowCanvas.Nodes.CallableActionNode>();

    I get a compiler error:

    The type FlowCanvas.Nodes.CallableActionNode' cannot be used as type parameterT’ in the generic type or method NodeCanvas.Framework.Graph.GetAllNodesOfType<T>()'. There is no implicit reference conversion fromFlowCanvas.Nodes.CallableActionNode’ to `NodeCanvas.Framework.Node’

    Any suggestion on how I could get access to these nodes in script?

    Thanks!

    #2208
    Gavalakis
    Keymaster

    Hey,

    Sorry. I missed your post.
    Due to how SimplexNodes work it’s a bit “harder” to do that than it is with the GetAllNodesOfType method.
    Here is one way of retriving all CallableAction Nodes in the graph:

    I could make some source code changes to make this a bit easier.
    Depending on what you want to achieve, you might also be able to override and use the OnGraphStarted method in your custom node to perform some validations as soon as the graph gets activated.

    Let me know if that works for you.
    Thanks.

    Join us on Discord: https://discord.gg/97q2Rjh

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.