Show a 3D widget for a property of a C++ class?

Is it possible to have a 3D widget show in the editor for a property of an instance of a C++ class?

I have a C++ class derived from Actor. It has an array of transforms. When an instance of the class is in the scene, I want to display 3D widgets for each transform. I want the same thing as checking the Show 3D Widget checkbox in the details panel of a Blueprint variable.

3 Likes

Also want to know this !

You can specify extra metadata on UPROPERTY specifiers.

Here’s an example:

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = “MyCategory”, Meta = (MakeEditWidget = true))
FVector TargetLocation;

3 Likes

I can confirm that it works. Thank you :slight_smile:

Should it be possible to do the same for each element of an Tarray of Fvector?

Sorry, i hadn’t realize, but it is possible as it with:

UPROPERTY(EditAnywhere, Category = Map, Meta = (MakeEditWidget = true))
TArray<FVector> positions;

I’m glad it works :slight_smile:

Just what I was looking for :slight_smile:

build a struct … that’s how I did it

USTRUCT(BlueprintType)
struct FVector3D
{
GENERATED_USTRUCT_BODY();

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Vector3D", Meta = (MakeEditWidget = true))
	FVector Vector;


FVector3D()
	:Vector(FVector::ZeroVector)
{
}

};

and then define your Array whereever

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Default")
	TArray<FVector3D> MyEditorVectors;

hi can you help in creating menu (hovering an object and changing material property) in VR (vive), I successfully created for non VR but struck in VR. If possible suggest or send some tuts