SCARY STUFF VERY EARLY

This commit is contained in:
Chromium 2025-05-03 06:10:58 +01:00
parent f5c9b2833c
commit f1824f8b5e
13 changed files with 154 additions and 2 deletions

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 32f2e21024994d43a7bc90a006dcd70f
timeCreated: 1746242052

View 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);
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: ba9a14be40ae49b190ae8dd220fb7448
timeCreated: 1746242057

View File

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

View 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);
}
}
}

View 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:

View File

@ -0,0 +1,5 @@
.custom-label {
font-size: 20px;
-unity-font-style: bold;
color: rgb(68, 138, 255);
}

View File

@ -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

View File

@ -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&amp;guid=91d4a8403aa650147a5dd86a09928f14&amp;type=3#BatchingWindow" />
</engine:UXML>

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 22c3ed385a3ddb541b517dcf84c10c50
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}

View File

@ -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 = "";
} }
} }

View File

@ -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;

View File

@ -26,5 +26,11 @@ namespace ImageProcessingGraph.Editor.Windows
} }
} }
[MenuItem("Test/TEser", false, 1)]
public static void OpenBatchingWindow()
{
}
} }
} }