diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/Actor.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/Actor.cpp index 56d08760c3..f419c56a6a 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/Actor.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/Actor.cpp @@ -192,7 +192,7 @@ namespace EMotionFX const size_t numLodLevels = m_meshLodData.m_lodLevels.size(); MeshLODData& resultMeshLodData = result->m_meshLodData; - result->SetNumLODLevels(numLodLevels); + result->SetNumLODLevels(static_cast(numLodLevels)); for (size_t lodLevel = 0; lodLevel < numLodLevels; ++lodLevel) { const MCore::Array& nodeInfos = m_meshLodData.m_lodLevels[lodLevel].mNodeInfos; @@ -319,10 +319,10 @@ namespace EMotionFX // get the number of nodes, iterate through them, create a new LOD level and copy over the meshes from the last LOD level for (size_t i = 0; i < numNodes; ++i) { - NodeLODInfo& newLODInfo = lodLevels[lodIndex].mNodeInfos[i]; + NodeLODInfo& newLODInfo = lodLevels[lodIndex].mNodeInfos[static_cast(i)]; if (copyFromLastLODLevel && lodIndex > 0) { - const NodeLODInfo& prevLODInfo = lodLevels[lodIndex - 1].mNodeInfos[i]; + const NodeLODInfo& prevLODInfo = lodLevels[lodIndex - 1].mNodeInfos[static_cast(i)]; newLODInfo.mMesh = (prevLODInfo.mMesh) ? prevLODInfo.mMesh->Clone() : nullptr; newLODInfo.mStack = (prevLODInfo.mStack) ? prevLODInfo.mStack->Clone(newLODInfo.mMesh) : nullptr; } @@ -334,8 +334,8 @@ namespace EMotionFX } // create a new material array for the new LOD level - mMaterials.Resize(lodLevels.size()); - mMaterials[lodIndex].SetMemoryCategory(EMFX_MEMCATEGORY_ACTORS); + mMaterials.Resize(static_cast(lodLevels.size())); + mMaterials[static_cast(lodIndex)].SetMemoryCategory(EMFX_MEMCATEGORY_ACTORS); // create an empty morph setup for the new LOD level mMorphSetups.Add(nullptr); @@ -343,7 +343,7 @@ namespace EMotionFX // copy data from the previous LOD level if wanted if (copyFromLastLODLevel && numLODs > 0) { - CopyLODLevel(this, lodIndex - 1, numLODs - 1, true); + CopyLODLevel(this, static_cast(lodIndex - 1), static_cast(numLODs - 1), true); } } @@ -1209,7 +1209,7 @@ namespace EMotionFX Node* node = mSkeleton->GetNode(n); // check if this node has a mesh, if not we can skip it - Mesh* mesh = GetMesh(geomLod, n); + Mesh* mesh = GetMesh(static_cast(geomLod), n); if (mesh == nullptr) { continue; @@ -1245,10 +1245,10 @@ namespace EMotionFX { // if the bone is disabled SkinInfluence* influence = layer->GetInfluence(orgVertex, i); - if (mSkeleton->GetNode(influence->GetNodeNr())->GetSkeletalLODStatus(geomLod) == false) + if (mSkeleton->GetNode(influence->GetNodeNr())->GetSkeletalLODStatus(static_cast(geomLod)) == false) { // find the first parent bone that is enabled in this LOD - const uint32 newNodeIndex = FindFirstActiveParentBone(geomLod, influence->GetNodeNr()); + const uint32 newNodeIndex = FindFirstActiveParentBone(static_cast(geomLod), influence->GetNodeNr()); if (newNodeIndex == MCORE_INVALIDINDEX32) { MCore::LogWarning("EMotionFX::Actor::MakeGeomLODsCompatibleWithSkeletalLODs() - Failed to find an enabled parent for node '%s' in skeletal LOD %d of actor '%s' (0x%x)", node->GetName(), geomLod, GetFileName(), this); @@ -1273,10 +1273,10 @@ namespace EMotionFX } // for all submeshes // reinit the mesh deformer stacks - MeshDeformerStack* stack = GetMeshDeformerStack(geomLod, node->GetNodeIndex()); + MeshDeformerStack* stack = GetMeshDeformerStack(static_cast(geomLod), node->GetNodeIndex()); if (stack) { - stack->ReinitializeDeformers(this, node, geomLod); + stack->ReinitializeDeformers(this, node, static_cast(geomLod)); } } // for all nodes } @@ -1519,7 +1519,7 @@ namespace EMotionFX { // Optional, not all actors have morph targets. const size_t numLODLevels = m_meshAsset->GetLodAssets().size(); - mMorphSetups.Resize(numLODLevels); + mMorphSetups.Resize(static_cast(numLODLevels)); for (AZ::u32 i = 0; i < numLODLevels; ++i) { mMorphSetups[i] = nullptr; @@ -1588,7 +1588,7 @@ namespace EMotionFX const uint32 orgVertex = orgVertices[startVertex + vertexIndex]; // for all skinning influences of the vertex - const uint32 numInfluences = layer->GetNumInfluences(orgVertex); + const uint32 numInfluences = static_cast(layer->GetNumInfluences(orgVertex)); float maxWeight = 0.0f; uint32 maxWeightNodeIndex = 0; for (uint32 i = 0; i < numInfluences; ++i) @@ -2786,13 +2786,13 @@ namespace EMotionFX const size_t numLODLevels = lodAssets.size(); lodLevels.clear(); - SetNumLODLevels(numLODLevels, /*adjustMorphSetup=*/false); + SetNumLODLevels(static_cast(numLODLevels), /*adjustMorphSetup=*/false); const uint32 numNodes = mSkeleton->GetNumNodes(); // Remove all the materials and add them back based on the meshAsset. Eventually we will remove all the material from Actor and // GLActor. RemoveAllMaterials(); - mMaterials.Resize(numLODLevels); + mMaterials.Resize(static_cast(numLODLevels)); for (size_t lodLevel = 0; lodLevel < numLODLevels; ++lodLevel) { @@ -2845,19 +2845,19 @@ namespace EMotionFX DualQuatSkinDeformer* skinDeformer = DualQuatSkinDeformer::Create(mesh); jointInfo.mStack->AddDeformer(skinDeformer); skinDeformer->ReserveLocalBones(numLocalJoints); - skinDeformer->Reinitialize(this, meshJoint, lodLevel); + skinDeformer->Reinitialize(this, meshJoint, static_cast(lodLevel)); } else { SoftSkinDeformer* skinDeformer = GetSoftSkinManager().CreateDeformer(mesh); jointInfo.mStack->AddDeformer(skinDeformer); skinDeformer->ReserveLocalBones(numLocalJoints); // pre-alloc data to prevent reallocs - skinDeformer->Reinitialize(this, meshJoint, lodLevel); + skinDeformer->Reinitialize(this, meshJoint, static_cast(lodLevel)); } } // Add material for this mesh - AddMaterial(lodLevel, Material::Create(GetName())); + AddMaterial(static_cast(lodLevel), Material::Create(GetName())); } } @@ -2919,7 +2919,7 @@ namespace EMotionFX const AZ::Data::Asset& lodAsset = lodAssets[lodLevel]; const AZStd::array_view& sourceMeshes = lodAsset->GetMeshes(); - MorphSetup* morphSetup = mMorphSetups[lodLevel]; + MorphSetup* morphSetup = mMorphSetups[static_cast(lodLevel)]; if (!morphSetup) { continue; @@ -3029,7 +3029,7 @@ namespace EMotionFX } // Sync the deformer passes with the morph target deform datas. - morphTargetDeformer->Reinitialize(this, meshJoint, lodLevel); + morphTargetDeformer->Reinitialize(this, meshJoint, static_cast(lodLevel)); } } } // namespace EMotionFX diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/DualQuatSkinDeformer.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/DualQuatSkinDeformer.cpp index 8c28a84698..2daaac6a85 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/DualQuatSkinDeformer.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/DualQuatSkinDeformer.cpp @@ -327,7 +327,7 @@ namespace EMotionFX AZ::Outcome boneIndexOutcome = FindLocalBoneIndex(influence->GetNodeNr()); if (boneIndexOutcome.IsSuccess()) { - influence->SetBoneNr(boneIndexOutcome.GetValue()); + influence->SetBoneNr(static_cast(boneIndexOutcome.GetValue())); } else { diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/KeyTrackLinearDynamic.inl b/Gems/EMotionFX/Code/EMotionFX/Source/KeyTrackLinearDynamic.inl index 5d06291a92..b28c9973fc 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/KeyTrackLinearDynamic.inl +++ b/Gems/EMotionFX/Code/EMotionFX/Source/KeyTrackLinearDynamic.inl @@ -170,7 +170,7 @@ MCORE_INLINE void KeyTrackLinearDynamic::AddKey(float t template MCORE_INLINE uint32 KeyTrackLinearDynamic::FindKeyNumber(float curTime) const { - return KeyFrameFinder::FindKey(curTime, &mKeys.front(), mKeys.size()); + return KeyFrameFinder::FindKey(curTime, &mKeys.front(), static_cast(mKeys.size())); } @@ -355,7 +355,7 @@ void KeyTrackLinearDynamic::AddKeySorted(float time, co { if (mKeys.capacity() == mKeys.size()) { - const uint32 numToReserve = mKeys.size() / 4; + const uint32 numToReserve = static_cast(mKeys.size() / 4); mKeys.reserve(mKeys.capacity() + numToReserve); } } @@ -385,7 +385,7 @@ void KeyTrackLinearDynamic::AddKeySorted(float time, co } // quickly find the location to insert, and insert it - const uint32 place = KeyFrameFinder::FindKey(keyTime, &mKeys.front(), mKeys.size()); + const uint32 place = KeyFrameFinder::FindKey(keyTime, &mKeys.front(), static_cast(mKeys.size())); mKeys.insert(mKeys.begin() + place + 1, KeyFrame(time, value)); } diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/Mesh.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/Mesh.cpp index 51486c39b5..993426f4c4 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/Mesh.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/Mesh.cpp @@ -266,7 +266,7 @@ namespace EMotionFX { // Atom stores the skin indices as uint16, but the buffer itself is a buffer of uint32 with two id's per element size_t influenceCount = elementCountInBytes / sizeof(AZ::u16); - maxSkinInfluences = influenceCount / modelVertexCount; + maxSkinInfluences = static_cast(influenceCount / modelVertexCount); AZ_Assert(maxSkinInfluences > 0 && maxSkinInfluences < 100, "Expect max skin influences in a reasonable value range."); AZ_Assert(influenceCount % modelVertexCount == 0, "Expect an equal number of influences for each vertex."); AZ_Assert(bufferAssetViewDescriptor.m_elementSize == 4, "Expect skin joint indices to be stored in a raw 32-bit per element buffer"); @@ -279,7 +279,7 @@ namespace EMotionFX { // Atom stores joint weights as float (range 0 - 1) size_t influenceCount = elementCountInBytes / sizeof(float); - maxSkinInfluences = influenceCount / modelVertexCount; + maxSkinInfluences = static_cast(influenceCount / modelVertexCount); AZ_Assert(maxSkinInfluences > 0 && maxSkinInfluences < 100, "Expect max skin influences in a reasonable value range."); skinWeights = static_cast(bufferData) + bufferAssetViewDescriptor.m_elementOffset; } @@ -290,7 +290,7 @@ namespace EMotionFX AZ::u32* originalVertexDataRaw = static_cast(originalVertexData->GetData()); for (size_t i = 0; i < modelVertexCount; ++i) { - originalVertexDataRaw[i] = i; + originalVertexDataRaw[i] = static_cast(i); } mesh->AddVertexAttributeLayer(originalVertexData); diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/SkinningInfoVertexAttributeLayer.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/SkinningInfoVertexAttributeLayer.cpp index 9c241a6773..3ccfa85ca8 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/SkinningInfoVertexAttributeLayer.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/SkinningInfoVertexAttributeLayer.cpp @@ -317,7 +317,7 @@ namespace EMotionFX // now we have located the skinning information for this vertex, we can see if our bones array // already contains the bone it uses by traversing all influences for this vertex, and checking // if the bone of that influence already is in the array with used bones - const uint32 numInfluences = GetNumInfluences(i); + const uint32 numInfluences = static_cast(GetNumInfluences(i)); for (uint32 a = 0; a < numInfluences; ++a) { EMotionFX::SkinInfluence* influence = GetInfluence(i, a); diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/GameControllerWindow.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/GameControllerWindow.cpp index bc8d874547..47bb9660a8 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/GameControllerWindow.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/GameControllerWindow.cpp @@ -327,7 +327,7 @@ namespace EMStudio EMotionFX::AnimGraphGameControllerSettings& gameControllerSettings = animGraph->GetGameControllerSettings(); // in case there is no preset yet create a default one - uint32 numPresets = gameControllerSettings.GetNumPresets(); + uint32 numPresets = static_cast(gameControllerSettings.GetNumPresets()); if (numPresets == 0) { EMotionFX::AnimGraphGameControllerSettings::Preset* preset = aznew EMotionFX::AnimGraphGameControllerSettings::Preset("Default"); @@ -374,7 +374,7 @@ namespace EMStudio QLabel* label = new QLabel(labelString.c_str()); label->setToolTip(parameter->GetDescription().c_str()); label->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - mParameterGridLayout->addWidget(label, parameterIndex, 0); + mParameterGridLayout->addWidget(label, static_cast(parameterIndex), 0); // add the axis combo box to the layout QComboBox* axesComboBox = new QComboBox(); @@ -434,7 +434,7 @@ namespace EMStudio // select the given axis in the combo box or select none if there is no assignment yet or the assigned axis wasn't found on the current game controller axesComboBox->setCurrentIndex(selectedComboItem); - mParameterGridLayout->addWidget(axesComboBox, parameterIndex, 1); + mParameterGridLayout->addWidget(axesComboBox, static_cast(parameterIndex), 1); // add the mode combo box to the layout QComboBox* modeComboBox = new QComboBox(); @@ -447,7 +447,7 @@ namespace EMStudio modeComboBox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); connect(modeComboBox, static_cast(&QComboBox::currentIndexChanged), this, &GameControllerWindow::OnParameterModeComboBox); modeComboBox->setCurrentIndex(settingsInfo->m_mode); - mParameterGridLayout->addWidget(modeComboBox, parameterIndex, 2); + mParameterGridLayout->addWidget(modeComboBox, static_cast(parameterIndex), 2); // add the invert checkbox to the layout QHBoxLayout* invertCheckBoxLayout = new QHBoxLayout(); @@ -460,7 +460,7 @@ namespace EMStudio connect(invertCheckbox, &QCheckBox::stateChanged, this, &GameControllerWindow::OnInvertCheckBoxChanged); invertCheckbox->setCheckState(settingsInfo->m_invert ? Qt::Checked : Qt::Unchecked); invertCheckBoxLayout->addWidget(invertCheckbox); - mParameterGridLayout->addLayout(invertCheckBoxLayout, parameterIndex, 3); + mParameterGridLayout->addLayout(invertCheckBoxLayout, static_cast(parameterIndex), 3); // add the current value edit field to the layout QLineEdit* valueEdit = new QLineEdit(); @@ -469,7 +469,7 @@ namespace EMStudio valueEdit->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); valueEdit->setMinimumWidth(70); valueEdit->setMaximumWidth(70); - mParameterGridLayout->addWidget(valueEdit, parameterIndex, 4); + mParameterGridLayout->addWidget(valueEdit, static_cast(parameterIndex), 4); // create the parameter info and add it to the array ParameterInfo paramInfo; @@ -1053,7 +1053,7 @@ namespace EMStudio // get the game controller settings from the current anim graph EMotionFX::AnimGraphGameControllerSettings& gameControllerSettings = mAnimGraph->GetGameControllerSettings(); - uint32 presetNumber = gameControllerSettings.GetNumPresets(); + uint32 presetNumber = static_cast(gameControllerSettings.GetNumPresets()); mString = AZStd::string::format("Preset %d", presetNumber); while (gameControllerSettings.FindPresetIndexByName(mString.c_str()) != MCORE_INVALIDINDEX32) { @@ -1123,7 +1123,7 @@ namespace EMStudio // get the currently selected preset uint32 presetIndex = mPresetComboBox->currentIndex(); - uint32 newValueIndex = gameControllerSettings.FindPresetIndexByName(newValue.c_str()); + uint32 newValueIndex = static_cast(gameControllerSettings.FindPresetIndexByName(newValue.c_str())); if (newValueIndex == MCORE_INVALIDINDEX32) { EMotionFX::AnimGraphGameControllerSettings::Preset* preset = gameControllerSettings.GetPreset(presetIndex); @@ -1139,7 +1139,7 @@ namespace EMStudio EMotionFX::AnimGraphGameControllerSettings& gameControllerSettings = mAnimGraph->GetGameControllerSettings(); // check if there already is a preset with the currently entered name - uint32 presetIndex = gameControllerSettings.FindPresetIndexByName(FromQtString(text).c_str()); + uint32 presetIndex = static_cast(gameControllerSettings.FindPresetIndexByName(FromQtString(text).c_str())); if (presetIndex != MCORE_INVALIDINDEX32 && presetIndex != gameControllerSettings.GetActivePresetIndex()) { GetManager()->SetWidgetAsInvalidInput(mPresetNameLineEdit); @@ -1362,7 +1362,7 @@ namespace EMStudio } // find the corresponding attribute - MCore::Attribute* attribute = animGraphInstance->GetParameterValue(parameterIndex); + MCore::Attribute* attribute = animGraphInstance->GetParameterValue(static_cast(parameterIndex)); if (attribute->GetType() == MCore::AttributeFloat::TYPE_ID) { diff --git a/Gems/EMotionFX/Code/MysticQt/Source/KeyboardShortcutManager.cpp b/Gems/EMotionFX/Code/MysticQt/Source/KeyboardShortcutManager.cpp index 8f871d0d42..8fa5850407 100644 --- a/Gems/EMotionFX/Code/MysticQt/Source/KeyboardShortcutManager.cpp +++ b/Gems/EMotionFX/Code/MysticQt/Source/KeyboardShortcutManager.cpp @@ -163,7 +163,7 @@ namespace MysticQt // iterate through the groups and save all actions for them for (const AZStd::unique_ptr& group : m_groups) { - settings->beginGroup(QString::fromUtf8(group->GetName().data(), group->GetName().size())); + settings->beginGroup(QString::fromUtf8(group->GetName().data(), static_cast(group->GetName().size()))); // iterate through the actions and save them for (const AZStd::unique_ptr& action : group->GetActions()) diff --git a/Gems/EMotionFX/Code/Source/Integration/Components/AnimGraphComponent.cpp b/Gems/EMotionFX/Code/Source/Integration/Components/AnimGraphComponent.cpp index ade713efa6..10046728ab 100644 --- a/Gems/EMotionFX/Code/Source/Integration/Components/AnimGraphComponent.cpp +++ b/Gems/EMotionFX/Code/Source/Integration/Components/AnimGraphComponent.cpp @@ -873,7 +873,7 @@ namespace EMotionFX AZ_Warning("EmotionFX", false, "Invalid anim graph parameter name: %s", parameterName); return; } - SetParameterFloat(parameterIndex.GetValue(), value); + SetParameterFloat(static_cast(parameterIndex.GetValue()), value); } } @@ -888,7 +888,7 @@ namespace EMotionFX AZ_Warning("EmotionFX", false, "Invalid anim graph parameter name: %s", parameterName); return; } - SetParameterBool(parameterIndex.GetValue(), value); + SetParameterBool(static_cast(parameterIndex.GetValue()), value); } } @@ -903,7 +903,7 @@ namespace EMotionFX AZ_Warning("EmotionFX", false, "Invalid anim graph parameter name: %s", parameterName); return; } - SetParameterString(parameterIndex.GetValue(), value); + SetParameterString(static_cast(parameterIndex.GetValue()), value); } } @@ -918,7 +918,7 @@ namespace EMotionFX AZ_Warning("EmotionFX", false, "Invalid anim graph parameter name: %s", parameterName); return; } - SetParameterVector2(parameterIndex.GetValue(), value); + SetParameterVector2(static_cast(parameterIndex.GetValue()), value); } } @@ -933,7 +933,7 @@ namespace EMotionFX AZ_Warning("EmotionFX", false, "Invalid anim graph parameter name: %s", parameterName); return; } - SetParameterVector3(parameterIndex.GetValue(), value); + SetParameterVector3(static_cast(parameterIndex.GetValue()), value); } } @@ -948,7 +948,7 @@ namespace EMotionFX AZ_Warning("EmotionFX", false, "Invalid anim graph parameter name: %s", parameterName); return; } - SetParameterRotationEuler(parameterIndex.GetValue(), value); + SetParameterRotationEuler(static_cast(parameterIndex.GetValue()), value); } } @@ -963,7 +963,7 @@ namespace EMotionFX AZ_Warning("EmotionFX", false, "Invalid anim graph parameter name: %s", parameterName); return; } - SetParameterRotation(parameterIndex.GetValue(), value); + SetParameterRotation(static_cast(parameterIndex.GetValue()), value); } } @@ -1119,7 +1119,7 @@ namespace EMotionFX const AZ::Outcome parameterIndex = m_animGraphInstance->FindParameterIndex(parameterName); if (parameterIndex.IsSuccess()) { - return GetParameterFloat(parameterIndex.GetValue()); + return GetParameterFloat(static_cast(parameterIndex.GetValue())); } } return 0.f; @@ -1133,7 +1133,7 @@ namespace EMotionFX const AZ::Outcome parameterIndex = m_animGraphInstance->FindParameterIndex(parameterName); if (parameterIndex.IsSuccess()) { - return GetParameterBool(parameterIndex.GetValue()); + return GetParameterBool(static_cast(parameterIndex.GetValue())); } } return false; @@ -1147,7 +1147,7 @@ namespace EMotionFX const AZ::Outcome parameterIndex = m_animGraphInstance->FindParameterIndex(parameterName); if (parameterIndex.IsSuccess()) { - return GetParameterString(parameterIndex.GetValue()); + return GetParameterString(static_cast(parameterIndex.GetValue())); } } return AZStd::string(); @@ -1161,7 +1161,7 @@ namespace EMotionFX const AZ::Outcome parameterIndex = m_animGraphInstance->FindParameterIndex(parameterName); if (parameterIndex.IsSuccess()) { - return GetParameterVector2(parameterIndex.GetValue()); + return GetParameterVector2(static_cast(parameterIndex.GetValue())); } } return AZ::Vector2::CreateZero(); @@ -1175,7 +1175,7 @@ namespace EMotionFX const AZ::Outcome parameterIndex = m_animGraphInstance->FindParameterIndex(parameterName); if (parameterIndex.IsSuccess()) { - return GetParameterVector3(parameterIndex.GetValue()); + return GetParameterVector3(static_cast(parameterIndex.GetValue())); } } return AZ::Vector3::CreateZero(); @@ -1189,7 +1189,7 @@ namespace EMotionFX const AZ::Outcome parameterIndex = m_animGraphInstance->FindParameterIndex(parameterName); if (parameterIndex.IsSuccess()) { - return GetParameterRotationEuler(parameterIndex.GetValue()); + return GetParameterRotationEuler(static_cast(parameterIndex.GetValue())); } } return AZ::Vector3::CreateZero(); @@ -1203,7 +1203,7 @@ namespace EMotionFX const AZ::Outcome parameterIndex = m_animGraphInstance->FindParameterIndex(parameterName); if (parameterIndex.IsSuccess()) { - return GetParameterRotation(parameterIndex.GetValue()); + return GetParameterRotation(static_cast(parameterIndex.GetValue())); } } return AZ::Quaternion::CreateIdentity(); diff --git a/Gems/EMotionFX/Code/Tests/AnimGraphNodeEventFilterTests.cpp b/Gems/EMotionFX/Code/Tests/AnimGraphNodeEventFilterTests.cpp index ed44be78a7..67f6fa860e 100644 --- a/Gems/EMotionFX/Code/Tests/AnimGraphNodeEventFilterTests.cpp +++ b/Gems/EMotionFX/Code/Tests/AnimGraphNodeEventFilterTests.cpp @@ -86,7 +86,7 @@ namespace EMotionFX AnimGraphMotionNode* motionNode = aznew AnimGraphMotionNode(); motionNode->SetName(AZStd::string::format("MotionNode%zu", i).c_str()); m_blendTree->AddChildNode(motionNode); - m_blend2Node->AddConnection(motionNode, AnimGraphMotionNode::PORTID_OUTPUT_POSE, i); + m_blend2Node->AddConnection(motionNode, AnimGraphMotionNode::PORTID_OUTPUT_POSE, static_cast(i)); m_motionNodes.push_back(motionNode); } diff --git a/Gems/EMotionFX/Code/Tests/AnimGraphNodeProcessingTests.cpp b/Gems/EMotionFX/Code/Tests/AnimGraphNodeProcessingTests.cpp index a185b4a452..4a85d452a3 100644 --- a/Gems/EMotionFX/Code/Tests/AnimGraphNodeProcessingTests.cpp +++ b/Gems/EMotionFX/Code/Tests/AnimGraphNodeProcessingTests.cpp @@ -69,7 +69,7 @@ namespace EMotionFX AnimGraphMotionNode* motionNode = aznew AnimGraphMotionNode(); motionNode->SetName(AZStd::string::format("MotionNode%zu", i).c_str()); m_blendTree->AddChildNode(motionNode); - m_blendNNode->AddConnection(motionNode, AnimGraphMotionNode::PORTID_OUTPUT_POSE, i); + m_blendNNode->AddConnection(motionNode, AnimGraphMotionNode::PORTID_OUTPUT_POSE, static_cast(i)); m_motionNodes.push_back(motionNode); } m_blendNNode->UpdateParamWeights(); diff --git a/Gems/EMotionFX/Code/Tests/AnimGraphReferenceNodeTests.cpp b/Gems/EMotionFX/Code/Tests/AnimGraphReferenceNodeTests.cpp index 57e8a6a90d..2c595c8b6c 100644 --- a/Gems/EMotionFX/Code/Tests/AnimGraphReferenceNodeTests.cpp +++ b/Gems/EMotionFX/Code/Tests/AnimGraphReferenceNodeTests.cpp @@ -260,7 +260,7 @@ namespace EMotionFX GetEMotionFX().Update(0.0f); EXPECT_EQ(Transform::CreateIdentity(), GetOutputTransform()); - static_cast(m_animGraphInstance->GetParameterValue(m_animGraph->FindParameterIndex(m_parameter).GetValue()))->SetValue(1.0f); + static_cast(m_animGraphInstance->GetParameterValue(static_cast(m_animGraph->FindParameterIndex(m_parameter).GetValue())))->SetValue(1.0f); GetEMotionFX().Update(0.0f); EXPECT_EQ(Transform::CreateIdentity() * AZ::Transform::CreateTranslation(AZ::Vector3(10.0f, 0.0f, 0.0f)), GetOutputTransform()); @@ -313,7 +313,7 @@ namespace EMotionFX // Changing this one parameter value should change it through all 3 // layers of reference nodes, down to the referenced Transform node - static_cast(m_animGraphInstance->GetParameterValue(m_animGraph->FindParameterIndex(m_topLevelParameter).GetValue()))->SetValue(1.0f); + static_cast(m_animGraphInstance->GetParameterValue(static_cast(m_animGraph->FindParameterIndex(m_topLevelParameter).GetValue())))->SetValue(1.0f); GetEMotionFX().Update(0.0f); EXPECT_EQ(Transform::CreateIdentity() * AZ::Transform::CreateTranslation(AZ::Vector3(10.0f, 0.0f, 0.0f)), GetOutputTransform()); diff --git a/Gems/EMotionFX/Code/Tests/Editor/ParametersGroupDefaultValues.cpp b/Gems/EMotionFX/Code/Tests/Editor/ParametersGroupDefaultValues.cpp index 7b7bf011a9..4219966d72 100644 --- a/Gems/EMotionFX/Code/Tests/Editor/ParametersGroupDefaultValues.cpp +++ b/Gems/EMotionFX/Code/Tests/Editor/ParametersGroupDefaultValues.cpp @@ -153,7 +153,7 @@ namespace EMotionFX TestInequality(defaultValueParameter->GetDefaultValue(), expectedValue); AnimGraphInstance* animGraphInstance = animGraph->GetAnimGraphInstance(0); - auto instanceValue = static_cast(animGraphInstance->GetParameterValue(animGraph->FindValueParameterIndex(valueParameter).GetValue())); + auto instanceValue = static_cast(animGraphInstance->GetParameterValue(static_cast(animGraph->FindValueParameterIndex(valueParameter).GetValue()))); ASSERT_EQ(instanceValue->GetType(), AttributeT::TYPE_ID); // Set the parameter's current value diff --git a/Gems/EMotionFX/Code/Tests/UI/CanAddMotionToMotionSet.cpp b/Gems/EMotionFX/Code/Tests/UI/CanAddMotionToMotionSet.cpp index a568431931..0e20d220d4 100644 --- a/Gems/EMotionFX/Code/Tests/UI/CanAddMotionToMotionSet.cpp +++ b/Gems/EMotionFX/Code/Tests/UI/CanAddMotionToMotionSet.cpp @@ -56,7 +56,7 @@ namespace EMotionFX motionSetPlugin->SetSelectedSet(motionSet); // It should be empty at the moment. - int numMotions = motionSet->GetNumMotionEntries(); + int numMotions = static_cast(motionSet->GetNumMotionEntries()); EXPECT_EQ(numMotions, 0); // Find the action to add a motion to the set and press it. @@ -65,7 +65,7 @@ namespace EMotionFX QTest::mouseClick(addMotionButton, Qt::LeftButton); // There should now be a motion. - int numMotionsAfterCreate = motionSet->GetNumMotionEntries(); + int numMotionsAfterCreate = static_cast(motionSet->GetNumMotionEntries()); ASSERT_EQ(numMotionsAfterCreate, 1); AZStd::unordered_map motions = motionSet->GetMotionEntries(); diff --git a/Gems/EMotionFX/Code/Tests/UI/CanEditParameters.cpp b/Gems/EMotionFX/Code/Tests/UI/CanEditParameters.cpp index e1ea78083a..82f509965c 100644 --- a/Gems/EMotionFX/Code/Tests/UI/CanEditParameters.cpp +++ b/Gems/EMotionFX/Code/Tests/UI/CanEditParameters.cpp @@ -74,7 +74,7 @@ namespace EMotionFX QTest::mouseClick(createButton, Qt::LeftButton); // Check we only have the one Parameter - int numParameters = newGraph->GetNumParameters(); + int numParameters = static_cast(newGraph->GetNumParameters()); EXPECT_EQ(numParameters, 1) << "Not just 1 parameter"; const RangedValueParameter* parameter = reinterpret_cast* >(newGraph->FindValueParameter(0)); diff --git a/Gems/EMotionFX/Code/Tests/UI/CanRemoveMotionFromMotionSet.cpp b/Gems/EMotionFX/Code/Tests/UI/CanRemoveMotionFromMotionSet.cpp index 8a13f35fbf..c6bec666b1 100644 --- a/Gems/EMotionFX/Code/Tests/UI/CanRemoveMotionFromMotionSet.cpp +++ b/Gems/EMotionFX/Code/Tests/UI/CanRemoveMotionFromMotionSet.cpp @@ -59,7 +59,7 @@ namespace EMotionFX motionSetPlugin->SetSelectedSet(motionSet); // It should be empty at the moment. - const int numMotions = motionSet->GetNumMotionEntries(); + const int numMotions = static_cast(motionSet->GetNumMotionEntries()); EXPECT_EQ(numMotions, 0); // Find the action to add a motion to the set and press it. @@ -68,7 +68,7 @@ namespace EMotionFX QTest::mouseClick(addMotionButton, Qt::LeftButton); // There should now be a motion. - const int numMotionsAfterCreate = motionSet->GetNumMotionEntries(); + const int numMotionsAfterCreate = static_cast(motionSet->GetNumMotionEntries()); ASSERT_EQ(numMotionsAfterCreate, 1); AZStd::unordered_map motions = motionSet->GetMotionEntries(); @@ -140,7 +140,7 @@ namespace EMotionFX motionSetPlugin->SetSelectedSet(motionSet); // It should be empty at the moment. - const int numMotions = motionSet->GetNumMotionEntries(); + const int numMotions = static_cast(motionSet->GetNumMotionEntries()); EXPECT_EQ(numMotions, 0); // Find the action to add a motion to the set and press it twice. @@ -150,7 +150,7 @@ namespace EMotionFX QTest::mouseClick(addMotionButton, Qt::LeftButton); // There should now be two motion. - const int numMotionsAfterCreate = motionSet->GetNumMotionEntries(); + const int numMotionsAfterCreate = static_cast(motionSet->GetNumMotionEntries()); ASSERT_EQ(numMotionsAfterCreate, 2); AZStd::unordered_map motions = motionSet->GetMotionEntries();