Unreal/CarlaUE4/Plugins/RoadRunnerImporter/Source/RoadRunnerImporter/Private/RoadRunnerImportUtil.cpp
////////////////////////////////////////////////////////////////////////////////
// Helper function to set scalar parameter in a material instance
Helper function to set scalar parameter in a material instance
Helper function to set scalar parameter in a material instance
void FRoadRunnerImportUtil::SetScalarParameter(UMaterialInstanceConstant* material, const FName& paramName, const FString& valueString)
{
	if (valueString.IsEmpty())
		return;
	float value = FCString::Atof(*valueString);
#if ENGINE_MINOR_VERSION > 18
	material->SetScalarParameterValueEditorOnly(FMaterialParameterInfo(paramName, EMaterialParameterAssociation::GlobalParameter), value);
#else
	material->SetScalarParameterValueEditorOnly(paramName, value);
#endif
}
void FRoadRunnerImportUtil :: SetScalarParameter ( UMaterialInstanceConstant * material , const FName & paramName , const FString & valueString ) { if ( valueString . IsEmpty ( ) ) return ; float value = FCString :: Atof ( * valueString ) ; #if ENGINE_MINOR_VERSION > 18 material -> SetScalarParameterValueEditorOnly ( FMaterialParameterInfo ( paramName , EMaterialParameterAssociation :: GlobalParameter ) , value ) ; #else material -> SetScalarParameterValueEditorOnly ( paramName , value ) ; #endif }
Helper function to set scalar parameter in a material instance
Helper function to set scalar parameter in a material instance