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"

TArray and TMap Struct defaults-button error

Add this code to you project:

 USTRUCT(BlueprintType)
 struct FSomeStruct
 {
     GENERATED_BODY()
 
     UPROPERTY(EditAnywhere, Category = Test)
     FVector MyVector;
 
     UPROPERTY(EditAnywhere, Category = Test)
     float MyFloat;
 
     FSomeStruct()
         : MyVector(1.f)
         , MyFloat(5.f)
     {
     }
 };
 
 UCLASS()
 class PROJECT_API ASomeActor : public AActor
 {
     GENERATED_BODY()
     
 public:    
     // Sets default values for this actor's properties
     ASomeActor();
 
     UPROPERTY(EditAnywhere, Category = Test)
     TArray<FSomeStruct> MyStructArray;
 
     UPROPERTY(EditAnywhere, Category = Test)
     TMap<uint8, FSomeStruct> MyStructMap;
 };  


Create a Blueprint based on SomeActor. There are some inconsistencies when editing the blueprint:

  1. Add an array or map element (in either the blueprint or an instance). You will immediately see the yellow (reset-to-default) button indicating a change, although the element has just been created. It should not be visible unless there is an actual deviance from the default values.

  2. The defaults-button next to the array-index correctly restores the default values, while the buttons next to the struct properties ("MyVector","MyFloat") set the properties to zero. These buttons should also set the properties to the values specified in the C++ constructor.

  3. The defaults-button next to "My Struct Array" deletes all entries. I am not sure whether this is expected behaviour, since there is a "Remove all elements"-button which provides this functionality.

  4. Interestingly, if you add entries in your Blueprint, on your instances all the entries specified in the BP are handled correctly. All additional entries added just on the instances suffer from the aformentioned errors.

All the examples apply to TMap as well.

Product Version: UE 4.14
Tags:
more ▼

asked Dec 15 '16 at 06:48 PM in Bug Reports

avatar image

queelaga
1 1 1 2

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

1 answer: sort voted first

Hello Queelaga,

I searched around our database for a similar issue because I had remembered seeing this. It seems that this issue has already been reported. You can find the bug report for that here: UE-38569. As that bug report only refers to an array of structs, I've left a comment on the report to mention that it also occurs with TMaps.

Thank you!

more ▼

answered Dec 16 '16 at 09:08 PM

(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