There were improvements related to MetaTags since this question was asked and answered.
Starting with UE4.23:
The EditCondition meta tag is no longer limited to a single boolean property. It is now evaluated using a full-fledged expression parser, meaning you can include a full C++ expression.
This means we can do things like disabling (or even hiding) a property based on the value of an enum UPROPERTY. Hiding can be achieved by using the EditConditionHides
MetaTag. Example:
UENUM(BlueprintType)
enum class EInterpolationMode : uint8 { Linear, Curve };
USTRUCT(BlueprintType)
struct FBlendableInterpolationData
{
GENERATED_BODY()
UPROPERTY(BlueprintReadWrite, EditAnywhere)
EInterpolationMode InterpolationMode = EInterpolationMode::Linear;
UPROPERTY(EditAnywhere, meta = (EditCondition = "InterpolationMode == EInterpolationMode::Linear", EditConditionHides))
float Duration;
UPROPERTY(EditAnywhere, meta = (EditCondition = "InterpolationMode == EInterpolationMode::Curve", EditConditionHides))
UCurveFloat* Curve;
};
WARNING: There is a special case where EditConditionHides
can crash the editor for engine versions 4.26 and 4.27.
More examples for property disabling/hiding can be found here: Unreal Engine UPROPERTY Edit Conditions
In addition, if you need more complex property manipulation (hiding groups, categories, or changing a property value depending on another) you can take a look at: https://docs.unrealengine.com/latest/INT/Programming/Slate/DetailsCustomization/index.html. You can browse through the Engine code to see how they utilize this method.