public Link ConvertLogicalNodeToLitegraphLink(LogicalLink logicalLink)
        {
            if (logicalLink == null)
                return null;
            LiteGraph.Link link = new LiteGraph.Link
            {
                origin_id = engine.GetOutputOwner(logicalLink.OutputId).Id,
                target_id = engine.GetInputOwner(logicalLink.InputId).Id,
                origin_slot = GetOutputSlot(logicalLink.OutputId),
                target_slot = GetInputSlot(logicalLink.InputId),
            };

            return link;
        }
 private static void OnLinkDeleteEvent(LogicalLink link)
 {
     NodesEditorAPIController nodesEditorApi = new NodesEditorAPIController();
     LiteGraph.Link liteGraphLink = nodesEditorApi.ConvertLogicalNodeToLitegraphLink(link);
     hub.Clients.All.OnDeleteLinkEvent(liteGraphLink);
 }
Пример #3
0
        public void AddLink(Output output, Input input)
        {
            LogicalNode inputNode = GetInputOwner(input);
            LogicalNode outputNode = GetOutputOwner(output);
            DebugEngine($"New link from {outputNode.GetType().Name} to {inputNode.GetType().Name}");

            LogicalLink link = new LogicalLink(output.Id, input.Id);
            links.Add(link);

            OnNewLinkEvent?.Invoke(link);

            if (!started)
                return;

            input.Value = output.Value;
        }