Compare commits
No commits in common. "0c53ac8d189a90a6881ac427f1c699afd986bf86" and "462bf4ffc058ce20733c924bd1b5917450920a23" have entirely different histories.
0c53ac8d18
...
462bf4ffc0
@ -14,7 +14,7 @@ namespace ImageProcessingGraph.Editor
|
|||||||
public static IPTPort Create(IEdgeConnectorListener connectorListener, bool isInput, Type type)
|
public static IPTPort Create(IEdgeConnectorListener connectorListener, bool isInput, Type type)
|
||||||
{
|
{
|
||||||
var port = new IPTPort(Orientation.Horizontal, isInput ? Direction.Input : Direction.Output,
|
var port = new IPTPort(Orientation.Horizontal, isInput ? Direction.Input : Direction.Output,
|
||||||
isInput ? Capacity.Single : Capacity.Multi, type)
|
Capacity.Multi, type)
|
||||||
{
|
{
|
||||||
m_EdgeConnector = new EdgeConnector<Edge>(connectorListener),
|
m_EdgeConnector = new EdgeConnector<Edge>(connectorListener),
|
||||||
};
|
};
|
||||||
|
@ -3,9 +3,16 @@ using UnityEngine;
|
|||||||
|
|
||||||
namespace ImageProcessingGraph.Editor
|
namespace ImageProcessingGraph.Editor
|
||||||
{
|
{
|
||||||
|
#if true
|
||||||
|
[CreateAssetMenu(menuName = "PreferenceCreate")]
|
||||||
|
#endif
|
||||||
public class IPT_Preferences : ScriptableObject
|
public class IPT_Preferences : ScriptableObject
|
||||||
{
|
{
|
||||||
public bool debugMode = false;
|
[Header("Grid Settings")]
|
||||||
|
public float thickLines;
|
||||||
|
public float spacing;
|
||||||
|
public Color gridBackgroundColour;
|
||||||
|
public Color lineColour;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ namespace ImageProcessingGraph.Editor
|
|||||||
{
|
{
|
||||||
[SerializeReference] private List<BaseImageNode> nodes;
|
[SerializeReference] private List<BaseImageNode> nodes;
|
||||||
[SerializeField] private List<GraphConnection> connections;
|
[SerializeField] private List<GraphConnection> connections;
|
||||||
[SerializeReference] public List<BaseImageNode> runOrder;
|
[SerializeField] public List<BaseImageNode> runOrder;
|
||||||
[SerializeField] public List<StickyNote> stickyNotes;
|
[SerializeField] public List<StickyNote> stickyNotes;
|
||||||
|
|
||||||
public List<BaseImageNode> Nodes => nodes;
|
public List<BaseImageNode> Nodes => nodes;
|
||||||
|
@ -200,6 +200,7 @@ namespace ImageProcessingGraph.Editor.Unity_Image_Processing.Scripts.Editor.Wind
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
propertyFieldContainer.Add(propertyField);
|
propertyFieldContainer.Add(propertyField);
|
||||||
port.Add(propertyFieldContainer);
|
port.Add(propertyFieldContainer);
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@ namespace ImageProcessingGraph.Editor
|
|||||||
internal ImageProcessingGraphAsset asset;
|
internal ImageProcessingGraphAsset asset;
|
||||||
private SerializedObject serializedObject;
|
private SerializedObject serializedObject;
|
||||||
private ImageProcessingGraphEditorWindow window;
|
private ImageProcessingGraphEditorWindow window;
|
||||||
|
|
||||||
public ImageProcessingGraphEditorWindow Window => window;
|
public ImageProcessingGraphEditorWindow Window => window;
|
||||||
|
|
||||||
public List<ImageProcessingGraphNodeVisual> graphNodes;
|
public List<ImageProcessingGraphNodeVisual> graphNodes;
|
||||||
@ -22,11 +23,6 @@ namespace ImageProcessingGraph.Editor
|
|||||||
|
|
||||||
internal ImageProcessingGraphSearchProvider searchProvider;
|
internal ImageProcessingGraphSearchProvider searchProvider;
|
||||||
internal ImageProcessingGraphEdgeConnectorListener edgeConnectorListener;
|
internal ImageProcessingGraphEdgeConnectorListener edgeConnectorListener;
|
||||||
|
|
||||||
private bool isDropdownEnabled = false;
|
|
||||||
|
|
||||||
private Button debugModeButton;
|
|
||||||
private Button outputRunOrder;
|
|
||||||
|
|
||||||
public ImageProcessingGraphViewWindow(SerializedObject obeject, ImageProcessingGraphEditorWindow window)
|
public ImageProcessingGraphViewWindow(SerializedObject obeject, ImageProcessingGraphEditorWindow window)
|
||||||
{
|
{
|
||||||
@ -54,13 +50,14 @@ namespace ImageProcessingGraph.Editor
|
|||||||
styleSheets.Add(styleSheet);
|
styleSheets.Add(styleSheet);
|
||||||
|
|
||||||
GridBackground background = new GridBackground();
|
GridBackground background = new GridBackground();
|
||||||
|
|
||||||
background.name = "Grid";
|
background.name = "Grid";
|
||||||
|
|
||||||
|
|
||||||
Add(background);
|
Add(background);
|
||||||
|
|
||||||
background.SendToBack();
|
background.SendToBack();
|
||||||
|
|
||||||
CreateButtons();
|
|
||||||
|
|
||||||
|
|
||||||
this.AddManipulator(new ContentDragger());
|
this.AddManipulator(new ContentDragger());
|
||||||
this.AddManipulator(new SelectionDragger());
|
this.AddManipulator(new SelectionDragger());
|
||||||
this.AddManipulator(new RectangleSelector());
|
this.AddManipulator(new RectangleSelector());
|
||||||
@ -73,108 +70,7 @@ namespace ImageProcessingGraph.Editor
|
|||||||
graphViewChanged += OnGraphViewChanged;
|
graphViewChanged += OnGraphViewChanged;
|
||||||
Undo.undoRedoEvent += UndoEvent;
|
Undo.undoRedoEvent += UndoEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CreateButtons()
|
|
||||||
{
|
|
||||||
#region Run Button
|
|
||||||
Button runButton = new Button
|
|
||||||
{
|
|
||||||
text = "Run",
|
|
||||||
style =
|
|
||||||
{
|
|
||||||
width = 100,
|
|
||||||
height = 40,
|
|
||||||
position = Position.Absolute,
|
|
||||||
top = 10,
|
|
||||||
left = 10
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
runButton.clicked += () =>
|
|
||||||
{
|
|
||||||
asset.RunGraph();
|
|
||||||
};
|
|
||||||
|
|
||||||
Add(runButton);
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#if false
|
|
||||||
debugModeButton = new Button
|
|
||||||
{
|
|
||||||
text = "Debug Mode",
|
|
||||||
style =
|
|
||||||
{
|
|
||||||
width = 120,
|
|
||||||
height = 40,
|
|
||||||
position = Position.Absolute,
|
|
||||||
top = 55,
|
|
||||||
right = 10
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
debugModeButton.clicked += () =>
|
|
||||||
{
|
|
||||||
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
outputRunOrder = new Button
|
|
||||||
{
|
|
||||||
text = "Recalculate Run Order",
|
|
||||||
style =
|
|
||||||
{
|
|
||||||
width = 120,
|
|
||||||
height = 40,
|
|
||||||
position = Position.Absolute,
|
|
||||||
top = 55,
|
|
||||||
right = 10,
|
|
||||||
fontSize = 9
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
outputRunOrder.clicked += () =>
|
|
||||||
{
|
|
||||||
asset.runOrder = asset.GetExecutionOrder(asset.Nodes, asset.Connections);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
Button dropdownButton = new Button
|
|
||||||
{
|
|
||||||
text = "Options",
|
|
||||||
style =
|
|
||||||
{
|
|
||||||
width = 120,
|
|
||||||
height = 40,
|
|
||||||
position = Position.Absolute,
|
|
||||||
top = 10,
|
|
||||||
right = 10
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
dropdownButton.clicked+= () =>
|
|
||||||
{
|
|
||||||
if (!isDropdownEnabled)
|
|
||||||
{
|
|
||||||
#if false
|
|
||||||
Add(debugModeButton);
|
|
||||||
#endif
|
|
||||||
Add(outputRunOrder);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
#if false
|
|
||||||
Remove(debugModeButton);
|
|
||||||
#endif
|
|
||||||
Remove(outputRunOrder);
|
|
||||||
}
|
|
||||||
|
|
||||||
isDropdownEnabled = !isDropdownEnabled;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
Add(dropdownButton);
|
|
||||||
}
|
|
||||||
|
|
||||||
private ImageProcessingGraphNodeVisual GetNode(string NodeID)
|
private ImageProcessingGraphNodeVisual GetNode(string NodeID)
|
||||||
{
|
{
|
||||||
ImageProcessingGraphNodeVisual node = null;
|
ImageProcessingGraphNodeVisual node = null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user