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"

UE 4.18 ENUM values as integeres no longer imported from JSON

For example say we have a JSON file:

 [{
     "enumValue" : 1,
     "Name" : "2"
   }, {
     "enumValue" : 2,
     "Name" : "3"
   }, {
     "enumValue" : 4,
     "Name" : "4",
   }]

And a C++ Enum

 UENUM(BlueprintType)
 enum class EMyNiceEnum: uint8
 {
     Unknown = 0x0,
     VeryNiceValue= 0x1,
     NiceValue= 0x2,
     NotSoNiceValue= 0x4
 };

And a struct for dataasset:

 USTRUCT(BlueprintType)
 struct SOMEPROJECT_API FMyNiceData : public FTableRowBase
 {
     GENERATED_USTRUCT_BODY()
 public:
     UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = PlayerClasses)
     EMyNiceEnum EnumValue;

In UE4.17 importing that json worked fine. In UE4.18 during import we're getting warnings like: LogEnum: Warning: In asset 'None', there is an enum property of type 'EMyNiceEnum' with an invalid value of '1.0' , and all values in imported asset are "Unknown".

If we change values from numbers to strings like "enumValue" : "NiceValue", everything works fine, but we rely heavily on being able to import enums by values as it was in UE4.17 and backwards.

Please provide a fix, or enlight us on how to import enums by numbers with 4.18, as current situation rises a high disturbance of the Force in our heads.

Thank you.

Product Version: UE 4.18
Tags:
more ▼

asked Nov 01 '17 at 12:55 PM in Bug Reports

avatar image

dldls
32 2 4 9

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

1 answer: sort voted first

This looks like it was caused by a change to enum importing behaviour, which prevents it being able to import the stringified numeric values from the JSON (which are converted as a float). I've raised UE-51848 to track this.

more ▼

answered Nov 01 '17 at 02:31 PM

avatar image

Jamie Dale STAFF
7.5k 177 67 307

avatar image Jamie Dale STAFF Nov 03 '17 at 12:57 PM

This has been fixed for 4.18.1 (see this change).

avatar image dldls Nov 03 '17 at 04:38 PM

Thanks a lot, for a quick fix.

(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