Skip to content

Commit 74b09a5

Browse files
committed
BaseNode.EditorAttribute ---> BaseNode.NodeValueEditorAttribute
Renaming to avoid any potential conflicts with Sandbox.System.EditorAttribute
1 parent bcb38b1 commit 74b09a5

7 files changed

Lines changed: 28 additions & 28 deletions

File tree

game/addons/tools/Code/ShaderGraph/BaseNode.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,11 @@ public OutputAttribute( Type type = null )
151151
}
152152

153153
[System.AttributeUsage( AttributeTargets.Property )]
154-
public class EditorAttribute : Attribute
154+
public class NodeValueEditorAttribute : Attribute
155155
{
156156
public string ValueName;
157157

158-
public EditorAttribute( string valueName )
158+
public NodeValueEditorAttribute( string valueName )
159159
{
160160
ValueName = valueName;
161161
}
@@ -387,7 +387,7 @@ public NodeInput GetInput( BaseNode node )
387387

388388
public ValueEditor CreateEditor( NodeUI node, Plug plug, Type type )
389389
{
390-
var editor = Property?.GetCustomAttribute<BaseNode.EditorAttribute>();
390+
var editor = Property?.GetCustomAttribute<BaseNode.NodeValueEditorAttribute>();
391391

392392
if ( editor is not null )
393393
{

game/addons/tools/Code/ShaderGraph/Compiler/GraphCompiler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ private string GetPropertyValue( PropertyInfo property, Result resultNode )
905905
}
906906
else
907907
{
908-
var editorAttribute = property.GetCustomAttribute<BaseNode.EditorAttribute>();
908+
var editorAttribute = property.GetCustomAttribute<BaseNode.NodeValueEditorAttribute>();
909909
if ( editorAttribute == null )
910910
return null;
911911

@@ -1097,7 +1097,7 @@ private string GenerateMaterial()
10971097
}
10981098
else
10991099
{
1100-
var editorAttribute = property.GetCustomAttribute<BaseNode.EditorAttribute>();
1100+
var editorAttribute = property.GetCustomAttribute<BaseNode.NodeValueEditorAttribute>();
11011101
if ( editorAttribute == null )
11021102
continue;
11031103

game/addons/tools/Code/ShaderGraph/Result.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public sealed class Result : BaseResult
2626
[ShowIf( nameof( IsLit ), true )]
2727
public NodeInput Emission { get; set; }
2828

29-
[Hide, Editor( nameof( DefaultOpacity ) )]
29+
[Hide, NodeValueEditor( nameof( DefaultOpacity ) )]
3030
[Input( typeof( float ) )]
3131
public NodeInput Opacity { get; set; }
3232

@@ -35,17 +35,17 @@ public sealed class Result : BaseResult
3535
[ShowIf( nameof( IsLit ), true )]
3636
public NodeInput Normal { get; set; }
3737

38-
[Hide, Editor( nameof( DefaultRoughness ) )]
38+
[Hide, NodeValueEditor( nameof( DefaultRoughness ) )]
3939
[Input( typeof( float ) )]
4040
[ShowIf( nameof( IsLit ), true )]
4141
public NodeInput Roughness { get; set; }
4242

43-
[Hide, Editor( nameof( DefaultMetalness ) )]
43+
[Hide, NodeValueEditor( nameof( DefaultMetalness ) )]
4444
[Input( typeof( float ) )]
4545
[ShowIf( nameof( IsLit ), true )]
4646
public NodeInput Metalness { get; set; }
4747

48-
[Hide, Editor( nameof( DefaultAmbientOcclusion ) )]
48+
[Hide, NodeValueEditor( nameof( DefaultAmbientOcclusion ) )]
4949
[Input( typeof( float ) )]
5050
[ShowIf( nameof( IsLit ), true )]
5151
public NodeInput AmbientOcclusion { get; set; }

game/editor/ShaderGraph/Code/Nodes/Binary.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public sealed class Lerp : ShaderNode
128128
public NodeInput B { get; set; }
129129

130130
[Input( typeof( float ) ), Title( "Fraction" )]
131-
[Hide, Editor( nameof( Fraction ) )]
131+
[Hide, NodeValueEditor( nameof( Fraction ) )]
132132
public NodeInput C { get; set; }
133133

134134
[InputDefault( nameof( A ) )]
@@ -215,28 +215,28 @@ public sealed class RemapValue : ShaderNode
215215
/// The minimum range of the input
216216
/// </summary>
217217
[Input( typeof( float ) ), Title( "In Min" )]
218-
[Hide, Editor( nameof( InMin ) )]
218+
[Hide, NodeValueEditor( nameof( InMin ) )]
219219
public NodeInput B { get; set; }
220220

221221
/// <summary>
222222
/// The maximum range of the input
223223
/// </summary>
224224
[Input( typeof( float ) ), Title( "In Max" )]
225-
[Hide, Editor( nameof( InMax ) )]
225+
[Hide, NodeValueEditor( nameof( InMax ) )]
226226
public NodeInput C { get; set; }
227227

228228
/// <summary>
229229
/// The output minimum range the input should map to
230230
/// </summary>
231231
[Input( typeof( float ) ), Title( "Out Min" )]
232-
[Hide, Editor( nameof( OutMin ) )]
232+
[Hide, NodeValueEditor( nameof( OutMin ) )]
233233
public NodeInput D { get; set; }
234234

235235
/// <summary>
236236
/// The output maximum range the input should map to
237237
/// </summary>
238238
[Input( typeof( float ) ), Title( "Out Max" )]
239-
[Hide, Editor( nameof( OutMax ) )]
239+
[Hide, NodeValueEditor( nameof( OutMax ) )]
240240
public NodeInput E { get; set; }
241241

242242
/// <summary>

game/editor/ShaderGraph/Code/Nodes/Noise.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ public sealed class VoronoiNoise : ShaderNode
6363
public NodeInput Coords { get; set; }
6464

6565
[Input( typeof( float ) ), Title( "Angle Offset" )]
66-
[Hide, Editor( nameof( AngleOffset ) )]
66+
[Hide, NodeValueEditor( nameof( AngleOffset ) )]
6767
[MinMax( 0.0f, 6.28319f )]
6868
public NodeInput A { get; set; }
6969

7070
[Input( typeof( float ) ), Title( "Cell Density" )]
71-
[Hide, Editor( nameof( CellDensity ) )]
71+
[Hide, NodeValueEditor( nameof( CellDensity ) )]
7272
[MinMax( 0.0f, 100.0f )]
7373
public NodeInput B { get; set; }
7474

game/editor/ShaderGraph/Code/Nodes/Parameter.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public sealed class Float : ParameterNode<float>
1010
[Hide] public float Step => UI.Step;
1111

1212
[Output( typeof( float ) ), Title( "Value" )]
13-
[Hide, Editor( nameof( Value ) ), Range( nameof( Min ), nameof( Max ), nameof( Step ) )]
13+
[Hide, NodeValueEditor( nameof( Value ) ), Range( nameof( Min ), nameof( Max ), nameof( Step ) )]
1414
public NodeResult.Func Result => ( GraphCompiler compiler ) =>
1515
{
1616
return compiler.ResultParameter( Name, Value, Min, Max, Min != Max, IsAttribute, UI );
@@ -81,14 +81,14 @@ public float ValueY
8181
/// <summary>
8282
/// X component of result
8383
/// </summary>
84-
[Output( typeof( float ) ), Hide, Editor( nameof( ValueX ) ), Title( "X" )]
84+
[Output( typeof( float ) ), Hide, NodeValueEditor( nameof( ValueX ) ), Title( "X" )]
8585
[Range( nameof( MinX ), nameof( MaxX ), nameof( Step ) )]
8686
public NodeResult.Func X => ( GraphCompiler compiler ) => Component( "x", ValueX, compiler );
8787

8888
/// <summary>
8989
/// Y component of result
9090
/// </summary>
91-
[Output( typeof( float ) ), Hide, Editor( nameof( ValueY ) ), Title( "Y" )]
91+
[Output( typeof( float ) ), Hide, NodeValueEditor( nameof( ValueY ) ), Title( "Y" )]
9292
[Range( nameof( MinY ), nameof( MaxY ), nameof( Step ) )]
9393
public NodeResult.Func Y => ( GraphCompiler compiler ) => Component( "y", ValueY, compiler );
9494

@@ -157,21 +157,21 @@ public float ValueZ
157157
/// <summary>
158158
/// X component of result
159159
/// </summary>
160-
[Output( typeof( float ) ), Hide, Editor( nameof( ValueX ) ), Title( "X" )]
160+
[Output( typeof( float ) ), Hide, NodeValueEditor( nameof( ValueX ) ), Title( "X" )]
161161
[Range( nameof( MinX ), nameof( MaxX ), nameof( Step ) )]
162162
public NodeResult.Func X => ( GraphCompiler compiler ) => Component( "x", ValueX, compiler );
163163

164164
/// <summary>
165165
/// Y component of result
166166
/// </summary>
167-
[Output( typeof( float ) ), Hide, Editor( nameof( ValueY ) ), Title( "Y" )]
167+
[Output( typeof( float ) ), Hide, NodeValueEditor( nameof( ValueY ) ), Title( "Y" )]
168168
[Range( nameof( MinY ), nameof( MaxY ), nameof( Step ) )]
169169
public NodeResult.Func Y => ( GraphCompiler compiler ) => Component( "y", ValueY, compiler );
170170

171171
/// <summary>
172172
/// Z component of result
173173
/// </summary>
174-
[Output( typeof( float ) ), Hide, Editor( nameof( ValueZ ) ), Title( "Z" )]
174+
[Output( typeof( float ) ), Hide, NodeValueEditor( nameof( ValueZ ) ), Title( "Z" )]
175175
[Range( nameof( MinZ ), nameof( MaxZ ), nameof( Step ) )]
176176
public NodeResult.Func Z => ( GraphCompiler compiler ) => Component( "z", ValueZ, compiler );
177177

@@ -193,7 +193,7 @@ public override Vector4 GetRangeMax()
193193
public sealed class Float4 : ParameterNode<Color>
194194
{
195195
[Output( typeof( Color ) ), Title( "RGBA" )]
196-
[Hide, Editor( nameof( Value ) )]
196+
[Hide, NodeValueEditor( nameof( Value ) )]
197197
public NodeResult.Func Result => ( GraphCompiler compiler ) =>
198198
{
199199
return compiler.ResultParameter( Name, Value, default, default, false, IsAttribute, UI );
@@ -230,25 +230,25 @@ public float ValueA
230230
/// <summary>
231231
/// Red component of result
232232
/// </summary>
233-
[Output( typeof( float ) ), Hide, Editor( nameof( ValueR ) ), Title( "Red" )]
233+
[Output( typeof( float ) ), Hide, NodeValueEditor( nameof( ValueR ) ), Title( "Red" )]
234234
public NodeResult.Func R => ( GraphCompiler compiler ) => Component( "r", ValueR, compiler );
235235

236236
/// <summary>
237237
/// Green component of result
238238
/// </summary>
239-
[Output( typeof( float ) ), Hide, Editor( nameof( ValueG ) ), Title( "Green" )]
239+
[Output( typeof( float ) ), Hide, NodeValueEditor( nameof( ValueG ) ), Title( "Green" )]
240240
public NodeResult.Func G => ( GraphCompiler compiler ) => Component( "g", ValueG, compiler );
241241

242242
/// <summary>
243243
/// Green component of result
244244
/// </summary>
245-
[Output( typeof( float ) ), Hide, Editor( nameof( ValueB ) ), Title( "Blue" )]
245+
[Output( typeof( float ) ), Hide, NodeValueEditor( nameof( ValueB ) ), Title( "Blue" )]
246246
public NodeResult.Func B => ( GraphCompiler compiler ) => Component( "b", ValueB, compiler );
247247

248248
/// <summary>
249249
/// Alpha component of result
250250
/// </summary>
251-
[Output( typeof( float ) ), Hide, Editor( nameof( ValueA ) ), Title( "Alpha" )]
251+
[Output( typeof( float ) ), Hide, NodeValueEditor( nameof( ValueA ) ), Title( "Alpha" )]
252252
public NodeResult.Func A => ( GraphCompiler compiler ) => Component( "a", ValueA, compiler );
253253

254254
public Float4()

game/editor/ShaderGraph/Code/Nodes/Transform.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ public sealed class Blend : ShaderNode
301301
public NodeInput B { get; set; }
302302

303303
[Input( typeof( float ) ), Title( "Fraction" )]
304-
[Hide, Editor( nameof( Fraction ) )]
304+
[Hide, NodeValueEditor( nameof( Fraction ) )]
305305
public NodeInput C { get; set; }
306306

307307
[InputDefault( nameof( A ) )]

0 commit comments

Comments
 (0)