Customise Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorised as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.

No cookies to display.

[ad_1]

I adopted this submit to implement a delegate on a listing that notifies me when a change has occurred (add file, delete file or take away file).

This works superb, although the problem is that for every operation, a number of occasions are triggered. Within the Information array containing info from the operation, I see the next behaviour:

  • When including a picture, Information dimension is 5 and incorporates one FCA_Added and 4 FCA_Modified.
  • When deleting a picture, Information dimension is 1 and incorporates a FCA_Removed.
  • When including a number of pictures (for instance 2 pictures), Information dimension is 10 and incorporates one FCA_Added and 4 FCA_Modified for the primary picture and one FCA_Added and 4 FCA_Modified for the second picture.

Be aware: Typically including a picture will end in fewer FCA_Modified. For instance, in one other PC, every picture leads to one FCA_Added and two (relatively than 4) FCA_Modified.

In any case, the problem stays that Information is offering a lot of occasions for every operation. If I need to management this with a swap for instance, it means every picture will set off my UpdateDynamicMaterialArray a number of occasions when just one name is required per file.

I hooked up a picture with the console output for a 2 file addition operation. enter picture description right here
enter image description here

To make clear the console output picture, Aspect motion 1 is a FCA_Added and an Aspect motion 2 is an FCA_Modified.

The perform I take advantage of to regulate the occasions:

/**
 * Will set off when a change (addition, substitute, deletion) is carried out on ResourcesDirPath
 * @param Information Array of kind FFileChangeData indicating the character of the change noticed
 */
void AMyController::OnProjectDirectoryChanged(const TArray<FFileChangeData>& Information) {
    UE_LOG(LogTemp, Warning, TEXT("Information num: %d"), Information.Num());
    for (FFileChangeData Aspect : Information) {
        UE_LOG(LogTemp, Warning, TEXT("Aspect filename: %s"), *Aspect.Filename);
        UE_LOG(LogTemp, Warning, TEXT("Aspect motion: %d"), Aspect.Motion);
        swap (Aspect.Motion) {
            case FFileChangeData::FCA_Added:
                UpdateDynamicMaterialArray(&Aspect.Filename, FFileChangeData::FCA_Added);
                //MyReferenceManager->MyHUD->AddTile();
                break;
            case FFileChangeData::FCA_Modified:
                UpdateDynamicMaterialArray(&Aspect.Filename, FFileChangeData::FCA_Modified);
                //MyReferenceManager->MyHUD->RefreshTile();
                break;
            case FFileChangeData::FCA_Removed:
                UpdateDynamicMaterialArray(&Aspect.Filename, FFileChangeData::FCA_Removed);
                //MyReferenceManager->MyHUD->RemoveTile();
                break;
            default: ;
        }
    }
}

FFileChangeData docs and EFileChangeAction didn’t assist.

Why does one operation end in a number of occasions of various kind? I think that is OS associated (I take advantage of Home windows) and that there’s not a lot I can do. Is that this true?

PD: This submit was initially created in stackoverflow and moved it right here as I used to be not conscious of the existance of this discussion board.

[ad_2]

Leave a Reply

Your email address will not be published. Required fields are marked *