Merge branch 'main' into sceneapi_script_autotest
This commit is contained in:
@@ -30,6 +30,8 @@ namespace AZ
|
||||
|
||||
virtual ~IAnimationData() override = default;
|
||||
|
||||
void CloneAttributesFrom([[maybe_unused]] const IGraphObject* sourceObject) override {}
|
||||
|
||||
virtual size_t GetKeyFrameCount() const = 0;
|
||||
virtual const MatrixType& GetKeyFrame(size_t index) const = 0;
|
||||
virtual double GetTimeStepBetweenFrames() const = 0;
|
||||
@@ -43,6 +45,8 @@ namespace AZ
|
||||
|
||||
virtual ~IBlendShapeAnimationData() override = default;
|
||||
|
||||
void CloneAttributesFrom([[maybe_unused]] const IGraphObject* sourceObject) override {}
|
||||
|
||||
virtual const char* GetBlendShapeName() const = 0;
|
||||
virtual size_t GetKeyFrameCount() const = 0;
|
||||
virtual double GetKeyFrame(size_t index) const = 0;
|
||||
|
||||
@@ -46,12 +46,15 @@ namespace AZ
|
||||
|
||||
virtual ~IBlendShapeData() override = default;
|
||||
|
||||
void CloneAttributesFrom([[maybe_unused]] const IGraphObject* sourceObject) override {}
|
||||
|
||||
virtual size_t GetUsedControlPointCount() const = 0;
|
||||
virtual int GetControlPointIndex(int vertexIndex) const = 0;
|
||||
virtual int GetUsedPointIndexForControlPoint(int controlPointIndex) const = 0;
|
||||
|
||||
virtual unsigned int GetVertexCount() const = 0;
|
||||
virtual unsigned int GetFaceCount() const = 0;
|
||||
virtual const Face& GetFaceInfo(unsigned int index) const = 0;
|
||||
|
||||
virtual const AZ::Vector3& GetPosition(unsigned int index) const = 0;
|
||||
virtual const AZ::Vector3& GetNormal(unsigned int index) const = 0;
|
||||
|
||||
@@ -31,6 +31,8 @@ namespace AZ
|
||||
|
||||
virtual ~IBoneData() override = default;
|
||||
|
||||
void CloneAttributesFrom([[maybe_unused]] const IGraphObject* sourceObject) override {}
|
||||
|
||||
virtual const MatrixType& GetWorldTransform() const = 0;
|
||||
|
||||
void GetDebugOutput(AZ::SceneAPI::Utilities::DebugOutput& output) const override
|
||||
|
||||
@@ -47,6 +47,8 @@ namespace AZ
|
||||
|
||||
~IMaterialData() override = default;
|
||||
|
||||
void CloneAttributesFrom([[maybe_unused]] const IGraphObject* sourceObject) override {}
|
||||
|
||||
void GetDebugOutput(AZ::SceneAPI::Utilities::DebugOutput& output) const override
|
||||
{
|
||||
output.Write("MaterialName", GetMaterialName());
|
||||
|
||||
@@ -51,6 +51,15 @@ namespace AZ
|
||||
|
||||
virtual ~IMeshData() override = default;
|
||||
|
||||
void CloneAttributesFrom(const IGraphObject* sourceObject) override
|
||||
{
|
||||
if (const auto* typedSource = azrtti_cast<const IMeshData*>(sourceObject))
|
||||
{
|
||||
SetUnitSizeInMeters(typedSource->GetUnitSizeInMeters());
|
||||
SetOriginalUnitSizeInMeters(typedSource->GetOriginalUnitSizeInMeters());
|
||||
}
|
||||
}
|
||||
|
||||
virtual unsigned int GetVertexCount() const = 0;
|
||||
virtual bool HasNormalData() const = 0;
|
||||
|
||||
|
||||
@@ -36,6 +36,8 @@ namespace AZ
|
||||
|
||||
virtual ~IMeshVertexBitangentData() override = default;
|
||||
|
||||
void CloneAttributesFrom([[maybe_unused]] const IGraphObject* sourceObject) override {}
|
||||
|
||||
virtual size_t GetCount() const = 0;
|
||||
virtual const AZ::Vector3& GetBitangent(size_t index) const = 0;
|
||||
virtual void SetBitangent(size_t vertexIndex, const AZ::Vector3& bitangent) = 0;
|
||||
@@ -47,4 +49,4 @@ namespace AZ
|
||||
|
||||
} // DataTypes
|
||||
} // SceneAPI
|
||||
} // AZ
|
||||
} // AZ
|
||||
|
||||
@@ -88,6 +88,8 @@ namespace AZ
|
||||
|
||||
virtual ~IMeshVertexColorData() override = default;
|
||||
|
||||
void CloneAttributesFrom([[maybe_unused]] const IGraphObject* sourceObject) override {}
|
||||
|
||||
virtual const AZ::Name& GetCustomName() const = 0;
|
||||
|
||||
virtual size_t GetCount() const = 0;
|
||||
|
||||
@@ -47,6 +47,8 @@ namespace AZ
|
||||
|
||||
virtual ~IMeshVertexTangentData() override = default;
|
||||
|
||||
void CloneAttributesFrom([[maybe_unused]] const IGraphObject* sourceObject) override {}
|
||||
|
||||
virtual size_t GetCount() const = 0;
|
||||
virtual const AZ::Vector4& GetTangent(size_t index) const = 0;
|
||||
virtual void SetTangent(size_t vertexIndex, const AZ::Vector4& tangent) = 0;
|
||||
@@ -57,4 +59,4 @@ namespace AZ
|
||||
};
|
||||
} // DataTypes
|
||||
} // SceneAPI
|
||||
} // AZ
|
||||
} // AZ
|
||||
|
||||
@@ -36,6 +36,8 @@ namespace AZ
|
||||
|
||||
virtual ~IMeshVertexUVData() override = default;
|
||||
|
||||
void CloneAttributesFrom([[maybe_unused]] const IGraphObject* sourceObject) override {}
|
||||
|
||||
virtual const AZ::Name& GetCustomName() const = 0;
|
||||
|
||||
virtual size_t GetCount() const = 0;
|
||||
|
||||
@@ -36,6 +36,8 @@ namespace AZ
|
||||
|
||||
virtual ~ISkinWeightData() override = default;
|
||||
|
||||
void CloneAttributesFrom([[maybe_unused]] const IGraphObject* sourceObject) override {}
|
||||
|
||||
virtual size_t GetVertexCount() const = 0;
|
||||
virtual size_t GetLinkCount(size_t vertexIndex) const = 0;
|
||||
virtual const Link& GetLink(size_t vertexIndex, size_t linkIndex) const = 0;
|
||||
|
||||
@@ -30,6 +30,8 @@ namespace AZ
|
||||
|
||||
virtual ~ITransform() override = default;
|
||||
|
||||
void CloneAttributesFrom([[maybe_unused]] const IGraphObject* sourceObject) override {}
|
||||
|
||||
virtual MatrixType& GetMatrix() = 0;
|
||||
virtual const MatrixType& GetMatrix() const = 0;
|
||||
void GetDebugOutput(AZ::SceneAPI::Utilities::DebugOutput& output) const override
|
||||
|
||||
@@ -28,6 +28,11 @@ namespace AZ
|
||||
|
||||
virtual ~IGraphObject() = 0;
|
||||
|
||||
// Copy object-level attributes
|
||||
// These are attributes that would be the same at different optimization levels of a node. For
|
||||
// instance, a decimated version of a mesh node is still going to have the same unit size.
|
||||
virtual void CloneAttributesFrom(const IGraphObject* sourceObject) = 0;
|
||||
|
||||
// When requested, the scene graph can be dumped to a file to help with debugging.
|
||||
virtual void GetDebugOutput([[maybe_unused]] AZ::SceneAPI::Utilities::DebugOutput& output) const {}
|
||||
};
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace AZ
|
||||
}
|
||||
|
||||
AZStd::string cacheFileName;
|
||||
bool succeeded = AzFramework::StringFunc::Path::GetFileName(sourceMaterialPath.c_str(), cacheFileName);
|
||||
[[maybe_unused]] bool succeeded = AzFramework::StringFunc::Path::GetFileName(sourceMaterialPath.c_str(), cacheFileName);
|
||||
AZ_Assert(succeeded, "Failed to retrieve a valid material file name from %s", sourceMaterialPath.c_str());
|
||||
|
||||
AZStd::string materialCachePath;
|
||||
|
||||
@@ -27,6 +27,7 @@ namespace AZ::SceneAPI::DataTypes
|
||||
MOCK_CONST_METHOD1(GetUsedPointIndexForControlPoint, int(int));
|
||||
MOCK_CONST_METHOD0(GetVertexCount, unsigned int());
|
||||
MOCK_CONST_METHOD0(GetFaceCount, unsigned int());
|
||||
MOCK_CONST_METHOD1(GetFaceInfo, const Face&(unsigned int index));
|
||||
MOCK_CONST_METHOD1(GetPosition, const AZ::Vector3&(unsigned int index));
|
||||
MOCK_CONST_METHOD1(GetNormal, const AZ::Vector3&(unsigned int index));
|
||||
MOCK_CONST_METHOD2(GetFaceVertexIndex, unsigned int(unsigned int face, unsigned int vertexIndex));
|
||||
|
||||
@@ -36,6 +36,8 @@ namespace AZ
|
||||
{}
|
||||
~MockIGraphObject() override = default;
|
||||
|
||||
void CloneAttributesFrom([[maybe_unused]] const IGraphObject* sourceObject) override {}
|
||||
|
||||
int m_id;
|
||||
};
|
||||
|
||||
@@ -54,6 +56,8 @@ namespace AZ
|
||||
{}
|
||||
~MockIGraphObjectAlt() override = default;
|
||||
|
||||
void CloneAttributesFrom([[maybe_unused]] const IGraphObject* sourceObject) override {}
|
||||
|
||||
int m_id;
|
||||
};
|
||||
|
||||
|
||||
@@ -347,10 +347,12 @@ namespace AZ
|
||||
MockSceneComponentApplication()
|
||||
{
|
||||
AZ::ComponentApplicationBus::Handler::BusConnect();
|
||||
AZ::Interface<AZ::ComponentApplicationRequests>::Register(this);
|
||||
}
|
||||
|
||||
~MockSceneComponentApplication()
|
||||
{
|
||||
AZ::Interface<AZ::ComponentApplicationRequests>::Unregister(this);
|
||||
AZ::ComponentApplicationBus::Handler::BusDisconnect();
|
||||
}
|
||||
|
||||
@@ -359,6 +361,8 @@ namespace AZ
|
||||
MOCK_METHOD0(Destroy, void());
|
||||
MOCK_METHOD1(RegisterComponentDescriptor, void(const AZ::ComponentDescriptor*));
|
||||
MOCK_METHOD1(UnregisterComponentDescriptor, void(const AZ::ComponentDescriptor*));
|
||||
MOCK_METHOD1(RegisterEntityAddedEventHandler, void(AZ::EntityAddedEvent::Handler&));
|
||||
MOCK_METHOD1(RegisterEntityRemovedEventHandler, void(AZ::EntityRemovedEvent::Handler&));
|
||||
MOCK_METHOD1(RemoveEntity, bool(AZ::Entity*));
|
||||
MOCK_METHOD1(DeleteEntity, bool(const AZ::EntityId&));
|
||||
MOCK_METHOD1(GetEntityName, AZStd::string(const AZ::EntityId&));
|
||||
|
||||
@@ -205,7 +205,7 @@ namespace AZ
|
||||
{
|
||||
SceneManifest testManifest;
|
||||
AZStd::shared_ptr<MockManifestInt> testDataObject = AZStd::make_shared<MockManifestInt>(100);
|
||||
bool result = testManifest.AddEntry(AZStd::move(testDataObject));
|
||||
testManifest.AddEntry(AZStd::move(testDataObject));
|
||||
EXPECT_FALSE(testManifest.IsEmpty());
|
||||
}
|
||||
|
||||
@@ -214,7 +214,7 @@ namespace AZ
|
||||
{
|
||||
SceneManifest testManifest;
|
||||
AZStd::shared_ptr<MockManifestInt> testDataObject = AZStd::make_shared<MockManifestInt>(100);
|
||||
bool result = testManifest.AddEntry(AZStd::move(testDataObject));
|
||||
testManifest.AddEntry(AZStd::move(testDataObject));
|
||||
EXPECT_FALSE(testManifest.IsEmpty());
|
||||
testManifest.Clear();
|
||||
EXPECT_TRUE(testManifest.IsEmpty());
|
||||
|
||||
@@ -327,7 +327,7 @@ namespace AZ
|
||||
using Iterator = typename AllContext<TypeParam>::Iterator;
|
||||
|
||||
Iterator iterator = this->Construct();
|
||||
Iterator returned = iterator++;
|
||||
iterator++;
|
||||
}
|
||||
|
||||
// Pre Increment Operator
|
||||
@@ -344,7 +344,7 @@ namespace AZ
|
||||
using Iterator = typename AllContext<TypeParam>::Iterator;
|
||||
|
||||
Iterator iterator = this->Construct();
|
||||
Iterator returned = ++iterator;
|
||||
++iterator;
|
||||
}
|
||||
|
||||
REGISTER_TYPED_TEST_CASE_P(AllContext,
|
||||
@@ -691,7 +691,7 @@ namespace AZ
|
||||
|
||||
Iterator iterator = this->Construct();
|
||||
iterator++;
|
||||
Iterator returned = iterator--;
|
||||
iterator--;
|
||||
}
|
||||
|
||||
TYPED_TEST_P(BidirectionalContext, PostDecrementOperator_IteratorReturnsOriginalIterator_OriginalIteratorMatchesCopiedValueAndNotMoveIterator)
|
||||
@@ -734,7 +734,7 @@ namespace AZ
|
||||
using Iterator = typename BidirectionalContext<TypeParam>::Iterator;
|
||||
|
||||
Iterator iterator = this->Construct();
|
||||
Iterator returned = ++iterator;
|
||||
++iterator;
|
||||
}
|
||||
|
||||
TYPED_TEST_P(BidirectionalContext, PreDecrementOperator_IteratorReturnsMovedIterator_OriginalIteratorDoesNotMatchCopiedValueButMovedIteratorDoes)
|
||||
|
||||
+2
-2
@@ -240,7 +240,7 @@ namespace AZ
|
||||
{
|
||||
using Traversal = typename SceneGraphDownwardsIteratorContext<TypeParam>::Traversal;
|
||||
auto sceneView = MakeSceneGraphDownwardsView<Traversal>(this->m_graph, this->GetRootHierarchyIterator(), this->m_graph.GetNameStorage().begin(), true);
|
||||
for (auto& it : sceneView)
|
||||
for ([[maybe_unused]] auto& it : sceneView)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -252,7 +252,7 @@ namespace AZ
|
||||
size_t localCount = 0;
|
||||
|
||||
auto sceneView = MakeSceneGraphDownwardsView<Traversal>(this->m_graph, this->GetRootHierarchyIterator(), this->m_graph.GetNameStorage().begin(), true);
|
||||
for (auto& it : sceneView)
|
||||
for ([[maybe_unused]] auto& it : sceneView)
|
||||
{
|
||||
localCount++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user