sideeffects / HoudiniEngineForUnreal

Houdini Engine Plugin for Unreal Engine.
http://www.sidefx.com/unreal
Other
1.35k stars 373 forks source link

"Clean Houdini Engine Temp Folder" does not consider the folder specified in the unreal_temp_folder Attribute #203

Open strvert opened 2 years ago

strvert commented 2 years ago

Hi.

I frequently use attributes such as unreal_temp_folder and unreal_bake_folder to maintain the directory structure of my project. These attributes work as expected.

However, there is a problem with the "Clean Houdini Engine Temp Folder" operation to remove unused temp assets. From my reading of the source code, it appears that this operation currently targets the Temporary Cook Folder in the default, Project Setting, and HoudiniAssetActor's Details. The Temp Folder specified in unreal_temp_folder and actually in use is not cleaned up.

I have tried to fix the problem, but I could not figure out how to get the unreal_temp_folder Attribute based on the HoudiniAssetComponent.

Can you please fix this issue or give me some tips on how I can fix it?

Thanks.

strvert commented 2 years ago

I think the problem is in the process of getting the target TempCookFolder inside FHoudiniEngineCommands::CleanUpTempFolder().

    for (TObjectIterator<UHoudiniAssetComponent> It; It; ++It)
    {
        FString CookFolder = It->TemporaryCookFolder.Path;
        if (CookFolder.IsEmpty())
            continue;

        TempCookFolders.AddUnique(CookFolder);
    }

It->TemporaryCookFolder.Path cannot consider the unreal_temp_folder attribute.