LogParameterNotFoundWarning in Mutable's CustomizableObjectInstanceDescriptor logs an error instead of a warning

The function itself includes “Warning” but instead it logs an error. I don’t think giving an invalid selection for a parameter on a CustomizableObject is severe enough for an error.

There are reasons in game why we might attempt to set a variable without knowledge of whether or not it exists on the specific CustomizableObject we are setting it on. If it isn’t there and nothing happens, that is exactly how we wanted it to happen. We don’t want to have to implement our own logic before trying to set a parameter if there is a redundant check here.

void LogParameterNotFoundWarning(const FString& ParameterName, const int32 ObjectParameterIndex, const int32 InstanceParameterIndex, const UCustomizableObject* CustomizableObject, char const* CallingFunction) { UE_LOG(LogMutable, Error, TEXT("%hs: Failed to find parameter (%s) on CO (%s). CO parameter index: (%d). COI parameter index: (%d)s"), CallingFunction, *ParameterName, *GetNameSafe(CustomizableObject), ObjectParameterIndex, InstanceParameterIndex ); }

Hi Kurt, I hope you are doing well.

First of all you are right about the message being wrongly categorized as an “Error” I agree that it should be a warning in this case.

I can understand the approach of blindly asking the COI to set the value of a parameter without actually knowing from what CO that COI is generated from (and therefore if the parameter exists). In either case, we do have a series of methods you can call from the COI that will tell you if a parameter exists or not for a given COI:

`/** Return true if the Int Parameter exists. */
UFUNCTION(BlueprintCallable, Category = CustomizableObjectInstance)
CUSTOMIZABLEOBJECT_API bool ContainsEnumParameter(const FString& ParameterName) const;

/** Return true if the Float Parameter exists. */
UFUNCTION(BlueprintCallable, Category = CustomizableObjectInstance)
CUSTOMIZABLEOBJECT_API bool ContainsFloatParameter(const FString& ParameterName) const;

/** Return true if the Bool Parameter exists. */
UFUNCTION(BlueprintCallable, Category = CustomizableObjectInstance)
CUSTOMIZABLEOBJECT_API bool ContainsBoolParameter(const FString& ParameterName) const;

/** Return true if the Vector Parameter exists. */
UFUNCTION(BlueprintCallable, Category = CustomizableObjectInstance)
CUSTOMIZABLEOBJECT_API bool ContainsVectorParameter(const FString& ParameterName) const;

/** Return true if the Projector Parameter exists. */
UFUNCTION(BlueprintCallable, Category = CustomizableObjectInstance)
CUSTOMIZABLEOBJECT_API bool ContainsProjectorParameter(const FString& ParameterName) const;

/** Return true if the Transform Parameter exists. */
UFUNCTION(BlueprintCallable, Category = CustomizableObjectInstance)
CUSTOMIZABLEOBJECT_API bool ContainsTransformParameter(const FString& ParameterName) const;`In the code you use to change the parameter, you should first check if the parameter exists and, if it does, update the parameter. Doing it this way will prevent you from getting that error message and should be quite straightforward to implement on your end.

Having said that, I am going to change the verbosity of the message, but if you use these methods I just showed you, you should never see that pesky log ever again.

Have a nice day!

Daniel Moreno