Download

Using the curve editor for custom class properties?

Is it possible to use the Curve Editor for properties on my own classes in the editor and inside blueprint?

I made a property of UDistributionFloatUniformCurve and it shows up editable in the editor, but only in that you can hand edit the raw keys. I can’t find a way to allow the designer to edit the values in the more friendly Curve Editor.

Not sure if bumping is allowed on here, but still trying to figure this one out. Artists are not happy having to build curves with numbers rather than a proper curve editor :slight_smile:

Hi,

Create a pointer to a UCurveFloat* in your class, you can then assign a editor curve to it.


UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = Curves)
UCurveFloat* MyCurve;


float Value = 0.0f;

if (MyCurve)
{
   Value = MyCurve->GetFloatValue(InTime);
}

How do you “assign a curve editor to it”? I already have a curve property, and its raw points are exposed and editable in the editor, but no curve editor shows up.

You can create a curve asset (under Miscellaneous) which can be edited using the curve editor, then be assigned to a UCurveFloat property as neo says. You are talking about distribution curves in your original post though, which don’t appear to be supported by the curve assets currently. If you need a distribution rather than a simple curve, I think you may need to add this functionality yourself.

Ahh ok. Hmm. Seems odd that there is two different methods of making curve based properties, but this gives me something to work with. Thanks!