TextureAsset properties, start of better asset pipeline detection

This commit is contained in:
Simon Lübeß
2024-06-12 16:51:52 +02:00
parent b3dac4a338
commit 36e98311c6
12 changed files with 267 additions and 48 deletions
+4 -4
View File
@@ -23,13 +23,13 @@ abstract class Config
return true;
}
public abstract void ShowEditor();
public abstract void ShowEditor(AssetFile assetFile);
}
[BonTarget, BonPolyRegister]
class AssetImporterConfig : Config
{
public override void ShowEditor()
public override void ShowEditor(AssetFile assetFile)
{
}
@@ -38,7 +38,7 @@ class AssetImporterConfig : Config
[BonTarget, BonPolyRegister]
class AssetProcessorConfig : Config
{
public override void ShowEditor()
public override void ShowEditor(AssetFile assetFile)
{
}
@@ -56,7 +56,7 @@ class AssetExporterConfig : Config
set => SetIfChanged(ref _compression, value);
}
public override void ShowEditor()
public override void ShowEditor(AssetFile assetFile)
{
ImGui.PropertyTableStartNewProperty("Compression");
ImGui.AttachTooltip("Specifies the compression method used to compress the processed asset.");
@@ -12,19 +12,28 @@ interface IAssetImporter
AssetImporterConfig CreateDefaultConfig();
/// The type that ImportedResource returns.
static Type ProcessedAssetType { get; }
Result<ImportedResource> Import(StringView fullFileName, AssetIdentifier assetIdentifier, AssetImporterConfig config);
}
interface IAssetProcessor
{
AssetProcessorConfig CreateDefaultConfig();
/// The asset type that this processor can process.
static Type ProcessedAssetType { get; }
Result<ProcessedResource> Process(ImportedResource importedResource, AssetProcessorConfig config);
Result<void> Process(ImportedResource importedResource, AssetProcessorConfig config, List<ProcessedResource> outProcessedResources);
}
interface IAssetExporter
{
AssetExporterConfig CreateDefaultConfig();
/// The asset type that this exporter can export.
static AssetType ExportedAssetType { get; }
Result<void> Export(Stream stream, ProcessedResource processedObject, AssetExporterConfig config);
}
@@ -40,7 +40,7 @@ class TextureImporterConfig : AssetImporterConfig
set => SetIfChanged(ref _isSrgb, value);
}
public override void ShowEditor()
public override void ShowEditor(AssetFile assetFile)
{
ImGui.PropertyTableStartNewProperty("Is sRGB");
ImGui.AttachTooltip("If checked, the texture will be forced to be imported as sRGB. Refer to the documentation for an detailed explanation what you should do here.");