Merge remote-tracking branch 'origin/master' into 1.11

This commit is contained in:
Wojtek Figat
2025-06-25 10:48:11 +02:00
12 changed files with 214 additions and 16 deletions

View File

@@ -26,6 +26,7 @@ namespace FlaxEditor.CustomEditors.Editors
new OptionType("Texture 9-Slicing", typeof(Texture9SlicingBrush)),
new OptionType("Sprite 9-Slicing", typeof(Sprite9SlicingBrush)),
new OptionType("Video", typeof(VideoBrush)),
new OptionType("UI Brush", typeof(UIBrush)),
};
}
}

View File

@@ -287,10 +287,7 @@ namespace FlaxEditor.CustomEditors
/// <returns>The created element.</returns>
public ImageElement Image(SpriteHandle sprite)
{
var element = new ImageElement();
element.Image.Brush = new SpriteBrush(sprite);
OnAddElement(element);
return element;
return Image(new SpriteBrush(sprite));
}
/// <summary>
@@ -300,10 +297,7 @@ namespace FlaxEditor.CustomEditors
/// <returns>The created element.</returns>
public ImageElement Image(Texture texture)
{
var element = new ImageElement();
element.Image.Brush = new TextureBrush(texture);
OnAddElement(element);
return element;
return Image(new TextureBrush(texture));
}
/// <summary>
@@ -312,9 +306,19 @@ namespace FlaxEditor.CustomEditors
/// <param name="texture">The GPU texture.</param>
/// <returns>The created element.</returns>
public ImageElement Image(GPUTexture texture)
{
return Image(new GPUTextureBrush(texture));
}
/// <summary>
/// Adds brush image to the layout.
/// </summary>
/// <param name="brush">The brush.</param>
/// <returns>The created element.</returns>
public ImageElement Image(IBrush brush)
{
var element = new ImageElement();
element.Image.Brush = new GPUTextureBrush(texture);
element.Image.Brush = brush;
OnAddElement(element);
return element;
}

View File

@@ -459,7 +459,7 @@ namespace FlaxEditor.Surface.Archetypes
AlternativeTitles = new string[] { "Lightmap TexCoord" },
Description = "Lightmap UVs",
Flags = NodeFlags.MaterialGraph,
Size = new Float2(110, 30),
Size = new Float2(110, 20),
Elements = new []
{
NodeElementArchetype.Factory.Output(0, "UVs", typeof(Float2), 0)
@@ -493,6 +493,19 @@ namespace FlaxEditor.Surface.Archetypes
NodeElementArchetype.Factory.Bool(190, Surface.Constants.LayoutOffsetY * 4, 4),
}
},
new NodeArchetype
{
TypeID = 24,
Title = "Texture Size",
Description = "Gets the size of the texture (in pixels). If texture is during streaming, then returns size of the highest resident mip.",
Flags = NodeFlags.ParticleEmitterGraph,
Size = new Float2(160, 20),
Elements = new[]
{
NodeElementArchetype.Factory.Input(0, "Texture", true, typeof(FlaxEngine.Object), 0),
NodeElementArchetype.Factory.Output(0, "Size", typeof(Float3), 1),
}
},
};
}
}