Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Commit

Permalink
Added output blocking
Browse files Browse the repository at this point in the history
It is now possible to block connections from calculating. In a tree model this enables to calculate only specific branches which are needed.
Attention: If these branches interreference each other, the calculation might be blocked at the node where a blocked branch meets a calculated branch - currently, this will simply stop calculating after a thousand tries!
  • Loading branch information
Seneral committed May 7, 2016
1 parent cc44390 commit a05493e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Node_Editor/Framework/NodeEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,11 @@ private static bool ContinueCalculation (Node node)
for (int outCnt = 0; outCnt < node.Outputs.Count; outCnt++)
{
NodeOutput output = node.Outputs [outCnt];
for (int conCnt = 0; conCnt < output.connections.Count; conCnt++)
ContinueCalculation (output.connections [conCnt].body);
if (!output.calculationBlockade)
{
for (int conCnt = 0; conCnt < output.connections.Count; conCnt++)
ContinueCalculation (output.connections [conCnt].body);
}
}
}
else if (calculationCount >= 1000)
Expand Down
2 changes: 2 additions & 0 deletions Node_Editor/Framework/NodeOutput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public class NodeOutput : NodeKnob
[System.NonSerialized]
private object value = null;

public bool calculationBlockade = false;

#region General

/// <summary>
Expand Down

0 comments on commit a05493e

Please sign in to comment.