Skip to content
This repository has been archived by the owner on Oct 4, 2022. It is now read-only.

Allow specifying initial value for AnimGraph string parameter in editor #520

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,10 @@ namespace EMotionFX
{
SetNamedParameterBool(paramName, static_cast<AZ::ScriptPropertyBoolean*>(parameter)->m_value);
}
else if (azrtti_istypeof<AZ::ScriptPropertyString>(parameter))
{
SetNamedParameterString(paramName, static_cast<AZ::ScriptPropertyString*>(parameter)->m_value.c_str());
}
else
{
AZ_Warning("EMotionFX", false, "Invalid type for anim graph parameter \"%s\".", paramName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <AzToolsFramework/API/ToolsApplicationAPI.h>
#include <EMotionFX/Source/Parameter/BoolParameter.h>
#include <EMotionFX/Source/Parameter/FloatParameter.h>
#include <EMotionFX/Source/Parameter/StringParameter.h>
#include <EMotionFX/Source/Parameter/IntParameter.h>
#include <EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioManager.h>
#include <EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/MainWindow.h>
Expand Down Expand Up @@ -239,7 +240,8 @@ namespace EMotionFX
{
return (azrtti_istypeof<FloatParameter>(param) ||
azrtti_istypeof<IntParameter>(param) ||
azrtti_istypeof<BoolParameter>(param));
azrtti_istypeof<BoolParameter>(param) ||
azrtti_istypeof<StringParameter>(param));
}

//////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -311,6 +313,10 @@ namespace EMotionFX
const EMotionFX::BoolParameter* boolParam = static_cast<const EMotionFX::BoolParameter*>(param);
m_parameterDefaults.m_parameters.emplace_back(aznew AZ::ScriptPropertyBoolean(paramName.c_str(), boolParam->GetDefaultValue()));
}
else if (azrtti_istypeof<EMotionFX::StringParameter>(param))
{
const EMotionFX::StringParameter* stringParam = static_cast<const EMotionFX::StringParameter*>(param);
m_parameterDefaults.m_parameters.emplace_back(aznew AZ::ScriptPropertyString(paramName.c_str(), stringParam->GetDefaultValue().c_str()));
else
{
AZ_Assert(!IsSupportedScriptPropertyType(param), "This value parameter of this type ('%s') should not be supported. Please update the IsSupportedScriptPropertyType() method.", param->GetTypeDisplayName());
Expand Down