McManning / McManning/BlueGraph

Open graph loses connections after reload

Open
#62 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
256
Forks
36
PR merge metrics
No merged PRs in 30d

Description

I love BlueGraph for its simplicity and ease of use but still being customisable. An issue I have with it in Unity 2023 is that if a graph is open and I make a code change the connections of the graph get dropped with an error to the log. This is in the CanvasView 'rebuild' of node, port and connection views.

Error:
Could not connect Journal Page:ExecIn: Connected node no longer exists. UnityEngine.Debug:LogError (object) BlueGraph.Editor.CanvasView:AddNodeViews (System.Collections.Generic.IEnumerable1<BlueGraph.Node>,bool,bool) (at Assets/Scripts/BlueGraph/Editor/CanvasView.cs:631)

It seems during recompiling the reference to the port in the Connection class is lost but never reestablished.

To fix this, in the CanvasView.cs file in the AddNodeViews function add port.UpdateConnections(); around line ~610 just below foreach (var port in node.Key.Ports.Values).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in Assets/Scripts/BlueGraph/Editor/CanvasView.cs, at AddNodeViews around the reported line and the CanvasView rebuild path. Reproduce the issue in Unity 2023 by changing code while a graph is open, then verify that connections survive recompilation and the connected-node error no longer appears in the log.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, unity
Domain
game-dev, tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.