x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

enum selection field in component

How can I add selection of a Enum type in my SceneComponent. I've added

 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Classes)
 TSubclassOf<class UUserDefinedEnum> EnumClass;

But the only thing I can select then in Editor is UUserDefinedEnum and no my enums defined in Content Browser show up there.

Product Version: UE 4.10
Tags:
more ▼

asked Dec 30 '15 at 07:32 AM in C++ Programming

avatar image

Yata
554 39 50 69

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

You can't define something like that using a content-browser created enum from within c++. You need to create the enum in c++ or use a blueprint-based property.

For reference, this is how you do it in c++:

 UENUM( BlueprintType )
 enum class EUserDefinedENum : uint8
 {
   U_SomeValue,
   U_SomeOtherValue
 };
 
 UPROPERTY( EditAnywhere, BlueprintReadOnly, Category = Classes )
 EUserDefinedEnum MyEnum;
more ▼

answered Dec 30 '15 at 12:12 PM

avatar image

TTaM
1.7k 81 28 81

avatar image devlyn811 Dec 30 '15 at 03:10 PM

Real quick - you want

 TEnumAsByte<EUserDefinedEnum> MyEnum;

or it won't compile.

avatar image devlyn811 Dec 30 '15 at 03:13 PM

Sorry TTam - you're right, I didn't notice the 'class' and uint8 - my bad.

avatar image TTaM Dec 30 '15 at 03:58 PM

You'd also have had to have the enum in a namespace if it were the old style. :)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question