MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / SetParameterValue

Method SetParameterValue

Source/Engine/Level/Actors/AnimatedModel.cpp:403–420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

401}
402
403void AnimatedModel::SetParameterValue(const StringView& name, const Variant& value)
404{
405 CHECK_ANIM_GRAPH_PARAM_ACCESS();
406 for (auto& param : GraphInstance.Parameters)
407 {
408 if (param.Name == name)
409 {
410 if (param.Value.Type == value.Type)
411 param.Value = value;
412 else if (Variant::CanCast(value, param.Value.Type))
413 param.Value = Variant::Cast(value, param.Value.Type);
414 else
415 LOG(Warning, "Animation Graph parameter '{0}' in AnimatedModel {1} is type '{2}' and not type '{3}'.", name, ToString(), param.Value.Type, value.Type);
416 return;
417 }
418 }
419 LOG(Warning, "Failed to set animated model '{0}' missing parameter '{1}'", ToString(), name);
420}
421
422const Variant& AnimatedModel::GetParameterValue(const Guid& id) const
423{

Callers 1

ApplySkyMethod · 0.45

Calls 3

CastFunction · 0.50
ToStringFunction · 0.50
ToStringMethod · 0.45

Tested by

no test coverage detected