Compare commits

...

18 Commits
master ... main

Author SHA1 Message Date
Chromium
422dcc6f5b foxed file path 2025-04-28 04:46:57 +01:00
Chromium
dfd4c498e1 Imma bust 2025-04-28 04:17:46 +01:00
Chromium
0614e27cd5 oomphies 2025-04-28 04:16:02 +01:00
Chromium
b4a66d7e26 Update!!!! 2025-04-28 02:26:38 +01:00
Chromium
9c6b5e8d6d Fixed Color node and added single color invert 2025-04-28 00:27:57 +01:00
Chromium
4f348fe66a Various Fixes 2025-04-27 23:39:47 +01:00
Chromium
499d187c96 Made outline around errored node as well as fixed NativeArray on texture import being disposed 2025-04-27 20:05:39 +01:00
Chromium
c24a52bee8 Fixed bug when moving a connection 2025-04-27 02:22:33 +01:00
Chromium
a6e9038da5 Edge Removal Detection 2025-04-27 02:15:04 +01:00
Chromium
0c53ac8d18 Added Run order button and fixed a node connection issue 2025-04-27 01:36:14 +01:00
Chromium
4985cf5748 Added Run button 2025-04-27 00:55:14 +01:00
Chromium
462bf4ffc0 Added Single Channel Node and Get Dimensions
As well as various bug fixes
2025-04-26 23:26:24 +01:00
Chromium
deb2464537 plz work 2025-04-26 20:40:13 +01:00
Chromium
50dca57d23 FUCK 2025-04-26 20:10:42 +01:00
Chromium
df0cfb3ec4 Fixed README.md 🤓🤓🤓🤓 2025-04-26 20:09:36 +01:00
Chromium
d972a007d2 Merge branch 'master' 2025-04-26 20:06:46 +01:00
08d5b1bb8d Update README.md 2025-04-25 13:15:56 +00:00
c04ca0d8e6 Initial commit 2025-04-25 13:15:42 +00:00
96 changed files with 927 additions and 1356 deletions

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: f6fe8f57402cf44e8bb5f1dffb3be6d8
guid: c221fbc5c38e72643af466921f820588
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -1,11 +1,27 @@
using System;
using System.Reflection;
using UnityEditor.Experimental.GraphView;
using UnityEngine;
using UnityEngine.UIElements;
namespace ImageProcessingGraph.Editor
{
public class IPTPort : Port
{
public FieldInfo fieldInfo;
private VisualElement _exposedPropertyContainer;
public VisualElement ExposedPropertyContainer
{
set
{
_exposedPropertyContainer = value;
}
get
{
return _exposedPropertyContainer;
}
}
protected IPTPort(Orientation portOrientation, Direction portDirection, Capacity portCapacity, Type type) : base(portOrientation, portDirection, portCapacity, type)
{
@ -14,7 +30,7 @@ namespace ImageProcessingGraph.Editor
public static IPTPort Create(IEdgeConnectorListener connectorListener, bool isInput, Type type)
{
var port = new IPTPort(Orientation.Horizontal, isInput ? Direction.Input : Direction.Output,
Capacity.Multi, type)
isInput ? Capacity.Single : Capacity.Multi, type)
{
m_EdgeConnector = new EdgeConnector<Edge>(connectorListener),
};

View File

@ -0,0 +1,11 @@
using UnityEngine;
namespace ImageProcessingGraph.Editor
{
public class IPT_Preferences : ScriptableObject
{
public bool debugMode = false;
}
}

View File

@ -1,9 +1,12 @@
using System;
using System.IO;
using Unity.Collections;
using UnityEngine;
/// <summary>
/// A structure that holds image pixel data and its dimensions.
/// </summary>
[Serializable]
public struct ImageData
{
/// <summary>
@ -36,7 +39,7 @@ public struct ImageData
/// <param name="sourceTexture">The source texture to extract pixel data from.</param>
public ImageData(Texture2D sourceTexture)
{
PixelData = sourceTexture.GetPixelData<Color32>(0);
PixelData = new NativeArray<Color32>(sourceTexture.GetPixelData<Color32>(0), Allocator.Persistent);
Dimensions = (sourceTexture.width, sourceTexture.height);
isRGBA = sourceTexture.format == TextureFormat.RGBA32;
}
@ -62,4 +65,15 @@ public struct ImageData
texture.Apply();
return texture;
}
public void ExportPNG(string path)
{
Texture2D texture = this.ToTexture2D();
byte[] data = texture.EncodeToPNG();
if (data != null)
{
System.IO.File.WriteAllBytes(path, data);
}
}
}

View File

@ -16,11 +16,16 @@ namespace ImageProcessingGraph.Editor
{
[SerializeReference] private List<BaseImageNode> nodes;
[SerializeField] private List<GraphConnection> connections;
[SerializeField] public List<BaseImageNode> runOrder;
[SerializeReference] public List<BaseImageNode> runOrder;
[SerializeField] public List<StickyNote> stickyNotes;
public List<BaseImageNode> Nodes => nodes;
public List<GraphConnection> Connections => connections;
public delegate void OnRunEvent();
public event OnRunEvent OnRun;
public OnRunEvent OnRunEnd;
public ImageProcessingGraphAsset()
{
nodes = new List<BaseImageNode>();
@ -42,6 +47,8 @@ namespace ImageProcessingGraph.Editor
public void RunGraph()
{
OnRun?.Invoke();
// Create and start the stopwatch to measure time
Stopwatch stopwatch = new Stopwatch();
stopwatch.Start();
@ -49,9 +56,15 @@ namespace ImageProcessingGraph.Editor
if (runOrder == null)
runOrder = GetExecutionOrder(this.nodes, this.connections);
bool failed = false;
foreach (var VARIABLE in runOrder)
{
VARIABLE.RunNode();
if (!VARIABLE.RunNode())
{
failed = true;
break;
}
}
// Stop the stopwatch after running the nodes
@ -59,6 +72,8 @@ namespace ImageProcessingGraph.Editor
// Log the elapsed time
UnityEngine.Debug.Log($"Graph execution took {stopwatch.ElapsedMilliseconds} milliseconds.");
AssetDatabase.Refresh();
}

View File

@ -26,6 +26,9 @@ namespace ImageProcessingGraph.Editor
public ImageProcessingGraphAsset asset;
public delegate void OnFailed();
public event OnFailed onFailed;
public BaseImageNode()
{
guid = Guid.NewGuid().ToString();
@ -61,7 +64,7 @@ namespace ImageProcessingGraph.Editor
}
if (connection.Equals((default(GraphConnection))))
return;
continue;
// Get the output node from the connection
var outputNode = asset.Nodes.FirstOrDefault(n => n.ID == connection.outputPort.nodeID);
@ -101,10 +104,20 @@ namespace ImageProcessingGraph.Editor
}
public void RunNode()
public bool RunNode()
{
try
{
SetNodeInputs();
this.Process();
return true;
}
catch (Exception e)
{
onFailed?.Invoke();
Debug.LogError(e);
return false;
}
}
public virtual void Process()

View File

@ -1,4 +1,7 @@
namespace ImageProcessingGraph.Editor
using UnityEditor.Experimental.GraphView;
using UnityEngine;
namespace ImageProcessingGraph.Editor
{
[System.Serializable]
public struct GraphConnection
@ -6,16 +9,25 @@
public GraphPort inputPort;
public GraphPort outputPort;
public GraphConnection(GraphPort inputPort, GraphPort outputPort)
[SerializeField] public Edge internalEdge;
public GraphConnection(GraphPort inputPort, GraphPort outputPort, Edge internalEdge)
{
this.inputPort = inputPort;
this.outputPort = outputPort;
this.internalEdge = internalEdge;
}
public GraphConnection(string inputNodeGuid, int inputPortID, string inputNodeType, string outputNodeGuid, int outputPortID, string outputNodeType)
public GraphConnection(string inputNodeGuid, int inputPortID, string inputNodeType, string outputNodeGuid, int outputPortID, string outputNodeType, Edge internalEdge)
{
this.inputPort = new GraphPort(inputNodeGuid, inputPortID, inputNodeType);
this.outputPort = new GraphPort(outputNodeGuid, outputPortID, outputNodeType);
this.internalEdge = internalEdge;
}
public void SetInternalEdge(Edge edge)
{
this.internalEdge = edge;
}
}
@ -26,6 +38,7 @@
public string nodeType;
public int portID;
public GraphPort(string nodeID, int portID, string nodeType)
{
this.nodeID = nodeID;

View File

@ -0,0 +1,23 @@
using System;
using UnityEngine.UIElements;
namespace ImageProcessingGraph.Editor
{
[Serializable]
public class GreyscaleValue
{
public int value = 255;
public GreyscaleValue()
{
}
}
public class GreyscaleField : IntegerField
{
public (int, int) minMax = (0,255);
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 3ab37c25c4884480b8777a62e042a37c
timeCreated: 1745703416

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 22b0f0e553dc85e489979a232505a332
guid: cf47dea8bd47175418a3f462e2ddb060
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: a4036f11a5b3def48b6cf5e8b0654a54
guid: 3d053e80c499447499397a64b22ee639
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@ -1,8 +1,8 @@
fileFormatVersion: 2
guid: d04964bb165ef4820be34fe3f050be61
NativeFormatImporter:
guid: e6bd53786a8dee54790032792e0b03da
folderAsset: yes
DefaultImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,52 @@
using ImageProcessingGraph.Editor.Nodes.NodeAttributes;
using Unity.Burst;
using Unity.Collections;
using Unity.Jobs;
using UnityEngine;
namespace ImageProcessingGraph.Editor.Nodes.Fun_Nodes.Texture
{
[NodeInfoAttribute("Invert Channel", "Adjustments/InvertChannel", true)]
public class ChannelInvertNode : BaseImageNode
{
[NodeAttributes.Input("Input Channel")]
public SplitChannelData inputChannel;
[NodeAttributes.Output("Output Channel")]
public SplitChannelData outputChannel;
public override void Process()
{
NativeArray<byte> input = new NativeArray<byte>(inputChannel.ChannelData, Allocator.Persistent);
NativeArray<byte> output = new NativeArray<byte>(inputChannel.ChannelData.Length, Allocator.Persistent);
InvertChannelJob job = new InvertChannelJob
{
input = input,
output = output
};
job.Run();
byte[] outputArray = output.ToArray();
outputChannel = new SplitChannelData(outputArray, (inputChannel.Width, inputChannel.Height));
}
}
[BurstCompile]
public struct InvertChannelJob : IJob
{
[ReadOnly] public NativeArray<byte> input;
[WriteOnly] public NativeArray<byte> output;
public void Execute()
{
int length = input.Length;
for (int i = 0; i < length; i++)
{
output[i] = (byte)(255 - input[i]);
}
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 51378877ff184d868ef4c507dba15ef9
timeCreated: 1745794420

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6957ba197a1612a4c8f0f588d40e374f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,4 +1,5 @@
using ImageProcessingGraph.Editor.Nodes.NodeAttributes;
using Unity.Burst;
using Unity.Collections;
using Unity.Jobs;
using UnityEngine;
@ -24,7 +25,9 @@ namespace ImageProcessingGraph.Editor.Nodes.Fun_Nodes.Texture
public ImageData inputTexture;
// Job struct for combining RGBA channels
[BurstCompile]
struct RGBACombineJob : IJob
{
public NativeArray<byte> rData;
public NativeArray<byte> gData;

View File

@ -1,4 +1,5 @@
using ImageProcessingGraph.Editor.Nodes.NodeAttributes;
using Unity.Burst;
using Unity.Collections;
using Unity.Jobs;
using UnityEngine;
@ -22,10 +23,10 @@ namespace ImageProcessingGraph.Editor.Nodes.Fun_Nodes.Texture
public override void Process()
{
int length = inputTexture.PixelData.Length;
int length = inputTexture.PixelData.Length;;
// Allocate NativeArrays for the pixel data and the individual RGBA channels
NativeArray<Color32> pixelData = new NativeArray<Color32>(inputTexture.PixelData, Allocator.Persistent);
NativeArray<Color32> pixelData = inputTexture.PixelData;
NativeArray<byte> rChannel = new NativeArray<byte>(length, Allocator.Persistent);
NativeArray<byte> gChannel = new NativeArray<byte>(length, Allocator.Persistent);
NativeArray<byte> bChannel = new NativeArray<byte>(length, Allocator.Persistent);
@ -53,6 +54,7 @@ namespace ImageProcessingGraph.Editor.Nodes.Fun_Nodes.Texture
}
// Job struct for processing the image data
[BurstCompile]
struct RGBAJob : IJob
{
public NativeArray<Color32> pixelData;

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d31e8b213de87c54caaf096620201846
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,27 @@
using ImageProcessingGraph.Editor.Nodes.NodeAttributes;
using Unity.Burst;
using Unity.Collections;
using Unity.Jobs;
using UnityEngine;
namespace ImageProcessingGraph.Editor.Nodes.Fun_Nodes.Texture
{
[NodeInfoAttribute("Get Dimensions", "Dimensions/Get Dimensions", false)]
public class TextureGetDimensions : BaseImageNode
{
[NodeAttributes.Input("")]
public ImageData inputTexture;
[NodeAttributes.Output("Width")]
public int width;
[NodeAttributes.Output("Height")]
public int height;
public override void Process()
{
this.width = inputTexture.Width;
this.height = inputTexture.Height;
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 71e1db2a5bfe4a54a6ce2a99fe4d02fb
timeCreated: 1745699625

View File

@ -0,0 +1,37 @@
using System.ComponentModel.Composition.Primitives;
using ImageProcessingGraph.Editor.Nodes.NodeAttributes;
using Unity.Collections;
using UnityEditor;
using UnityEngine;
namespace ImageProcessingGraph.Editor.Nodes.Output
{
[NodeInfo("Texture Export", "Export/Export Texture", true)]
public class Texture2DOutput : BaseImageNode
{
[NodeAttributes.Input("")] public ImageData inputPixels;
[NodeAttributes.Input("File Name")] public string fileName;
[NodeAttributes.Input("File Path")] public string fileDirectory;
public enum ExportType
{
Texture2D,
PNG
}
[NodeAttributes.Input("Export Type")] public ExportType exportType;
public override void Process()
{
switch (exportType)
{
case ExportType.Texture2D:
AssetDatabase.CreateAsset(inputPixels.ToTexture2D(), $"{fileDirectory}/{fileName}.asset");
break;
case ExportType.PNG:
inputPixels.ExportPNG($"{fileDirectory}/{fileName}.png");
break;
}
}
}
}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 96b583a3bbd8b2c45a5eaa9e0f00d1b2
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: bf8e2895a77954d45864e9f8edae29c3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -6,7 +6,7 @@ using UnityEngine;
namespace ImageProcessingGraph.Editor.Nodes.Import_Nodes
{
[NodeInfo("Texture Import", "Imports/Texture2D", true)]
[NodeInfo("Texture Import", "Imports/Import Texture", true)]
public class Texture2DImport : BaseImageNode
{
[NodeAttributes.Input("")]
@ -23,6 +23,21 @@ namespace ImageProcessingGraph.Editor.Nodes.Import_Nodes
{
if (this.textureImport != null)
{
TextureImporter textureImporter = AssetImporter.GetAtPath(AssetDatabase.GetAssetPath(textureImport)) as TextureImporter;
TextureImporterPlatformSettings texset = textureImporter.GetDefaultPlatformTextureSettings();
texset.format=TextureImporterFormat.RGBA32;
texset.maxTextureSize=16384;
textureImporter.SetPlatformTextureSettings(texset);
TextureImporterSettings settings = new TextureImporterSettings();
textureImporter.ReadTextureSettings(settings);
settings.readable = true;
textureImporter.SetTextureSettings(settings);
EditorUtility.SetDirty(textureImport);
textureImporter.SaveAndReimport();
this.textureOutput = new ImageData(textureImport);
this.fileName = textureImport.name;
this.filePath = Path.GetDirectoryName(AssetDatabase.GetAssetPath(textureImport));

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c524131b4dbc3414ab755a10441b3841
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,61 @@
using ImageProcessingGraph.Editor.Nodes.NodeAttributes;
using Unity.Burst;
using Unity.Collections;
using Unity.Jobs;
using UnityEngine;
namespace ImageProcessingGraph.Editor.Nodes.Types.Image.Utilities
{
public class SingleChannelColor
{
[NodeInfoAttribute("Channel Color", "Utility/Channel Color", false)]
public class SingleColorChannel : BaseImageNode
{
[NodeAttributes.Input("Color")] public GreyscaleValue range;
[NodeAttributes.Input("Width")] public int Width;
[NodeAttributes.Input("Height")] public int Height;
[NodeAttributes.Output("Color")] public SplitChannelData OutputColor;
public override void Process()
{
int pixelCount = Width * Height;
NativeArray<byte> outputData = new NativeArray<byte>(pixelCount, Allocator.Persistent);
CreateSingleColorJob job = new CreateSingleColorJob
{
color32 = range.value,
outputData = outputData,
width = Width,
height = Height
};
job.Run();
OutputColor = new SplitChannelData(outputData.ToArray(), (Width, Height));
}
[BurstCompile]
struct CreateSingleColorJob : IJob
{
public int color32;
[WriteOnly]
public NativeArray<byte> outputData;
public int width;
public int height;
public void Execute()
{
// More efficient linear write pattern
for (int i = 0; i < width*height; i++)
{
outputData[i] = (byte)color32;
}
}
}
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: aef9d7bde3d544e6bca5eef8ff58a60e
timeCreated: 1745699866

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 77d8c5639ebc40947940b6b150aad306
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,5 +1,6 @@
using System.Collections.Generic;
using UnityEditor.Experimental.GraphView;
using UnityEditor.MemoryProfiler;
using UnityEngine;
using UnityEngine.UIElements;
@ -26,10 +27,47 @@ namespace ImageProcessingGraph.Editor.Unity_Image_Processing.Scripts.Editor.Wind
{
window.searchProvider.target = (VisualElement)window.focusController.focusedElement;
SearchWindow.Open(new SearchWindowContext(position), window.searchProvider);
List<GraphConnection> connections = new List<GraphConnection>();
foreach (var conn in window.asset.Connections)
{
if (conn.internalEdge == edge)
{
connections.Add(conn);
}
}
foreach (var VARIABLE in connections)
{
window.asset.Connections.Remove(VARIABLE);
}
((ImageProcessingGraphNodeVisual)edge.input.node).ToggleExposedVariable((IPTPort)edge.input, true);
}
public void OnDrop(UnityEditor.Experimental.GraphView.GraphView graphView, Edge edge)
{
List<GraphConnection> connections = new List<GraphConnection>();
foreach (var conn in window.asset.Connections)
{
if (conn.internalEdge == edge)
{
connections.Add(conn);
}
}
foreach (var VARIABLE in connections)
{
window.asset.Connections.Remove(VARIABLE);
}
((ImageProcessingGraphNodeVisual)edge.input.node).ToggleExposedVariable((IPTPort)edge.input, true);
this.m_EdgesToCreate.Clear();
this.m_EdgesToCreate.Add(edge);
this.m_EdgesToDelete.Clear();

View File

@ -0,0 +1,325 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using ImageProcessingGraph.Editor.Nodes.NodeAttributes;
using UnityEditor;
using UnityEditor.Experimental.GraphView;
using UnityEditor.UIElements;
using UnityEngine;
using UnityEngine.UIElements;
using Input = ImageProcessingGraph.Editor.Nodes.NodeAttributes.Input;
namespace ImageProcessingGraph.Editor.Unity_Image_Processing.Scripts.Editor.Windows
{
public class ImageProcessingGraphNodeVisual : Node
{
private BaseImageNode graphNode;
public BaseImageNode GraphNode => graphNode;
public List<Port> InputPorts { get; }
public List<Port> OutputPorts { get; }
private ImageProcessingGraphViewWindow window;
private StyleSheet defaaStyleSheet;
private StyleSheet errorStyleSheet;
public ImageProcessingGraphNodeVisual(BaseImageNode node, ImageProcessingGraphViewWindow window)
{
this.AddToClassList("image-node-visual");
this.window = window;
graphNode = node;
Type typeInfo = node.GetType();
NodeInfoAttribute info = typeInfo.GetCustomAttribute<NodeInfoAttribute>();
title = info.Title;
string[] depths = info.MenuItem.Split('/');
foreach (var depth in depths)
{
this.AddToClassList(depth.ToLower().Replace(' ', '-'));
}
this.InputPorts = new List<Port>();
this.OutputPorts = new List<Port>();
List<Input> inputs = new List<Input>();
List<FieldInfo> inputFieldInfo = new List<FieldInfo>();
List<FieldInfo> outputFieldInfo = new List<FieldInfo>();
FieldInfo[] fields = typeInfo.GetFields(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
foreach (var field in fields)
{
if (field.GetCustomAttribute(typeof(Input)) != null)
{
Input input = field.GetCustomAttribute<Input>();
inputs.Add(input);
inputFieldInfo.Add(field);
}
if (field.GetCustomAttribute(typeof(Output)) != null)
{
Output output = field.GetCustomAttribute<Output>();
outputFieldInfo.Add(field);
}
}
CreateInputPorts(inputFieldInfo);
CreateOutputPorts(outputFieldInfo);
foreach (Port input in InputPorts)
{
}
foreach (Port input in OutputPorts)
{
}
defaaStyleSheet = AssetDatabase.LoadAssetAtPath<StyleSheet>("Assets/Unity Image Processing/Node.uss");
if (defaaStyleSheet == null)
{
defaaStyleSheet = EditorGUIUtility.Load("Packages/com.chromium.imageprocessingrah/Node.uss") as StyleSheet;
}
styleSheets.Add(defaaStyleSheet);
errorStyleSheet = AssetDatabase.LoadAssetAtPath<StyleSheet>("Assets/Unity Image Processing/NodeError.uss");
if (errorStyleSheet == null)
{
errorStyleSheet = EditorGUIUtility.Load("Packages/com.chromium.imageprocessingrah/NodeError.uss") as StyleSheet;
}
graphNode.onFailed += () =>
{
styleSheets.Add(errorStyleSheet);
};
window.asset.OnRun += () =>
{
if (styleSheets.Contains(errorStyleSheet))
styleSheets.Remove(errorStyleSheet);
};
this.name = typeInfo.Name;
}
private void CreateInputPorts(List<FieldInfo> fields)
{
for (var index = 0; index < fields.Count; index++)
{
var field = fields[index];
var port = IPTPort.Create(window.edgeConnectorListener, true, field.FieldType);
string label = field.GetCustomAttribute<Input>().Label;
if (label != "")
port.portName = label;
InputPorts.Add(port);
inputContainer.Add(port);
ExposeVariableToPort(port, field);
port.fieldInfo = field;
}
}
private void CreateOutputPorts(List<FieldInfo> fields)
{
for (var index = 0; index < fields.Count; index++)
{
var field = fields[index];
var port = IPTPort.Create(window.edgeConnectorListener, false, field.FieldType);
string label = field.GetCustomAttribute<Output>().Label;
if (label != "")
port.portName = label;
OutputPorts.Add(port);
outputContainer.Add(port);
port.fieldInfo = field;
}
}
// Exposes a variable on the port for editing when it's not connected
public void ExposeVariableToPort(Port port, FieldInfo field)
{
VisualElement NewElement = new VisualElement();
var ExposedPropertyContainer = ((IPTPort)port).ExposedPropertyContainer;
Type containerType = null;
if (ExposedPropertyContainer == null)
{
NewElement.name = "property-field-container";
VisualElement the = CreatePropertyFieldForType(field.FieldType, field.GetValue(graphNode));
if(the != null)
containerType = the.GetType();
NewElement.Add(the);
((IPTPort)port).ExposedPropertyContainer = the;
ExposedPropertyContainer = ((IPTPort)port).ExposedPropertyContainer;
}
else
{
containerType = ExposedPropertyContainer.GetType();
}
if (containerType == null)
return;
if (ExposedPropertyContainer.GetType() == typeof(IntegerField))
{
var intField = ExposedPropertyContainer as IntegerField;
intField.RegisterValueChangedCallback(evt =>
{
field.SetValue(graphNode, evt.newValue); // Update the field with the new value
});
}
else if (ExposedPropertyContainer is FloatField floatField)
{
floatField.RegisterValueChangedCallback(evt =>
{
field.SetValue(graphNode, evt.newValue); // Update the field with the new value
});
}
else if (ExposedPropertyContainer is Toggle boolField)
{
boolField.RegisterValueChangedCallback(evt =>
{
field.SetValue(graphNode, evt.newValue); // Update the field with the new value
});
}
else if (ExposedPropertyContainer is TextField stringField)
{
stringField.RegisterValueChangedCallback(evt =>
{
field.SetValue(graphNode, evt.newValue); // Update the field with the new value
});
}
else if (ExposedPropertyContainer is ColorField colorField)
{
colorField.RegisterValueChangedCallback(evt =>
{
field.SetValue(graphNode, evt.newValue); // Update the field with the new value
});
}
else if (ExposedPropertyContainer is Vector3Field vector3Field)
{
vector3Field.RegisterValueChangedCallback(evt =>
{
field.SetValue(graphNode, evt.newValue); // Update the field with the new value
});
}
else if (ExposedPropertyContainer is Vector2Field vector2Field)
{
vector2Field.RegisterValueChangedCallback(evt =>
{
field.SetValue(graphNode, evt.newValue); // Update the field with the new value
});
}
else if (ExposedPropertyContainer is ObjectField objectField)
{
objectField.RegisterValueChangedCallback(evt =>
{
field.SetValue(graphNode, evt.newValue); // Update the field with the new value
});
}
else if (ExposedPropertyContainer is EnumField enumField)
{
enumField.RegisterValueChangedCallback(evt =>
{
field.SetValue(graphNode, evt.newValue); // 🎯 Update the field with the new enum value
});
}
else if (ExposedPropertyContainer.GetType() == typeof(GreyscaleField))
{
var greyscaleField = ExposedPropertyContainer as GreyscaleField;
greyscaleField.RegisterValueChangedCallback(evt =>
{
var value = (GreyscaleValue)field.GetValue(graphNode);
if (evt.newValue > greyscaleField.minMax.Item2)
value.value = greyscaleField.minMax.Item2;
else if (evt.newValue < greyscaleField.minMax.Item1) value.value = greyscaleField.minMax.Item1;
value.value = evt.newValue;
});
}
port.Add(NewElement);
}
public void ToggleExposedVariable(Port port, bool value)
{
IPTPort iptPort = port as IPTPort;
if(iptPort.ExposedPropertyContainer != null)
iptPort.ExposedPropertyContainer.visible = value;
}
private VisualElement CreatePropertyFieldForType(Type type, object value)
{
if (type == typeof(int))
{
var intField = new IntegerField { value = (int)value };
return intField;
}
else if (type == typeof(float))
{
var floatField = new FloatField { value = (float)value };
return floatField;
}
else if (type == typeof(bool))
{
var boolField = new Toggle { value = (bool)value };
return boolField;
}
else if (type == typeof(string))
{
var stringField = new TextField { value = (string)value };
return stringField;
}
else if (type == typeof(Color))
{
var colorField = new ColorField() { value = (Color)value };
return colorField;
}
else if (type == typeof(Vector3))
{
var vector3Field = new Vector3Field { value = (Vector3)value };
return vector3Field;
}
else if (type == typeof(Vector2))
{
var vector2Field = new Vector2Field { value = (Vector2)value };
return vector2Field;
}
else if (type == typeof(Texture2D))
{
var objectField = new ObjectField { value = (Texture2D)value, objectType = typeof(Texture2D) };
return objectField;
}
else if (type.IsEnum) // 💥✨ ENUMS, BABY! 💥✨
{
var enumField = new EnumField((Enum)value);
return enumField;
}
else if (type == typeof(GreyscaleValue))
{
var greyscaleValue = (GreyscaleValue)value;
var intField = new GreyscaleField { value = (int)greyscaleValue.value };
return intField;
}
// Add more types as needed
return null;
}
public void SavePosition() => graphNode.SetPosition(GetPosition());
}
}

View File

@ -14,7 +14,6 @@ namespace ImageProcessingGraph.Editor
internal ImageProcessingGraphAsset asset;
private SerializedObject serializedObject;
private ImageProcessingGraphEditorWindow window;
public ImageProcessingGraphEditorWindow Window => window;
public List<ImageProcessingGraphNodeVisual> graphNodes;
@ -24,6 +23,11 @@ namespace ImageProcessingGraph.Editor
internal ImageProcessingGraphSearchProvider searchProvider;
internal ImageProcessingGraphEdgeConnectorListener edgeConnectorListener;
private bool isDropdownEnabled = false;
private Button debugModeButton;
private Button outputRunOrder;
public ImageProcessingGraphViewWindow(SerializedObject obeject, ImageProcessingGraphEditorWindow window)
{
this.serializedObject = obeject;
@ -43,17 +47,20 @@ namespace ImageProcessingGraph.Editor
this.window = window;
StyleSheet styleSheet = AssetDatabase.LoadAssetAtPath<StyleSheet>("Assets/Unity Image Processing/GraphView.uss");
if (styleSheet == null)
{
styleSheet = EditorGUIUtility.Load("Packages/com.chromium.imageprocessingrah/GraphView.uss") as StyleSheet;
}
styleSheets.Add(styleSheet);
GridBackground background = new GridBackground();
background.name = "Grid";
Add(background);
background.SendToBack();
CreateButtons();
this.AddManipulator(new ContentDragger());
this.AddManipulator(new SelectionDragger());
this.AddManipulator(new RectangleSelector());
@ -63,10 +70,122 @@ namespace ImageProcessingGraph.Editor
DrawNodes();
DrawConnections();
foreach (var conn in asset.Connections)
{
if (conn.internalEdge == null)
{
}
//GetNode(conn.inputPort.nodeID).ToggleExposedVariable(conn.internalEdge.input, true);
}
graphViewChanged += OnGraphViewChanged;
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)
{
ImageProcessingGraphNodeVisual node = null;
@ -118,7 +237,7 @@ namespace ImageProcessingGraph.Editor
private void UndoEvent(in UndoRedoInfo undo)
{
DrawNodes();
DrawConnections();
}
private GraphViewChange OnGraphViewChanged(GraphViewChange graphviewchange)
@ -180,22 +299,47 @@ namespace ImageProcessingGraph.Editor
string inputType = inputNode.GraphNode.GetType().Name;
string outputType = outputNode.GraphNode.GetType().Name;
GraphConnection connection = new GraphConnection(inputNode.GraphNode.ID,inputIndex, inputType,outputNode.GraphNode.ID, outputIndex, outputType);
GraphConnection connection = new GraphConnection(inputNode.GraphNode.ID,inputIndex, inputType,outputNode.GraphNode.ID, outputIndex, outputType, edge);
edge.output.Connect(edge);
edge.input.Connect(edge);
IPTPort portIn = (IPTPort)edge.output;
IPTPort portOut = (IPTPort)edge.output;
if (portIn.fieldInfo != null)
inputNode.ToggleExposedVariable(edge.input, false);
asset.Connections.Add(connection);
}
private void RemoveEdge(Edge variable)
private void RemoveEdge(Edge edge)
{
if (connectionDictionary.TryGetValue(variable, out GraphConnection connection))
if (connectionDictionary.TryGetValue(edge, out GraphConnection connection))
{
asset.Connections.Remove(connection);
connectionDictionary.Remove(variable);
connectionDictionary.Remove(edge);
edge.output.Disconnect(edge);
edge.input.Disconnect(edge);
ImageProcessingGraphNodeVisual inputNode = (ImageProcessingGraphNodeVisual)edge.input.node;
IPTPort portIn = (IPTPort)edge.input;
if(portIn.fieldInfo != null)
inputNode.ToggleExposedVariable(edge.input, true);
}
}
private void DrawConnections()
{
foreach (KeyValuePair<Edge, GraphConnection> node in connectionDictionary)
{
RemoveElement(node.Key);
}
connectionDictionary.Clear();
if (asset.Connections != null)
{
foreach (GraphConnection conn in asset.Connections)
@ -205,12 +349,15 @@ namespace ImageProcessingGraph.Editor
if (inputNode != null && outputNode != null)
{
Port inPort = inputNode.InputPorts[conn.inputPort.portID];
Port outPort = outputNode.OutputPorts[conn.outputPort.portID];
IPTPort inPort = inputNode.InputPorts[conn.inputPort.portID] as IPTPort;
IPTPort outPort = outputNode.OutputPorts[conn.outputPort.portID] as IPTPort;
Edge edge = inPort.ConnectTo(outPort);
AddElement(edge);
connectionDictionary.Add(edge, conn);
conn.SetInternalEdge(edge);
((ImageProcessingGraphNodeVisual)inPort.node).ToggleExposedVariable(inPort, false);
}
}

View File

@ -1,232 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1da462fd3f736d04e80556b4ac8b470f, type: 3}
m_Name: URP-MAS
m_EditorClassIdentifier:
nodes:
- rid: 6869590814762467406
- rid: 6869590814762467407
- rid: 6869590814762467408
- rid: 6869590814762467409
- rid: 6869590814762467410
- rid: 6869590814762467411
- rid: 6869590814762467412
connections:
- inputPort:
nodeID: c72eea15-501d-41b1-add3-4f0816ef3373
nodeType: StringAppend
portID: 0
outputPort:
nodeID: c21a6722-828f-4372-a718-298a0fe7b79b
nodeType: StringAppend
portID: 0
- inputPort:
nodeID: 9ccc58ba-79a7-4a7f-8057-3bdfbf8fb5c3
nodeType: Texture2DOutput
portID: 1
outputPort:
nodeID: c72eea15-501d-41b1-add3-4f0816ef3373
nodeType: StringAppend
portID: 0
- inputPort:
nodeID: 87c7a966-55ec-42aa-a537-73ebe906412b
nodeType: RGBASplit
portID: 0
outputPort:
nodeID: ac4be66e-d3b8-4633-a692-60cb30579f97
nodeType: Texture2DImport
portID: 0
- inputPort:
nodeID: 1c21d8e6-5b93-4a6f-a7ff-7322be2d20be
nodeType: RGBASplit
portID: 0
outputPort:
nodeID: 9b32fc10-fda3-4faa-82ac-efcff95a5138
nodeType: Texture2DImport
portID: 0
- inputPort:
nodeID: 3abef457-f0ec-456e-baa8-e8ae657b49e4
nodeType: RGBASCombine
portID: 1
outputPort:
nodeID: 87c7a966-55ec-42aa-a537-73ebe906412b
nodeType: RGBASplit
portID: 0
- inputPort:
nodeID: 3abef457-f0ec-456e-baa8-e8ae657b49e4
nodeType: RGBASCombine
portID: 0
outputPort:
nodeID: 1c21d8e6-5b93-4a6f-a7ff-7322be2d20be
nodeType: RGBASplit
portID: 0
- inputPort:
nodeID: 3abef457-f0ec-456e-baa8-e8ae657b49e4
nodeType: RGBASCombine
portID: 3
outputPort:
nodeID: 1c21d8e6-5b93-4a6f-a7ff-7322be2d20be
nodeType: RGBASplit
portID: 3
- inputPort:
nodeID: b882f7b7-9f8b-43ef-a79a-33d4e874edd0
nodeType: Texture2DOutput
portID: 0
outputPort:
nodeID: 3abef457-f0ec-456e-baa8-e8ae657b49e4
nodeType: RGBASCombine
portID: 0
- inputPort:
nodeID: b882f7b7-9f8b-43ef-a79a-33d4e874edd0
nodeType: Texture2DOutput
portID: 2
outputPort:
nodeID: 9b32fc10-fda3-4faa-82ac-efcff95a5138
nodeType: Texture2DImport
portID: 2
- inputPort:
nodeID: 97953833-bdf9-47b5-b1d2-b4cbfa19f57a
nodeType: StringAppend
portID: 0
outputPort:
nodeID: 9b32fc10-fda3-4faa-82ac-efcff95a5138
nodeType: Texture2DImport
portID: 1
- inputPort:
nodeID: b882f7b7-9f8b-43ef-a79a-33d4e874edd0
nodeType: Texture2DOutput
portID: 1
outputPort:
nodeID: 97953833-bdf9-47b5-b1d2-b4cbfa19f57a
nodeType: StringAppend
portID: 0
- inputPort:
nodeID: 3abef457-f0ec-456e-baa8-e8ae657b49e4
nodeType: RGBASCombine
portID: 2
outputPort:
nodeID: 1c21d8e6-5b93-4a6f-a7ff-7322be2d20be
nodeType: RGBASplit
portID: 3
- inputPort:
nodeID: 3abef457-f0ec-456e-baa8-e8ae657b49e4
nodeType: RGBASCombine
portID: 3
outputPort:
nodeID: 1c21d8e6-5b93-4a6f-a7ff-7322be2d20be
nodeType: RGBASplit
portID: 2
references:
version: 2
RefIds:
- rid: 6869590814762467406
type: {class: Texture2DImport, ns: ImageProcessingGraph.Editor.Nodes.Import_Nodes, asm: ImageProcessingGraphEditor}
data:
guid: ac4be66e-d3b8-4633-a692-60cb30579f97
position:
serializedVersion: 2
x: -285.5
y: 18
width: 311
height: 125
typeName: ImageProcessingGraph.Editor.Nodes.Import_Nodes.Texture2DImport,
ImageProcessingGraphEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
asset: {fileID: 11400000}
textureImport: {fileID: 2800000, guid: 44da9e368ce69454aa6ccc40919a7f50, type: 3}
fileName:
filePath:
- rid: 6869590814762467407
type: {class: Texture2DImport, ns: ImageProcessingGraph.Editor.Nodes.Import_Nodes, asm: ImageProcessingGraphEditor}
data:
guid: 9b32fc10-fda3-4faa-82ac-efcff95a5138
position:
serializedVersion: 2
x: -287
y: 292
width: 288
height: 125
typeName: ImageProcessingGraph.Editor.Nodes.Import_Nodes.Texture2DImport,
ImageProcessingGraphEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
asset: {fileID: 11400000}
textureImport: {fileID: 2800000, guid: 1640d081a2287448cb2a75fba48b9dcf, type: 3}
fileName:
filePath:
- rid: 6869590814762467408
type: {class: RGBASplit, ns: ImageProcessingGraph.Editor.Nodes.Fun_Nodes.Texture, asm: ImageProcessingGraphEditor}
data:
guid: 87c7a966-55ec-42aa-a537-73ebe906412b
position:
serializedVersion: 2
x: 124
y: 18
width: 138
height: 149
typeName: ImageProcessingGraph.Editor.Nodes.Fun_Nodes.Texture.RGBASplit,
ImageProcessingGraphEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
asset: {fileID: 11400000}
- rid: 6869590814762467409
type: {class: RGBASplit, ns: ImageProcessingGraph.Editor.Nodes.Fun_Nodes.Texture, asm: ImageProcessingGraphEditor}
data:
guid: 1c21d8e6-5b93-4a6f-a7ff-7322be2d20be
position:
serializedVersion: 2
x: 124
y: 167
width: 138
height: 149
typeName: ImageProcessingGraph.Editor.Nodes.Fun_Nodes.Texture.RGBASplit,
ImageProcessingGraphEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
asset: {fileID: 11400000}
- rid: 6869590814762467410
type: {class: RGBASCombine, ns: ImageProcessingGraph.Editor.Nodes.Fun_Nodes.Texture, asm: ImageProcessingGraphEditor}
data:
guid: 3abef457-f0ec-456e-baa8-e8ae657b49e4
position:
serializedVersion: 2
x: 315.5
y: 92.5
width: 138
height: 149
typeName: ImageProcessingGraph.Editor.Nodes.Fun_Nodes.Texture.RGBASCombine,
ImageProcessingGraphEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
asset: {fileID: 11400000}
- rid: 6869590814762467411
type: {class: Texture2DOutput, ns: ImageProcessingGraph.Editor.Nodes.Output, asm: ImageProcessingGraphEditor}
data:
guid: b882f7b7-9f8b-43ef-a79a-33d4e874edd0
position:
serializedVersion: 2
x: 559.5
y: 143
width: 129.5
height: 125
typeName: ImageProcessingGraph.Editor.Nodes.Output.Texture2DOutput, ImageProcessingGraphEditor,
Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
asset: {fileID: 11400000}
fileName:
fileDirectory:
- rid: 6869590814762467412
type: {class: StringAppend, ns: ImageProcessingGraph.Editor.Nodes.String_Nodes, asm: ImageProcessingGraphEditor}
data:
guid: 97953833-bdf9-47b5-b1d2-b4cbfa19f57a
position:
serializedVersion: 2
x: 124
y: 450.5
width: 248
height: 101
typeName: ImageProcessingGraph.Editor.Nodes.String_Nodes.StringAppend, ImageProcessingGraphEditor,
Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
asset: {fileID: 11400000}
baseString:
appendString: _MAS
output:

4
Node.uss Normal file
View File

@ -0,0 +1,4 @@
#input
{
flex-shrink: 1
}

3
Node.uss.meta Normal file
View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: f213bce165884ca7ae5d567d6bb7f3cb
timeCreated: 1745777804

7
NodeError.uss Normal file
View File

@ -0,0 +1,7 @@
#node-border
{
border-bottom-color: red;
border-left-color: red;
border-right-color: red;
border-top-color: red;
}

3
NodeError.uss.meta Normal file
View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 7ecdb9925f9c4d018e1e54b8ae734ccb
timeCreated: 1745808720

View File

@ -1,18 +0,0 @@
using UnityEngine;
namespace ImageProcessingGraph.Editor
{
#if true
[CreateAssetMenu(menuName = "PreferenceCreate")]
#endif
public class IPT_Preferences : ScriptableObject
{
[Header("Grid Settings")]
public float thickLines;
public float spacing;
public Color gridBackgroundColour;
public Color lineColour;
}
}

View File

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: ca37b9337d41484892c89933479f1e7f
timeCreated: 1743745541

View File

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 1646a2bcaf6b4de488cadad1d7cdf795
timeCreated: 1743747481

View File

@ -1,20 +0,0 @@
using ImageProcessingGraph.Editor.Nodes.NodeAttributes;
using Unity.Collections;
using UnityEditor;
using UnityEngine;
namespace ImageProcessingGraph.Editor.Nodes.Output
{
[NodeInfo("Texture Export", "Export/Texture2D", true)]
public class Texture2DOutput : BaseImageNode
{
[NodeAttributes.Input("")] public ImageData inputPixels;
[NodeAttributes.Input("File Name")] public string fileName;
[NodeAttributes.Input("File Path")] public string fileDirectory;
public override void Process()
{
AssetDatabase.CreateAsset(inputPixels.ToTexture2D(), $"{fileDirectory}/{fileName}.asset");
}
}
}

View File

@ -1,245 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using ImageProcessingGraph.Editor.Nodes.NodeAttributes;
using UnityEditor.Experimental.GraphView;
using UnityEditor.UIElements;
using UnityEngine;
using UnityEngine.UIElements;
using Input = ImageProcessingGraph.Editor.Nodes.NodeAttributes.Input;
namespace ImageProcessingGraph.Editor.Unity_Image_Processing.Scripts.Editor.Windows
{
public class ImageProcessingGraphNodeVisual : Node
{
private BaseImageNode graphNode;
public BaseImageNode GraphNode => graphNode;
public List<Port> InputPorts { get; }
public List<Port> OutputPorts { get; }
private ImageProcessingGraphViewWindow window;
public ImageProcessingGraphNodeVisual(BaseImageNode node, ImageProcessingGraphViewWindow window)
{
this.AddToClassList("image-node-visual");
this.window = window;
graphNode = node;
Type typeInfo = node.GetType();
NodeInfoAttribute info = typeInfo.GetCustomAttribute<NodeInfoAttribute>();
title = info.Title;
string[] depths = info.MenuItem.Split('/');
foreach (var depth in depths)
{
this.AddToClassList(depth.ToLower().Replace(' ', '-'));
}
this.InputPorts = new List<Port>();
this.OutputPorts = new List<Port>();
List<Input> inputs = new List<Input>();
List<FieldInfo> inputFieldInfo = new List<FieldInfo>();
List<FieldInfo> outputFieldInfo = new List<FieldInfo>();
FieldInfo[] fields = typeInfo.GetFields(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
foreach (var field in fields)
{
if (field.GetCustomAttribute(typeof(Input)) != null)
{
Input input = field.GetCustomAttribute<Input>();
inputs.Add(input);
inputFieldInfo.Add(field);
}
if (field.GetCustomAttribute(typeof(Output)) != null)
{
Output output = field.GetCustomAttribute<Output>();
outputFieldInfo.Add(field);
}
}
CreateInputPorts(inputFieldInfo);
CreateOutputPorts(outputFieldInfo);
this.name = typeInfo.Name;
}
private void CreateInputPorts(List<FieldInfo> fields)
{
for (var index = 0; index < fields.Count; index++)
{
var field = fields[index];
/*
Port port = InstantiatePort(Orientation.Horizontal, Direction.Input, Port.Capacity.Multi, field.FieldType);
*/
var port = IPTPort.Create(window.edgeConnectorListener, true, field.FieldType);
string label = field.GetCustomAttribute<Input>().Label;
if (label != "")
port.portName = label;
InputPorts.Add(port);
inputContainer.Add(port);
ExposeVariableToPort(port, field);
}
}
private void CreateOutputPorts(List<FieldInfo> fields)
{
for (var index = 0; index < fields.Count; index++)
{
var field = fields[index];
var port = IPTPort.Create(window.edgeConnectorListener, false, field.FieldType);
string label = field.GetCustomAttribute<Output>().Label;
if (label != "")
port.portName = label;
OutputPorts.Add(port);
outputContainer.Add(port);
}
}
// Exposes a variable on the port for editing when it's not connected
private void ExposeVariableToPort(Port port, FieldInfo field)
{
// Only expose when the port is not connected
if (port.connections.Count() == 0)
{
var propertyFieldContainer = new VisualElement();
propertyFieldContainer.name = "property-field-container";
var propertyField = CreatePropertyFieldForType(field.FieldType, field.GetValue(graphNode));
if (propertyField != null)
{
// Register a callback for when the value changes
if (propertyField is IntegerField intField)
{
intField.RegisterValueChangedCallback(evt =>
{
field.SetValue(graphNode, evt.newValue); // Update the field with the new value
});
}
else if (propertyField is FloatField floatField)
{
floatField.RegisterValueChangedCallback(evt =>
{
field.SetValue(graphNode, evt.newValue); // Update the field with the new value
});
}
else if (propertyField is Toggle boolField)
{
boolField.RegisterValueChangedCallback(evt =>
{
field.SetValue(graphNode, evt.newValue); // Update the field with the new value
});
}
else if (propertyField is TextField stringField)
{
stringField.RegisterValueChangedCallback(evt =>
{
field.SetValue(graphNode, evt.newValue); // Update the field with the new value
});
}
else if (propertyField is ColorField colorField)
{
colorField.RegisterValueChangedCallback(evt =>
{
field.SetValue(graphNode, evt.newValue); // Update the field with the new value
});
}
else if (propertyField is Vector3Field vector3Field)
{
vector3Field.RegisterValueChangedCallback(evt =>
{
field.SetValue(graphNode, evt.newValue); // Update the field with the new value
});
}
else if (propertyField is Vector2Field vector2Field)
{
vector2Field.RegisterValueChangedCallback(evt =>
{
field.SetValue(graphNode, evt.newValue); // Update the field with the new value
});
}
else if (propertyField is ObjectField objectField)
{
objectField.RegisterValueChangedCallback(evt =>
{
field.SetValue(graphNode, evt.newValue); // Update the field with the new value
});
}
propertyFieldContainer.Add(propertyField);
port.Add(propertyFieldContainer);
}
}
else
{
// If the port is connected, remove the exposed UI element
var existingPropertyFieldContainer = port.Q<VisualElement>("property-field-container");
if (existingPropertyFieldContainer != null)
{
port.Remove(existingPropertyFieldContainer);
}
}
}
// Create appropriate property field based on the type of the variable
private VisualElement CreatePropertyFieldForType(Type type, object value)
{
if (type == typeof(int))
{
var intField = new IntegerField { value = (int)value };
return intField;
}
else if (type == typeof(float))
{
var floatField = new FloatField { value = (float)value };
return floatField;
}
else if (type == typeof(bool))
{
var boolField = new Toggle { value = (bool)value };
return boolField;
}
else if (type == typeof(string))
{
var stringField = new TextField { value = (string)value };
return stringField;
}
else if (type == typeof(Color))
{
var colorField = new ColorField() { value = (Color)value };
return colorField;
}
else if (type == typeof(Vector3))
{
var vector3Field = new Vector3Field { value = (Vector3)value };
return vector3Field;
}
else if (type == typeof(Vector2))
{
var vector2Field = new Vector2Field { value = (Vector2)value };
return vector2Field;
}
else if (type == typeof(Texture2D))
{
var objectField = new ObjectField { value = (Texture2D)value, objectType = typeof(Texture2D) };
return objectField;
}
// Add more types as needed (Vector3, etc.)
return null;
}
public void SavePosition() => graphNode.SetPosition(GetPosition());
}
}

View File

@ -1,18 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 80dcc02594d68e3439df7dc743c9d4b2, type: 3}
m_Name: New IPT_Preferences
m_EditorClassIdentifier:
thickLines: 0
spacing: 0
gridBackgroundColour: {r: 0, g: 0, b: 0, a: 0}
lineColour: {r: 0, g: 0, b: 0, a: 0}

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: d4bfee84a7579474c8626fb17fcc299b
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,658 +0,0 @@
{
"m_SGVersion": 3,
"m_Type": "UnityEditor.ShaderGraph.GraphData",
"m_ObjectId": "a14387ccdc0e4230b24cf16376062b37",
"m_Properties": [],
"m_Keywords": [],
"m_Dropdowns": [],
"m_CategoryData": [
{
"m_Id": "71cd3153db9241d78583f494f3175e65"
}
],
"m_Nodes": [
{
"m_Id": "0e3586066bf84a19b29835e8f00f18c8"
},
{
"m_Id": "4a4c9b7678bf48649738dd347fbf691d"
},
{
"m_Id": "6cc2f2b53819431db80cdc902c44b0a2"
},
{
"m_Id": "170a5a0274d84f83b5b3409d7ebccc3c"
},
{
"m_Id": "b6f01d1b41104807b982a044c5e1e005"
},
{
"m_Id": "329dddc156c148b887205cd362845c53"
},
{
"m_Id": "574823597594424bb34f730b62c44aef"
},
{
"m_Id": "a77037c58c28419ba14f3220b7d8fbff"
},
{
"m_Id": "265ae6dabc6f4c57bb9681736466b11f"
}
],
"m_GroupDatas": [],
"m_StickyNoteDatas": [],
"m_Edges": [],
"m_VertexContext": {
"m_Position": {
"x": 0.0,
"y": 0.0
},
"m_Blocks": [
{
"m_Id": "0e3586066bf84a19b29835e8f00f18c8"
},
{
"m_Id": "4a4c9b7678bf48649738dd347fbf691d"
},
{
"m_Id": "6cc2f2b53819431db80cdc902c44b0a2"
}
]
},
"m_FragmentContext": {
"m_Position": {
"x": 0.0,
"y": 200.0
},
"m_Blocks": [
{
"m_Id": "170a5a0274d84f83b5b3409d7ebccc3c"
},
{
"m_Id": "b6f01d1b41104807b982a044c5e1e005"
},
{
"m_Id": "329dddc156c148b887205cd362845c53"
},
{
"m_Id": "574823597594424bb34f730b62c44aef"
},
{
"m_Id": "a77037c58c28419ba14f3220b7d8fbff"
},
{
"m_Id": "265ae6dabc6f4c57bb9681736466b11f"
}
]
},
"m_PreviewData": {
"serializedMesh": {
"m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}",
"m_Guid": ""
},
"preventRotation": false
},
"m_Path": "Shader Graphs",
"m_GraphPrecision": 1,
"m_PreviewMode": 2,
"m_OutputNode": {
"m_Id": ""
},
"m_SubDatas": [],
"m_ActiveTargets": [
{
"m_Id": "7dffcc0f872e4798bc7d7c277c01ca46"
}
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot",
"m_ObjectId": "0000b8c7f15240e8a92c2c75a833f48f",
"m_Id": 0,
"m_DisplayName": "Base Color",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "BaseColor",
"m_StageCapability": 2,
"m_Value": {
"x": 0.5,
"y": 0.5,
"z": 0.5
},
"m_DefaultValue": {
"x": 0.5,
"y": 0.5,
"z": 0.5
},
"m_Labels": [],
"m_ColorMode": 0,
"m_DefaultColor": {
"r": 0.5,
"g": 0.5,
"b": 0.5,
"a": 1.0
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "0468751a1c344e38b0aec9b2b4467e38",
"m_Id": 0,
"m_DisplayName": "Smoothness",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Smoothness",
"m_StageCapability": 2,
"m_Value": 0.5,
"m_DefaultValue": 0.5,
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "0e3586066bf84a19b29835e8f00f18c8",
"m_Group": {
"m_Id": ""
},
"m_Name": "VertexDescription.Position",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "8e9794e0177a4feebf5eb676d84fe1f3"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "VertexDescription.Position"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "0f43a512a2ae49f3959b2c0347ca55b2",
"m_Id": 0,
"m_DisplayName": "Ambient Occlusion",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Occlusion",
"m_StageCapability": 2,
"m_Value": 1.0,
"m_DefaultValue": 1.0,
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "170a5a0274d84f83b5b3409d7ebccc3c",
"m_Group": {
"m_Id": ""
},
"m_Name": "SurfaceDescription.BaseColor",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "0000b8c7f15240e8a92c2c75a833f48f"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "SurfaceDescription.BaseColor"
}
{
"m_SGVersion": 2,
"m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalLitSubTarget",
"m_ObjectId": "1fe22ff03eb64399a2fd9c06b88eafa8",
"m_WorkflowMode": 1,
"m_NormalDropOffSpace": 0,
"m_ClearCoat": false,
"m_BlendModePreserveSpecular": true
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "265ae6dabc6f4c57bb9681736466b11f",
"m_Group": {
"m_Id": ""
},
"m_Name": "SurfaceDescription.Occlusion",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "0f43a512a2ae49f3959b2c0347ca55b2"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "SurfaceDescription.Occlusion"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "329dddc156c148b887205cd362845c53",
"m_Group": {
"m_Id": ""
},
"m_Name": "SurfaceDescription.Metallic",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "bd184b28488f4573bef8c2af64be7436"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "SurfaceDescription.Metallic"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.TangentMaterialSlot",
"m_ObjectId": "32e096cd3bb849e7bb32f646989794db",
"m_Id": 0,
"m_DisplayName": "Tangent",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Tangent",
"m_StageCapability": 1,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [],
"m_Space": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot",
"m_ObjectId": "382845f601e84d2292ccb7886a370bcb",
"m_Id": 0,
"m_DisplayName": "Emission",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Emission",
"m_StageCapability": 2,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [],
"m_ColorMode": 1,
"m_DefaultColor": {
"r": 0.0,
"g": 0.0,
"b": 0.0,
"a": 1.0
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "4a4c9b7678bf48649738dd347fbf691d",
"m_Group": {
"m_Id": ""
},
"m_Name": "VertexDescription.Normal",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "83dd0d2576664436bb795eba7ffb4883"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "VertexDescription.Normal"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "574823597594424bb34f730b62c44aef",
"m_Group": {
"m_Id": ""
},
"m_Name": "SurfaceDescription.Smoothness",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "0468751a1c344e38b0aec9b2b4467e38"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "SurfaceDescription.Smoothness"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "6cc2f2b53819431db80cdc902c44b0a2",
"m_Group": {
"m_Id": ""
},
"m_Name": "VertexDescription.Tangent",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "32e096cd3bb849e7bb32f646989794db"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "VertexDescription.Tangent"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.CategoryData",
"m_ObjectId": "71cd3153db9241d78583f494f3175e65",
"m_Name": "",
"m_ChildObjectList": []
}
{
"m_SGVersion": 1,
"m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget",
"m_ObjectId": "7dffcc0f872e4798bc7d7c277c01ca46",
"m_Datas": [],
"m_ActiveSubTarget": {
"m_Id": "1fe22ff03eb64399a2fd9c06b88eafa8"
},
"m_AllowMaterialOverride": false,
"m_SurfaceType": 0,
"m_ZTestMode": 4,
"m_ZWriteControl": 0,
"m_AlphaMode": 0,
"m_RenderFace": 2,
"m_AlphaClip": false,
"m_CastShadows": true,
"m_ReceiveShadows": true,
"m_DisableTint": false,
"m_AdditionalMotionVectorMode": 0,
"m_AlembicMotionVectors": false,
"m_SupportsLODCrossFade": false,
"m_CustomEditorGUI": "",
"m_SupportVFX": false
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot",
"m_ObjectId": "83dd0d2576664436bb795eba7ffb4883",
"m_Id": 0,
"m_DisplayName": "Normal",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Normal",
"m_StageCapability": 1,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [],
"m_Space": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot",
"m_ObjectId": "8e9794e0177a4feebf5eb676d84fe1f3",
"m_Id": 0,
"m_DisplayName": "Position",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Position",
"m_StageCapability": 1,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [],
"m_Space": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot",
"m_ObjectId": "a72d7540c45d4b7e8a8d554f6274d745",
"m_Id": 0,
"m_DisplayName": "Normal (Tangent Space)",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "NormalTS",
"m_StageCapability": 2,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [],
"m_Space": 3
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "a77037c58c28419ba14f3220b7d8fbff",
"m_Group": {
"m_Id": ""
},
"m_Name": "SurfaceDescription.Emission",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "382845f601e84d2292ccb7886a370bcb"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "SurfaceDescription.Emission"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "b6f01d1b41104807b982a044c5e1e005",
"m_Group": {
"m_Id": ""
},
"m_Name": "SurfaceDescription.NormalTS",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "a72d7540c45d4b7e8a8d554f6274d745"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "SurfaceDescription.NormalTS"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "bd184b28488f4573bef8c2af64be7436",
"m_Id": 0,
"m_DisplayName": "Metallic",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Metallic",
"m_StageCapability": 2,
"m_Value": 0.0,
"m_DefaultValue": 0.0,
"m_Labels": []
}

View File

@ -1,10 +0,0 @@
fileFormatVersion: 2
guid: c56761e16709479478032d95d74c0274
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}

View File

@ -1,95 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1da462fd3f736d04e80556b4ac8b470f, type: 3}
m_Name: Test Graph One
m_EditorClassIdentifier:
nodes:
- rid: 6869590814762467392
- rid: 6869590814762467393
- rid: 6869590814762467394
- rid: 6869590814762467395
connections:
- inputPort:
nodeID: 64b814fe-8177-4620-9cf6-cacbe0b8ddd7
nodeType: Texture2DDesaturate
portID: 0
outputPort:
nodeID: b8924b16-c816-4168-8ee6-9ee30c6b63a9
nodeType: Texture2DImport
portID: 0
- inputPort:
nodeID: aa4b4ff2-61d6-4f84-a4ab-5b6b15c2ba97
nodeType: Texture2DOutput
portID: 0
outputPort:
nodeID: 64b814fe-8177-4620-9cf6-cacbe0b8ddd7
nodeType: Texture2DDesaturate
portID: 0
references:
version: 2
RefIds:
- rid: 6869590814762467392
type: {class: Texture2DImport, ns: ImageProcessingGraph.Editor.Nodes.Import_Nodes, asm: ImageProcessingGraphEditor}
data:
guid: b8924b16-c816-4168-8ee6-9ee30c6b63a9
position:
serializedVersion: 2
x: -1110
y: 171.5
width: 311
height: 77
typeName: ImageProcessingGraph.Editor.Nodes.Import_Nodes.Texture2DImport,
ImageProcessingGraphEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
asset: {fileID: 11400000}
textureImport: {fileID: 2800000, guid: 727a75301c3d24613a3ebcec4a24c2c8, type: 3}
- rid: 6869590814762467393
type: {class: Texture2DDesaturate, ns: ImageProcessingGraph.Editor.Nodes.Fun_Nodes.Texture, asm: ImageProcessingGraphEditor}
data:
guid: 64b814fe-8177-4620-9cf6-cacbe0b8ddd7
position:
serializedVersion: 2
x: -782
y: 171.5
width: 186
height: 77
typeName: ImageProcessingGraph.Editor.Nodes.Fun_Nodes.Texture.Texture2DDesaturate,
ImageProcessingGraphEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
asset: {fileID: 11400000}
- rid: 6869590814762467394
type: {class: Texture2DOutput, ns: ImageProcessingGraph.Editor.Nodes.Output, asm: ImageProcessingGraphEditor}
data:
guid: aa4b4ff2-61d6-4f84-a4ab-5b6b15c2ba97
position:
serializedVersion: 2
x: -541
y: 186
width: 129.5
height: 125
typeName: ImageProcessingGraph.Editor.Nodes.Output.Texture2DOutput, ImageProcessingGraphEditor,
Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
asset: {fileID: 11400000}
fileName: test123432
fileDirectory: Assets/
- rid: 6869590814762467395
type: {class: Texture2DImport, ns: ImageProcessingGraph.Editor.Nodes.Import_Nodes, asm: ImageProcessingGraphEditor}
data:
guid: 31f0135e-bc96-4c58-b808-210652f702bb
position:
serializedVersion: 2
x: 152
y: -9
width: 311
height: 77
typeName: ImageProcessingGraph.Editor.Nodes.Import_Nodes.Texture2DImport,
ImageProcessingGraphEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
asset: {fileID: 11400000}
textureImport: {fileID: 0}

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: cef427fd668d96d47b164a934e97ba0d
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,11 +1,11 @@
{
"name": "com.chromium.imageprocessingrah",
"version": "6000.0.19f1",
"version": "0.0.0",
"displayName": "Image Processing Graph",
"description": "Stuffs",
"unity": "6000.0.19f1",
"unity": "2022.3",
"dependencies": {
"com.unity.burst" : "1.8.17"
"com.unity.burst": "1.8.17"
},
"author": {
"name": "Sam Green",