Refactor mesh import, meshlet, and asset handler systems

- Mesh import now builds full node hierarchy and splits geometry by material, with robust normal/tangent handling
- Meshlet generation supports material indices for correct assignment
- Refactored texture cube map compression and mipmap handling
- Updated asset handler registration to new namespace
- Enabled asset reimport on import events
- Improved code quality, resource management, and formatting
This commit is contained in:
2026-04-26 14:49:58 +09:00
parent 1a91811621
commit 5903ddda2b
8 changed files with 218 additions and 169 deletions

View File

@@ -66,13 +66,13 @@ internal static class ActivationHandler
AllocationManager.Initialize(opts);
//var assetRegistry = App.GetService<IAssetRegistry>();
//var engineCore = App.GetService<EngineCore>();
var assetRegistry = App.GetService<IAssetRegistry>();
var engineCore = App.GetService<EngineCore>();
//assetRegistry.OnAssetImported += (sender, e) =>
//{
// engineCore.AssetManager.ReimportAsset(e);
//};
assetRegistry.OnAssetImported += (sender, e) =>
{
engineCore.AssetManager.ReimportAsset(e);
};
return ValueTask.CompletedTask;
}

View File

@@ -1,13 +1,13 @@
using CommunityToolkit.Mvvm.ComponentModel;
using Ghost.Core.Utilities;
using Ghost.Editor.Core;
using Ghost.Editor.Core.Assets;
using Ghost.Editor.Core.Contracts;
using Ghost.Editor.Core.Utilities;
using Ghost.Editor.Models;
using Ghost.Editor.Core.AssetHandler;
using System.Collections.ObjectModel;
using Microsoft.UI.Dispatching;
using Ghost.Engine;
using Ghost.Core.Utilities;
using Microsoft.UI.Dispatching;
using System.Collections.ObjectModel;
namespace Ghost.Editor.ViewModels.Controls;
@@ -69,7 +69,7 @@ internal partial class ContentBrowserViewModel : ObservableObject
var fullPath = PathUtility.Normalize(e.AssetPath);
var dirPath = Path.GetDirectoryName(fullPath);
if (string.Equals(dirPath, CurrentDirectoryPath, StringComparison.OrdinalIgnoreCase))
{
_dispatcherQueue.TryEnqueue(() =>
@@ -86,7 +86,7 @@ internal partial class ContentBrowserViewModel : ObservableObject
if (!Files.Any(f => string.Equals(f.Path, fullPath, StringComparison.OrdinalIgnoreCase)))
{
var isDir = Directory.Exists(fullPath);
AssetType assetType = AssetType.Unknown;
var assetType = AssetType.Unknown;
if (!isDir)
{
var ext = Path.GetExtension(fullPath);