Fix prefab preview to wait for the assets streaming
This commit is contained in:
@@ -1332,6 +1332,11 @@ MaterialBase* AnimatedModel::GetMaterial(int32 entryIndex)
|
||||
return material;
|
||||
}
|
||||
|
||||
ModelBase* AnimatedModel::GetModel()
|
||||
{
|
||||
return SkinnedModel.Get();
|
||||
}
|
||||
|
||||
bool AnimatedModel::IntersectsEntry(int32 entryIndex, const Ray& ray, Real& distance, Vector3& normal)
|
||||
{
|
||||
auto model = SkinnedModel.Get();
|
||||
|
||||
@@ -476,6 +476,7 @@ public:
|
||||
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override;
|
||||
const Span<MaterialSlot> GetMaterialSlots() const override;
|
||||
MaterialBase* GetMaterial(int32 entryIndex) override;
|
||||
ModelBase* GetModel() override;
|
||||
bool IntersectsEntry(int32 entryIndex, const Ray& ray, Real& distance, Vector3& normal) override;
|
||||
bool IntersectsEntry(const Ray& ray, Real& distance, Vector3& normal, int32& entryIndex) override;
|
||||
bool GetMeshData(const MeshReference& ref, MeshBufferType type, BytesContainer& result, int32& count, GPUVertexLayout** layout) const override;
|
||||
|
||||
@@ -66,6 +66,11 @@ public:
|
||||
/// <param name="entryIndex">The material slot entry index.</param>
|
||||
API_FUNCTION(Sealed) virtual MaterialBase* GetMaterial(int32 entryIndex) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the model (base class).
|
||||
/// </summary>
|
||||
API_FUNCTION(Sealed) virtual ModelBase* GetModel() = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Sets the material to the entry slot. Can be used to override the material of the meshes using this slot.
|
||||
/// </summary>
|
||||
|
||||
@@ -367,6 +367,11 @@ MaterialBase* SplineModel::GetMaterial(int32 entryIndex)
|
||||
return material;
|
||||
}
|
||||
|
||||
ModelBase* SplineModel::GetModel()
|
||||
{
|
||||
return Model.Get();
|
||||
}
|
||||
|
||||
void SplineModel::UpdateBounds()
|
||||
{
|
||||
OnSplineUpdated();
|
||||
|
||||
@@ -117,6 +117,7 @@ public:
|
||||
void OnParentChanged() override;
|
||||
const Span<MaterialSlot> GetMaterialSlots() const override;
|
||||
MaterialBase* GetMaterial(int32 entryIndex) override;
|
||||
ModelBase* GetModel() override;
|
||||
void UpdateBounds() override;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -599,6 +599,11 @@ MaterialBase* StaticModel::GetMaterial(int32 entryIndex)
|
||||
return material;
|
||||
}
|
||||
|
||||
ModelBase* StaticModel::GetModel()
|
||||
{
|
||||
return Model.Get();
|
||||
}
|
||||
|
||||
bool StaticModel::IntersectsEntry(int32 entryIndex, const Ray& ray, Real& distance, Vector3& normal)
|
||||
{
|
||||
auto model = Model.Get();
|
||||
|
||||
@@ -178,6 +178,7 @@ public:
|
||||
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override;
|
||||
const Span<MaterialSlot> GetMaterialSlots() const override;
|
||||
MaterialBase* GetMaterial(int32 entryIndex) override;
|
||||
ModelBase* GetModel() override;
|
||||
bool IntersectsEntry(int32 entryIndex, const Ray& ray, Real& distance, Vector3& normal) override;
|
||||
bool IntersectsEntry(const Ray& ray, Real& distance, Vector3& normal, int32& entryIndex) override;
|
||||
bool GetMeshData(const MeshReference& ref, MeshBufferType type, BytesContainer& result, int32& count, GPUVertexLayout** layout) const override;
|
||||
|
||||
Reference in New Issue
Block a user