From dd2e2c5b3a0e0ee8427c1b8f6ad917d7f165ebbf Mon Sep 17 00:00:00 2001 From: Saas Date: Sat, 14 Feb 2026 18:35:13 +0100 Subject: [PATCH 1/3] add some utility for copying parameter names to parameter right click menu --- Source/Editor/Surface/VisjectSurfaceWindow.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Source/Editor/Surface/VisjectSurfaceWindow.cs b/Source/Editor/Surface/VisjectSurfaceWindow.cs index 7c2cb23ad..26cfe9e95 100644 --- a/Source/Editor/Surface/VisjectSurfaceWindow.cs +++ b/Source/Editor/Surface/VisjectSurfaceWindow.cs @@ -708,12 +708,27 @@ namespace FlaxEditor.Surface { var index = (int)label.Tag; menu.AddSeparator(); + menu.AddButton("Copy name", () => Clipboard.Text = ((IVisjectSurfaceWindow)Values[0]).VisjectSurface.Parameters[index].Name); + menu.AddButton("Copy all names", () => Clipboard.Text = GetAllParamterNamesAsConstantCSharpCode()); + menu.AddSeparator(); menu.AddButton("Rename", () => StartParameterRenaming(index, label)); menu.AddButton("Edit attributes...", () => EditAttributesParameter(index, label)); menu.AddButton("Delete", () => DeleteParameter(index)); OnParamContextMenu(index, menu); } + private string GetAllParamterNamesAsConstantCSharpCode() + { + string allParamNames = ""; + foreach (var param in ((IVisjectSurfaceWindow)Values[0]).VisjectSurface.Parameters) + { + string cleanParamName = param.Name.Replace(" ", ""); + allParamNames += $"private const string {cleanParamName}ParameterName = \"{param.Name}\";\n"; + } + + return allParamNames; + } + private void StartParameterRenaming(int index, Control label) { var window = (IVisjectSurfaceWindow)Values[0]; From 0870a86a3ab87ef44970785f5f42644667dba065 Mon Sep 17 00:00:00 2001 From: Saas Date: Sat, 14 Feb 2026 18:56:58 +0100 Subject: [PATCH 2/3] remove non parameters from parameter list --- Source/Editor/Surface/VisjectSurfaceWindow.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/Editor/Surface/VisjectSurfaceWindow.cs b/Source/Editor/Surface/VisjectSurfaceWindow.cs index 26cfe9e95..109499c35 100644 --- a/Source/Editor/Surface/VisjectSurfaceWindow.cs +++ b/Source/Editor/Surface/VisjectSurfaceWindow.cs @@ -723,6 +723,9 @@ namespace FlaxEditor.Surface foreach (var param in ((IVisjectSurfaceWindow)Values[0]).VisjectSurface.Parameters) { string cleanParamName = param.Name.Replace(" ", ""); + // Filter out headers and other non-parameter entries that can be present in the parameters list + if (string.IsNullOrEmpty(cleanParamName)) + continue; allParamNames += $"private const string {cleanParamName}ParameterName = \"{param.Name}\";\n"; } From 57489abc3a2bc195b599f84c77aa572385fc8779 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Sun, 8 Mar 2026 22:37:17 +0100 Subject: [PATCH 3/3] Minor adjustment to #3934 --- Source/Editor/Surface/VisjectSurfaceWindow.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Editor/Surface/VisjectSurfaceWindow.cs b/Source/Editor/Surface/VisjectSurfaceWindow.cs index 109499c35..3151f9b17 100644 --- a/Source/Editor/Surface/VisjectSurfaceWindow.cs +++ b/Source/Editor/Surface/VisjectSurfaceWindow.cs @@ -709,7 +709,8 @@ namespace FlaxEditor.Surface var index = (int)label.Tag; menu.AddSeparator(); menu.AddButton("Copy name", () => Clipboard.Text = ((IVisjectSurfaceWindow)Values[0]).VisjectSurface.Parameters[index].Name); - menu.AddButton("Copy all names", () => Clipboard.Text = GetAllParamterNamesAsConstantCSharpCode()); + // TODO: move 'Copy all names' to context menu of the Properties category (as it's not item-specific) + menu.AddButton("Copy all names", CopyAllParameterNamesAsConstantCSharpCode); menu.AddSeparator(); menu.AddButton("Rename", () => StartParameterRenaming(index, label)); menu.AddButton("Edit attributes...", () => EditAttributesParameter(index, label)); @@ -717,7 +718,7 @@ namespace FlaxEditor.Surface OnParamContextMenu(index, menu); } - private string GetAllParamterNamesAsConstantCSharpCode() + private void CopyAllParameterNamesAsConstantCSharpCode() { string allParamNames = ""; foreach (var param in ((IVisjectSurfaceWindow)Values[0]).VisjectSurface.Parameters) @@ -728,8 +729,7 @@ namespace FlaxEditor.Surface continue; allParamNames += $"private const string {cleanParamName}ParameterName = \"{param.Name}\";\n"; } - - return allParamNames; + Clipboard.Text = allParamNames; } private void StartParameterRenaming(int index, Control label)