Merge branch 'main' into sceneapi_script_autotest
This commit is contained in:
@@ -15,6 +15,8 @@ if (NOT PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
return()
|
||||
endif()
|
||||
|
||||
ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME})
|
||||
|
||||
ly_add_target(
|
||||
NAME FbxSDKWrapper STATIC
|
||||
NAMESPACE AZ
|
||||
|
||||
@@ -74,8 +74,6 @@ namespace AZ
|
||||
|
||||
AZStd::shared_ptr<const FbxBlendShapeWrapper> FbxMeshWrapper::GetBlendShape(int index) const
|
||||
{
|
||||
int deformerCount = m_fbxMesh->GetDeformerCount();
|
||||
int blendshapeCount = m_fbxMesh->GetDeformerCount(FbxDeformer::eBlendShape);
|
||||
FbxBlendShape* blendShape = static_cast<FbxBlendShape*>(m_fbxMesh->GetDeformer(index, FbxDeformer::eBlendShape));
|
||||
return blendShape ? AZStd::make_shared<const FbxBlendShapeWrapper>(blendShape) : nullptr;
|
||||
}
|
||||
|
||||
@@ -507,7 +507,6 @@ namespace AZ
|
||||
return Events::ProcessingResult::Ignored;
|
||||
}
|
||||
Events::ProcessingResultCombiner combinedAnimationResult;
|
||||
aiNode* currentNode = context.m_sourceNode.GetAssImpNode();
|
||||
|
||||
// In:
|
||||
// Key index
|
||||
|
||||
@@ -106,10 +106,6 @@ namespace AZ
|
||||
RenamedNodesMap::SanitizeNodeName(nodeName, context.m_scene.GetGraph(), context.m_currentGraphPosition, "BlendShape");
|
||||
AZ_TraceContext("Blend shape name", nodeName);
|
||||
|
||||
int firstMeshVertexIndex = -1;
|
||||
int previousMeshVertexIndex = -1;
|
||||
int verticesInMeshFace = 0;
|
||||
|
||||
AZStd::bitset<SceneData::GraphData::BlendShapeData::MaxNumUVSets> uvSetUsedFlags;
|
||||
for (AZ::u8 uvSetIndex = 0; uvSetIndex < SceneData::GraphData::BlendShapeData::MaxNumUVSets; ++uvSetIndex)
|
||||
{
|
||||
@@ -131,16 +127,17 @@ namespace AZ
|
||||
context.m_sourceSceneSystem.SwapVec3ForUpAxis(vertex);
|
||||
context.m_sourceSceneSystem.ConvertUnit(vertex);
|
||||
|
||||
blendShapeData->AddPosition(vertex);
|
||||
blendShapeData->SetVertexIndexToControlPointIndexMap(vertIdx, vertIdx);
|
||||
|
||||
// Add normals
|
||||
AZ::Vector3 normal;
|
||||
if (aiAnimMesh->HasNormals())
|
||||
{
|
||||
normal = AssImpSDKWrapper::AssImpTypeConverter::ToVector3(aiAnimMesh->mNormals[vertIdx]);
|
||||
AZ::Vector3 normal(AssImpSDKWrapper::AssImpTypeConverter::ToVector3(aiAnimMesh->mNormals[vertIdx]));
|
||||
context.m_sourceSceneSystem.SwapVec3ForUpAxis(normal);
|
||||
normal.NormalizeSafe();
|
||||
blendShapeData->AddNormal(normal);
|
||||
}
|
||||
blendShapeData->AddVertex(vertex, normal);
|
||||
blendShapeData->SetVertexIndexToControlPointIndexMap(vertIdx, vertIdx);
|
||||
|
||||
// Add tangents and bitangents
|
||||
if (aiAnimMesh->HasTangentsAndBitangents())
|
||||
|
||||
@@ -64,7 +64,6 @@ namespace AZ
|
||||
return meshDataResult.GetError();
|
||||
}
|
||||
const SceneData::GraphData::MeshData* const parentMeshData(meshDataResult.GetValue());
|
||||
int parentMeshIndex = parentMeshData->GetSdkMeshIndex();
|
||||
|
||||
size_t vertexCount = parentMeshData->GetVertexCount();
|
||||
|
||||
|
||||
@@ -144,7 +144,6 @@ namespace AZ
|
||||
}
|
||||
blendShapeIndex++;
|
||||
int blendShapeChannelCount = pDeformer->GetBlendShapeChannelCount();
|
||||
int stackCount = context.m_sourceScene.GetAnimationStackCount();
|
||||
auto animStackWrapper = context.m_sourceScene.GetAnimationStackAt(0);
|
||||
|
||||
const FbxSDKWrapper::FbxTimeWrapper startTime = animStackWrapper->GetLocalTimeSpan().GetStartTime();
|
||||
|
||||
@@ -138,7 +138,7 @@ namespace AZ
|
||||
AZ_TracePrintf(Utilities::WarningWindow, "Opacity has been changed from 0 to full. Some DCC tools ignore the opacity and "
|
||||
"write 0 to indicate opacity is not used. This causes meshes to turn invisible, which is often not the intention so "
|
||||
"the opacity has been set to full automatically. If the intention was for a fully transparent mesh, please update "
|
||||
"the opacity in Lumberyards material editor.");
|
||||
"the opacity in Open 3D Engine's material editor.");
|
||||
}
|
||||
material->SetOpacity(opacity);
|
||||
|
||||
|
||||
+2
-1
@@ -248,7 +248,8 @@ namespace AZ
|
||||
sceneSystem.SwapVec3ForUpAxis(meshVertexNormal);
|
||||
meshVertexNormal.Normalize();
|
||||
|
||||
blendShape->AddVertex(meshVertexPosition, meshVertexNormal);
|
||||
blendShape->AddPosition(meshVertexPosition);
|
||||
blendShape->AddNormal(meshVertexNormal);
|
||||
|
||||
// Add face
|
||||
{
|
||||
|
||||
@@ -39,6 +39,7 @@ namespace AZ
|
||||
AZ_TracePrintf(SceneAPI::Utilities::LogWindow, "AssImpSceneWrapper::LoadSceneFromFile %s", fileName);
|
||||
AZ_TraceContext("Filename", fileName);
|
||||
m_importer.SetPropertyBool(AI_CONFIG_IMPORT_FBX_PRESERVE_PIVOTS, false);
|
||||
m_importer.SetPropertyBool(AI_CONFIG_IMPORT_FBX_OPTIMIZE_EMPTY_ANIMATION_CURVES, false);
|
||||
m_sceneFileName = fileName;
|
||||
m_assImpScene = m_importer.ReadFile(fileName,
|
||||
aiProcess_Triangulate //Triangulates all faces of all meshes
|
||||
|
||||
@@ -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++;
|
||||
}
|
||||
|
||||
@@ -66,6 +66,15 @@ namespace AZ
|
||||
{
|
||||
}
|
||||
|
||||
void BlendShapeAnimationData::CloneAttributesFrom(const IGraphObject* sourceObject)
|
||||
{
|
||||
IBlendShapeAnimationData::CloneAttributesFrom(sourceObject);
|
||||
if (const auto* typedSource = azrtti_cast<const BlendShapeAnimationData*>(sourceObject))
|
||||
{
|
||||
SetBlendShapeName(typedSource->GetBlendShapeName());
|
||||
}
|
||||
}
|
||||
|
||||
void BlendShapeAnimationData::SetBlendShapeName(const char* blendShapeName)
|
||||
{
|
||||
m_blendShapeName = blendShapeName;
|
||||
|
||||
@@ -55,6 +55,7 @@ namespace AZ
|
||||
|
||||
SCENE_DATA_API BlendShapeAnimationData();
|
||||
SCENE_DATA_API ~BlendShapeAnimationData() override = default;
|
||||
SCENE_DATA_API void CloneAttributesFrom(const IGraphObject* sourceObject) override;
|
||||
SCENE_DATA_API virtual void SetBlendShapeName(const char* name);
|
||||
SCENE_DATA_API virtual void AddKeyFrame(double keyFrameValue);
|
||||
SCENE_DATA_API virtual void ReserveKeyFrames(size_t count);
|
||||
|
||||
@@ -23,11 +23,14 @@ namespace AZ
|
||||
|
||||
BlendShapeData::~BlendShapeData() = default;
|
||||
|
||||
unsigned int BlendShapeData::AddVertex(const Vector3& position, const Vector3& normal)
|
||||
void BlendShapeData::AddPosition(const Vector3& position)
|
||||
{
|
||||
m_positions.push_back(position);
|
||||
}
|
||||
|
||||
void BlendShapeData::AddNormal(const Vector3& normal)
|
||||
{
|
||||
m_normals.push_back(normal);
|
||||
return static_cast<unsigned int>(m_positions.size()-1);
|
||||
}
|
||||
|
||||
void BlendShapeData::AddTangentAndBitangent(const Vector4& tangent, const Vector3& bitangent)
|
||||
@@ -135,6 +138,12 @@ namespace AZ
|
||||
return static_cast<unsigned int>(m_faces.size());
|
||||
}
|
||||
|
||||
const BlendShapeData::Face& BlendShapeData::GetFaceInfo(unsigned int index) const
|
||||
{
|
||||
AZ_Assert(index < m_faces.size(), "GetFaceInfo index not in range");
|
||||
return m_faces[index];
|
||||
}
|
||||
|
||||
const Vector3& BlendShapeData::GetPosition(unsigned int index) const
|
||||
{
|
||||
AZ_Assert(index < m_positions.size(), "GetPosition index not in range");
|
||||
|
||||
@@ -37,7 +37,8 @@ namespace AZ
|
||||
static constexpr AZ::u8 MaxNumUVSets = 8;
|
||||
|
||||
SCENE_DATA_API ~BlendShapeData() override;
|
||||
SCENE_DATA_API virtual unsigned int AddVertex(const Vector3& position, const Vector3& normal);
|
||||
SCENE_DATA_API void AddPosition(const AZ::Vector3& position);
|
||||
SCENE_DATA_API void AddNormal(const AZ::Vector3& normal);
|
||||
SCENE_DATA_API void AddTangentAndBitangent(const Vector4& tangent, const Vector3& bitangent);
|
||||
SCENE_DATA_API void AddUV(const Vector2& uv, AZ::u8 uvSetIndex);
|
||||
SCENE_DATA_API void AddColor(const SceneAPI::DataTypes::Color& color, AZ::u8 colorSetIndex);
|
||||
@@ -57,6 +58,7 @@ namespace AZ
|
||||
//assume consistent winding - no stripping or fanning expected (3 index per face)
|
||||
SCENE_DATA_API unsigned int GetVertexCount() const override;
|
||||
SCENE_DATA_API unsigned int GetFaceCount() const override;
|
||||
SCENE_DATA_API const Face& GetFaceInfo(unsigned int index) const override;
|
||||
|
||||
SCENE_DATA_API const Vector3& GetPosition(unsigned int index) const override;
|
||||
SCENE_DATA_API const Vector3& GetNormal(unsigned int index) const override;
|
||||
|
||||
@@ -74,6 +74,15 @@ namespace AZ
|
||||
|
||||
MeshData::~MeshData() = default;
|
||||
|
||||
void MeshData::CloneAttributesFrom(const IGraphObject* sourceObject)
|
||||
{
|
||||
IMeshData::CloneAttributesFrom(sourceObject);
|
||||
if (const auto* typedSource = azrtti_cast<const MeshData*>(sourceObject))
|
||||
{
|
||||
SetSdkMeshIndex(typedSource->GetSdkMeshIndex());
|
||||
}
|
||||
}
|
||||
|
||||
void MeshData::AddPosition(const AZ::Vector3& position)
|
||||
{
|
||||
m_positions.push_back(position);
|
||||
|
||||
@@ -35,6 +35,9 @@ namespace AZ
|
||||
static void Reflect(ReflectContext* context);
|
||||
|
||||
SCENE_DATA_API ~MeshData() override;
|
||||
|
||||
SCENE_DATA_API void CloneAttributesFrom(const IGraphObject* sourceObject) override;
|
||||
|
||||
//assumes 1 to 1 mapping for these position, normal, color, uv
|
||||
//positions with more than one normal or uv (seam) will duplicate shared values in multiple verts
|
||||
SCENE_DATA_API virtual void AddPosition(const AZ::Vector3& position);
|
||||
|
||||
@@ -44,6 +44,16 @@ namespace AZ
|
||||
}
|
||||
}
|
||||
|
||||
void MeshVertexBitangentData::CloneAttributesFrom(const IGraphObject* sourceObject)
|
||||
{
|
||||
IMeshVertexBitangentData::CloneAttributesFrom(sourceObject);
|
||||
if (const auto* typedSource = azrtti_cast<const MeshVertexBitangentData*>(sourceObject))
|
||||
{
|
||||
SetTangentSpace(typedSource->GetTangentSpace());
|
||||
SetBitangentSetIndex(typedSource->GetBitangentSetIndex());
|
||||
}
|
||||
}
|
||||
|
||||
size_t MeshVertexBitangentData::GetCount() const
|
||||
{
|
||||
return m_bitangents.size();
|
||||
|
||||
@@ -36,6 +36,8 @@ namespace AZ
|
||||
|
||||
SCENE_DATA_API ~MeshVertexBitangentData() override = default;
|
||||
|
||||
SCENE_DATA_API void CloneAttributesFrom(const IGraphObject* sourceObject) override;
|
||||
|
||||
SCENE_DATA_API size_t GetCount() const override;
|
||||
SCENE_DATA_API const AZ::Vector3& GetBitangent(size_t index) const override;
|
||||
SCENE_DATA_API void SetBitangent(size_t vertexIndex, const AZ::Vector3& bitangent) override;
|
||||
|
||||
@@ -50,6 +50,15 @@ namespace AZ
|
||||
}
|
||||
}
|
||||
|
||||
void MeshVertexColorData::CloneAttributesFrom(const IGraphObject* sourceObject)
|
||||
{
|
||||
IMeshVertexColorData::CloneAttributesFrom(sourceObject);
|
||||
if (const auto* typedSource = azrtti_cast<const MeshVertexColorData*>(sourceObject))
|
||||
{
|
||||
SetCustomName(typedSource->GetCustomName());
|
||||
}
|
||||
}
|
||||
|
||||
const AZ::Name& MeshVertexColorData::GetCustomName() const
|
||||
{
|
||||
return m_customName;
|
||||
@@ -59,7 +68,10 @@ namespace AZ
|
||||
{
|
||||
m_customName = name;
|
||||
}
|
||||
|
||||
void MeshVertexColorData::SetCustomName(const AZ::Name& name)
|
||||
{
|
||||
m_customName = name;
|
||||
}
|
||||
|
||||
size_t MeshVertexColorData::GetCount() const
|
||||
{
|
||||
|
||||
@@ -32,8 +32,11 @@ namespace AZ
|
||||
|
||||
SCENE_DATA_API ~MeshVertexColorData() override = default;
|
||||
|
||||
SCENE_DATA_API void CloneAttributesFrom(const IGraphObject* sourceObject) override;
|
||||
|
||||
SCENE_DATA_API const AZ::Name& GetCustomName() const override;
|
||||
SCENE_DATA_API void SetCustomName(const char* name);
|
||||
SCENE_DATA_API void SetCustomName(const AZ::Name& name);
|
||||
|
||||
SCENE_DATA_API size_t GetCount() const override;
|
||||
SCENE_DATA_API const AZ::SceneAPI::DataTypes::Color& GetColor(size_t index) const override;
|
||||
|
||||
@@ -44,6 +44,16 @@ namespace AZ
|
||||
}
|
||||
}
|
||||
|
||||
void MeshVertexTangentData::CloneAttributesFrom(const IGraphObject* sourceObject)
|
||||
{
|
||||
IMeshVertexTangentData::CloneAttributesFrom(sourceObject);
|
||||
if (const auto* typedSource = azrtti_cast<const MeshVertexTangentData*>(sourceObject))
|
||||
{
|
||||
SetTangentSpace(typedSource->GetTangentSpace());
|
||||
SetTangentSetIndex(typedSource->GetTangentSetIndex());
|
||||
}
|
||||
}
|
||||
|
||||
size_t MeshVertexTangentData::GetCount() const
|
||||
{
|
||||
return m_tangents.size();
|
||||
|
||||
@@ -35,6 +35,8 @@ namespace AZ
|
||||
|
||||
SCENE_DATA_API ~MeshVertexTangentData() override = default;
|
||||
|
||||
SCENE_DATA_API void CloneAttributesFrom(const IGraphObject* sourceObject) override;
|
||||
|
||||
SCENE_DATA_API size_t GetCount() const override;
|
||||
SCENE_DATA_API const AZ::Vector4& GetTangent(size_t index) const override;
|
||||
SCENE_DATA_API void SetTangent(size_t vertexIndex, const AZ::Vector4& tangent) override;
|
||||
|
||||
@@ -40,6 +40,15 @@ namespace AZ
|
||||
}
|
||||
}
|
||||
|
||||
void MeshVertexUVData::CloneAttributesFrom(const IGraphObject* sourceObject)
|
||||
{
|
||||
IMeshVertexUVData::CloneAttributesFrom(sourceObject);
|
||||
if (const auto* typedSource = azrtti_cast<const MeshVertexUVData*>(sourceObject))
|
||||
{
|
||||
SetCustomName(typedSource->GetCustomName());
|
||||
}
|
||||
}
|
||||
|
||||
const AZ::Name& MeshVertexUVData::GetCustomName() const
|
||||
{
|
||||
return m_customName;
|
||||
@@ -49,6 +58,10 @@ namespace AZ
|
||||
{
|
||||
m_customName = name;
|
||||
}
|
||||
void MeshVertexUVData::SetCustomName(const AZ::Name& name)
|
||||
{
|
||||
m_customName = name;
|
||||
}
|
||||
|
||||
size_t MeshVertexUVData::GetCount() const
|
||||
{
|
||||
|
||||
@@ -34,8 +34,11 @@ namespace AZ
|
||||
|
||||
SCENE_DATA_API ~MeshVertexUVData() override = default;
|
||||
|
||||
SCENE_DATA_API void CloneAttributesFrom(const IGraphObject* sourceObject) override;
|
||||
|
||||
SCENE_DATA_API const AZ::Name& GetCustomName() const override;
|
||||
SCENE_DATA_API void SetCustomName(const char* name);
|
||||
SCENE_DATA_API void SetCustomName(const AZ::Name& name);
|
||||
|
||||
SCENE_DATA_API size_t GetCount() const override;
|
||||
SCENE_DATA_API const AZ::Vector2& GetUV(size_t index) const override;
|
||||
|
||||
@@ -98,9 +98,9 @@ namespace AZ
|
||||
->Attribute("AutoExpand", true)
|
||||
->Attribute(Edit::Attributes::NameLabelOverride, "")
|
||||
->DataElement(AZ_CRC("ManifestName", 0x5215b349), &MeshGroup::m_name, "Name mesh",
|
||||
"Name the mesh as you want it to appear in the Lumberyard Asset Browser.")
|
||||
"Name the mesh as you want it to appear in the Open 3D Engine Asset Browser.")
|
||||
->Attribute("FilterType", DataTypes::IMeshGroup::TYPEINFO_Uuid())
|
||||
->DataElement(Edit::UIHandlers::Default, &MeshGroup::m_nodeSelectionList, "Select meshes", "Select 1 or more meshes to add to this asset in the Lumberyard Asset Browser.")
|
||||
->DataElement(Edit::UIHandlers::Default, &MeshGroup::m_nodeSelectionList, "Select meshes", "Select 1 or more meshes to add to this asset in the Open 3D Engine Asset Browser.")
|
||||
->Attribute("FilterName", "meshes")
|
||||
->Attribute("FilterType", DataTypes::IMeshData::TYPEINFO_Uuid())
|
||||
->DataElement(Edit::UIHandlers::Default, &MeshGroup::m_rules, "", "Add or remove rules to fine-tune the export process.")
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace AZ
|
||||
->Attribute("AutoExpand", true)
|
||||
->Attribute(Edit::Attributes::NameLabelOverride, "")
|
||||
->DataElement(AZ_CRC("ManifestName", 0x5215b349), &SkeletonGroup::m_name, "Name skeleton",
|
||||
"Name the skeleton as you want it to appear in the Lumberyard Asset Browser.")
|
||||
"Name the skeleton as you want it to appear in the Open 3D Engine Asset Browser.")
|
||||
->Attribute("FilterType", DataTypes::ISkeletonGroup::TYPEINFO_Uuid())
|
||||
->DataElement("NodeListSelection", &SkeletonGroup::m_selectedRootBone, "Select root bone", "Select the root bone of the skeleton.")
|
||||
->Attribute("ClassTypeIdFilter", AZ::SceneData::GraphData::RootBoneData::TYPEINFO_Uuid())
|
||||
|
||||
@@ -103,9 +103,9 @@ namespace AZ
|
||||
->Attribute("AutoExpand", true)
|
||||
->Attribute(AZ::Edit::Attributes::NameLabelOverride, "")
|
||||
->DataElement(AZ_CRC("ManifestName", 0x5215b349), &SkinGroup::m_name, "Name skin",
|
||||
"Name the skin as you want it to appear in the Lumberyard Asset Browser.")
|
||||
"Name the skin as you want it to appear in the Open 3D Engine Asset Browser.")
|
||||
->Attribute("FilterType", DataTypes::ISkinGroup::TYPEINFO_Uuid())
|
||||
->DataElement(AZ_CRC("ManifestName", 0x5215b349), &SkinGroup::m_nodeSelectionList, "Select skins", "Select 1 or more skins to add to this asset in the Lumberyard Asset Browser.")
|
||||
->DataElement(AZ_CRC("ManifestName", 0x5215b349), &SkinGroup::m_nodeSelectionList, "Select skins", "Select 1 or more skins to add to this asset in the Open 3D Engine Asset Browser.")
|
||||
->Attribute("FilterName", "skins")
|
||||
->Attribute("FilterVirtualType", Behaviors::SkinGroup::s_skinVirtualType)
|
||||
->DataElement(Edit::UIHandlers::Default, &SkinGroup::m_rules, "", "Add or remove rules to fine-tune the export process.")
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace AZ
|
||||
EditContext* editContext = serializeContext->GetEditContext();
|
||||
if (editContext)
|
||||
{
|
||||
editContext->Class<BlendShapeRule>("Blend shapes", "Select mesh targets to configure blend shapes at a later time using Lumberyard.")
|
||||
editContext->Class<BlendShapeRule>("Blend shapes", "Select mesh targets to configure blend shapes at a later time using Open 3D Engine.")
|
||||
->ClassElement(Edit::ClassElements::EditorData, "")
|
||||
->Attribute("AutoExpand", true)
|
||||
->Attribute(AZ::Edit::Attributes::NameLabelOverride, "")
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace AZ
|
||||
->ClassElement(Edit::ClassElements::EditorData, "")
|
||||
->Attribute("AutoExpand", true)
|
||||
->Attribute(AZ::Edit::Attributes::NameLabelOverride, "")
|
||||
->DataElement(Edit::UIHandlers::Default, &MaterialRule::m_updateMaterials, "Update materials", "Checking this box will accept changes made in the source file into the Lumberyard asset.")
|
||||
->DataElement(Edit::UIHandlers::Default, &MaterialRule::m_updateMaterials, "Update materials", "Checking this box will accept changes made in the source file into the Open 3D Engine asset.")
|
||||
->DataElement(Edit::UIHandlers::Default, &MaterialRule::m_removeMaterials, "Remove unused materials","Detects and removes material files from the game project that are not present in the source file.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ protected:
|
||||
|
||||
sceneCoreModule = AZ::DynamicModuleHandle::Create("SceneCore");
|
||||
AZ_Assert(sceneCoreModule, "SceneData unit tests failed to create SceneCore module.");
|
||||
bool loaded = sceneCoreModule->Load(false);
|
||||
[[maybe_unused]] bool loaded = sceneCoreModule->Load(false);
|
||||
AZ_Assert(loaded, "SceneData unit tests failed to load SceneCore module.");
|
||||
auto init = sceneCoreModule->GetFunction<AZ::InitializeDynamicModuleFunction>(AZ::InitializeDynamicModuleFunctionName);
|
||||
AZ_Assert(init, "SceneData unit tests failed to find the initialization function the SceneCore module.");
|
||||
@@ -51,4 +51,4 @@ private:
|
||||
AZStd::unique_ptr<AZ::DynamicModuleHandle> sceneCoreModule;
|
||||
};
|
||||
|
||||
AZ_UNIT_TEST_HOOK(new SceneDataTestEnvironment);
|
||||
AZ_UNIT_TEST_HOOK(new SceneDataTestEnvironment);
|
||||
|
||||
@@ -178,7 +178,8 @@ namespace AZ
|
||||
{
|
||||
if (node)
|
||||
{
|
||||
while (node = node->GetParent())
|
||||
node = node->GetParent();
|
||||
while (node)
|
||||
{
|
||||
if (const AZ::SerializeContext::ClassData* classData = node->GetClassMetadata(); classData && classData->m_azRtti)
|
||||
{
|
||||
@@ -193,6 +194,7 @@ namespace AZ
|
||||
break;
|
||||
}
|
||||
}
|
||||
node = node->GetParent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user