Merge remote-tracking branch 'origin/gi' into large-worlds

# Conflicts:
#	Source/Engine/Core/Math/Vector3.h
This commit is contained in:
Wojtek Figat
2022-05-21 19:45:13 +02:00
280 changed files with 7660 additions and 2355 deletions

View File

@@ -27,6 +27,17 @@ namespace FlaxEditor.Modules.SourceCodeEditing
{
}
/// <summary>
/// Gets the tooltip text for the type.
/// </summary>
/// <param name="type">The type.</param>
/// <param name="attributes">The type attributes. Optional, if null type attributes will be used.</param>
/// <returns>The documentation tooltip.</returns>
public string GetTooltip(Type type, object[] attributes = null)
{
return GetTooltip(new ScriptType(type), attributes);
}
/// <summary>
/// Gets the tooltip text for the type.
/// </summary>
@@ -62,6 +73,19 @@ namespace FlaxEditor.Modules.SourceCodeEditing
return text;
}
/// <summary>
/// Gets the tooltip text for the type member.
/// </summary>
/// <param name="type">The type.</param>
/// <param name="memberName">The member name.</param>
/// <param name="attributes">The member attributes. Optional, if null member attributes will be used.</param>
/// <returns>The documentation tooltip.</returns>
public string GetTooltip(Type type, string memberName, object[] attributes = null)
{
var member = new ScriptType(type).GetMember(memberName, MemberTypes.All, BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance);
return GetTooltip(member, attributes);
}
/// <summary>
/// Gets the tooltip text for the type member.
/// </summary>

View File

@@ -58,6 +58,7 @@ namespace FlaxEditor.Modules
private ContextMenuButton _menuToolsBakeAllEnvProbes;
private ContextMenuButton _menuToolsBuildCSGMesh;
private ContextMenuButton _menuToolsBuildNavMesh;
private ContextMenuButton _menuToolsBuildAllMesgesSDF;
private ContextMenuButton _menuToolsCancelBuilding;
private ContextMenuButton _menuToolsSetTheCurrentSceneViewAsDefault;
private ContextMenuChildMenu _menuWindowApplyWindowLayout;
@@ -484,6 +485,7 @@ namespace FlaxEditor.Modules
_menuToolsBakeAllEnvProbes = cm.AddButton("Bake all env probes", BakeAllEnvProbes);
_menuToolsBuildCSGMesh = cm.AddButton("Build CSG mesh", BuildCSG);
_menuToolsBuildNavMesh = cm.AddButton("Build Nav Mesh", BuildNavMesh);
_menuToolsBuildAllMesgesSDF = cm.AddButton("Build all meshes SDF", BuildAllMeshesSDF);
cm.AddSeparator();
cm.AddButton("Game Cooker", Editor.Windows.GameCookerWin.FocusOrShow);
_menuToolsCancelBuilding = cm.AddButton("Cancel building game", () => GameCooker.Cancel());
@@ -709,6 +711,7 @@ namespace FlaxEditor.Modules
_menuToolsBakeLightmaps.Text = isBakingLightmaps ? "Cancel baking lightmaps" : "Bake lightmaps";
_menuToolsClearLightmaps.Enabled = canEdit;
_menuToolsBakeAllEnvProbes.Enabled = canEdit;
_menuToolsBuildAllMesgesSDF.Enabled = canEdit && !isBakingLightmaps;
_menuToolsBuildCSGMesh.Enabled = canEdit;
_menuToolsBuildNavMesh.Enabled = canEdit;
_menuToolsCancelBuilding.Enabled = GameCooker.IsRunning;
@@ -836,6 +839,24 @@ namespace FlaxEditor.Modules
Editor.Scene.MarkSceneEdited(scenes);
}
private void BuildAllMeshesSDF()
{
// TODO: async maybe with progress reporting?
Editor.Scene.ExecuteOnGraph(node =>
{
if (node is StaticModelNode staticModelNode && staticModelNode.Actor is StaticModel staticModel)
{
if (staticModel.DrawModes.HasFlag(DrawPass.GlobalSDF) && staticModel.Model != null && !staticModel.Model.IsVirtual && staticModel.Model.SDF.Texture == null)
{
Editor.Log("Generating SDF for " + staticModel.Model);
if (!staticModel.Model.GenerateSDF())
staticModel.Model.Save();
}
}
return true;
});
}
private void SetTheCurrentSceneViewAsDefault()
{
var projectInfo = Editor.GameProject;