SCARY STUFF VERY EARLY
This commit is contained in:
parent
f5c9b2833c
commit
f1824f8b5e
3
Editor/Scripts/Editor/Batching.meta
Normal file
3
Editor/Scripts/Editor/Batching.meta
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 32f2e21024994d43a7bc90a006dcd70f
|
||||||
|
timeCreated: 1746242052
|
20
Editor/Scripts/Editor/Batching/Batcher.cs
Normal file
20
Editor/Scripts/Editor/Batching/Batcher.cs
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
using UnityEditor;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace ImageProcessingGraph.Editor.Batching
|
||||||
|
{
|
||||||
|
public class Batcher
|
||||||
|
{
|
||||||
|
[MenuItem("Assets/Batch Graph", true)]
|
||||||
|
private static bool ValidateAsAsset()
|
||||||
|
{
|
||||||
|
return Selection.activeObject is ImageProcessingGraphAsset;
|
||||||
|
}
|
||||||
|
|
||||||
|
[MenuItem("Assets/Batch Graph")]
|
||||||
|
private static void OpenBatchWindow()
|
||||||
|
{
|
||||||
|
BatchingWindow.OpenBatchingWindow(Selection.activeObject as ImageProcessingGraphAsset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
3
Editor/Scripts/Editor/Batching/Batcher.cs.meta
Normal file
3
Editor/Scripts/Editor/Batching/Batcher.cs.meta
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ba9a14be40ae49b190ae8dd220fb7448
|
||||||
|
timeCreated: 1746242057
|
8
Editor/Scripts/Editor/Batching/Window.meta
Normal file
8
Editor/Scripts/Editor/Batching/Window.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b6b66fa4b0ee2864fb8ffb9d435a9f54
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
66
Editor/Scripts/Editor/Batching/Window/BatchingWindow.cs
Normal file
66
Editor/Scripts/Editor/Batching/Window/BatchingWindow.cs
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
using ImageProcessingGraph.Editor;
|
||||||
|
using UnityEditor;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UIElements;
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using ImageProcessingGraph.Editor.Nodes.Types.Image.Variable_Node;
|
||||||
|
using UnityEditor;
|
||||||
|
using UnityEditor.UIElements;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UIElements;
|
||||||
|
|
||||||
|
public class BatchingWindow : EditorWindow
|
||||||
|
{
|
||||||
|
[SerializeField]
|
||||||
|
private VisualTreeAsset m_VisualTreeAsset = default;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private ImageProcessingGraphAsset m_ImageProcessingGraphAsset;
|
||||||
|
|
||||||
|
private static Dictionary<ImageProcessingGraphAsset, BatchingWindow> s_OpenWindows = new();
|
||||||
|
private List<Foldout> variableNodeFoldouts = new();
|
||||||
|
|
||||||
|
public static void OpenBatchingWindow(ImageProcessingGraphAsset asset)
|
||||||
|
{
|
||||||
|
if (s_OpenWindows.TryGetValue(asset, out BatchingWindow existingWindow))
|
||||||
|
{
|
||||||
|
existingWindow.Focus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
BatchingWindow window = CreateInstance<BatchingWindow>();
|
||||||
|
window.titleContent = new GUIContent($"{asset.name} Batcher");
|
||||||
|
window.m_ImageProcessingGraphAsset = asset;
|
||||||
|
window.Show();
|
||||||
|
|
||||||
|
s_OpenWindows[asset] = window;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnDestroy()
|
||||||
|
{
|
||||||
|
if (m_ImageProcessingGraphAsset != null)
|
||||||
|
s_OpenWindows.Remove(m_ImageProcessingGraphAsset);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CreateGUI()
|
||||||
|
{
|
||||||
|
VisualElement root = rootVisualElement;
|
||||||
|
var VariableNodes = m_ImageProcessingGraphAsset.GetAllVariableNodesWithTypes();
|
||||||
|
|
||||||
|
foreach (var VARIABLE in VariableNodes)
|
||||||
|
{
|
||||||
|
VariableNodeBase node = VARIABLE.node as VariableNodeBase;
|
||||||
|
|
||||||
|
PropertyField pField = new PropertyField();
|
||||||
|
pField.AddToClassList("unity-property-field__inspector-property");
|
||||||
|
root.Add(pField);
|
||||||
|
|
||||||
|
ListView listView = new ListView();
|
||||||
|
listView.AddToClassList("unity-list-view--with-footer");
|
||||||
|
listView.AddToClassList("unity-list-view--with-header");
|
||||||
|
pField.Add(listView);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
12
Editor/Scripts/Editor/Batching/Window/BatchingWindow.cs.meta
Normal file
12
Editor/Scripts/Editor/Batching/Window/BatchingWindow.cs.meta
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: df3ef54632d074a4ba43a0d64818221f
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences:
|
||||||
|
- m_VisualTreeAsset: {fileID: 9197481963319205126, guid: 22c3ed385a3ddb541b517dcf84c10c50, type: 3}
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
5
Editor/Scripts/Editor/Batching/Window/BatchingWindow.uss
Normal file
5
Editor/Scripts/Editor/Batching/Window/BatchingWindow.uss
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
.custom-label {
|
||||||
|
font-size: 20px;
|
||||||
|
-unity-font-style: bold;
|
||||||
|
color: rgb(68, 138, 255);
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 91d4a8403aa650147a5dd86a09928f14
|
||||||
|
ScriptedImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0}
|
||||||
|
disableValidation: 0
|
@ -0,0 +1,3 @@
|
|||||||
|
<engine:UXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:engine="UnityEngine.UIElements" xmlns:editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="False">
|
||||||
|
<Style src="project://database/Assets/Unity%20Image%20Processing/Editor/Scripts/Editor/Batching/Window/BatchingWindow.uss?fileID=7433441132597879392&guid=91d4a8403aa650147a5dd86a09928f14&type=3#BatchingWindow" />
|
||||||
|
</engine:UXML>
|
@ -0,0 +1,10 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 22c3ed385a3ddb541b517dcf84c10c50
|
||||||
|
ScriptedImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
|
@ -28,7 +28,7 @@ namespace ImageProcessingGraph.Editor.Nodes.Types.Image.From_Path_Nodes
|
|||||||
public override void CleanUp()
|
public override void CleanUp()
|
||||||
{
|
{
|
||||||
output = null;
|
output = null;
|
||||||
path = null;
|
path = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,12 @@ using UnityEngine;
|
|||||||
|
|
||||||
namespace ImageProcessingGraph.Editor.Nodes.Types.Image.Variable_Node
|
namespace ImageProcessingGraph.Editor.Nodes.Types.Image.Variable_Node
|
||||||
{
|
{
|
||||||
public class VariableNode<T> : BaseImageNode
|
public class VariableNodeBase : BaseImageNode
|
||||||
|
{
|
||||||
|
[NodeAttributes.Input("Variable Name")] public string variableName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class VariableNode<T> : VariableNodeBase
|
||||||
{
|
{
|
||||||
public T input;
|
public T input;
|
||||||
[NodeAttributes.Output("Output")] public T output;
|
[NodeAttributes.Output("Output")] public T output;
|
||||||
|
@ -26,5 +26,11 @@ namespace ImageProcessingGraph.Editor.Windows
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MenuItem("Test/TEser", false, 1)]
|
||||||
|
public static void OpenBatchingWindow()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user