Merge branch 'main' into sceneapi_script_autotest

This commit is contained in:
jackalbe
2021-04-14 08:32:59 -05:00
2497 changed files with 45024 additions and 527853 deletions
@@ -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);