Add support for editing texture group in editor (without reimporting)

This commit is contained in:
Wojtek Figat
2021-06-18 10:49:04 +02:00
parent 2d88ed17d4
commit 3b31fd7c71
16 changed files with 141 additions and 91 deletions

View File

@@ -570,7 +570,7 @@ bool Model::Init(const Span<int32>& meshesCountPerLod)
}
// Dispose previous data and disable streaming (will start data uploading tasks manually)
stopStreaming();
StopStreaming();
// Setup
MaterialSlots.Resize(1);
@@ -827,7 +827,7 @@ Asset::LoadResult Model::load()
#endif
// Request resource streaming
startStreaming(true);
StartStreaming(true);
return LoadResult::Ok;
}

View File

@@ -670,7 +670,7 @@ bool SkinnedModel::Init(const Span<int32>& meshesCountPerLod)
}
// Dispose previous data and disable streaming (will start data uploading tasks manually)
stopStreaming();
StopStreaming();
// Setup
MaterialSlots.Resize(1);
@@ -973,7 +973,7 @@ Asset::LoadResult SkinnedModel::load()
}
// Request resource streaming
startStreaming(true);
StartStreaming(true);
return LoadResult::Ok;
}

View File

@@ -17,6 +17,16 @@ Texture::Texture(const SpawnParams& params, const AssetInfo* info)
{
}
TextureFormatType Texture::GetFormatType() const
{
return _texture.GetFormatType();
}
bool Texture::IsNormalMap() const
{
return _texture.GetFormatType() == TextureFormatType::NormalMap;
}
#if USE_EDITOR
bool Texture::Save(const StringView& path, const InitData* customData)

View File

@@ -10,23 +10,16 @@
API_CLASS(NoSpawn) class FLAXENGINE_API Texture : public TextureBase
{
DECLARE_BINARY_ASSET_HEADER(Texture, TexturesSerializedVersion);
public:
/// <summary>
/// Gets the texture format type.
/// </summary>
FORCE_INLINE TextureFormatType GetFormatType() const
{
return _texture.GetFormatType();
}
TextureFormatType GetFormatType() const;
/// <summary>
/// Returns true if texture is a normal map.
/// </summary>
API_PROPERTY() FORCE_INLINE bool IsNormalMap() const
{
return GetFormatType() == TextureFormatType::NormalMap;
}
API_PROPERTY() bool IsNormalMap() const;
public: