Page MenuHome

Fix T101231: Console flooded with warnings when fluid type is Domain
ClosedPublic

Authored by Germano Cavalcante (mano-wii) on Sep 22 2022, 6:08 PM.

Details

Summary

Although rB67e23b4b2967 turned the problem more recurrent, the warning messages in the console always appear when BKE_fluid_cache_free_all is called.

The warning messages are:

Unable to remove directory
Unable to delete file
Unable to remove directory
Unable to delete file

Investigating the code, the problem is much more internal and occurs due to an apparent bug in BLI_filelist_dir_contents.

Inside this function, a "path" is created with file->path = BLI_strdupcat(dirname, dlink->name);

Note that BLI_strdupcat only joins names. So for the resulting path to actually exist, the dirname is required to end with a SEP '\\'.

But the BKE_fluid_cache_free code calls this function (inside BLI_delete) passing directories without the '\\' at the end.

This creates weird, non-existent directories.

In my case they are:

C:\Users\GERMANO\AppData\Local\Temp\blender_c20732\cache_fluid_4b85f272\configconfig_0001.uni
C:\Users\GERMANO\AppData\Local\Temp\blender_c20732\cache_fluid_4b85f272\config..
C:\Users\GERMANO\AppData\Local\Temp\blender_c20732\cache_fluid_4b85f272\config.
C:\Users\GERMANO\AppData\Local\Temp\blender_c20732\cache_fluid_4b85f272\datafluid_data_0001.vdb
C:\Users\GERMANO\AppData\Local\Temp\blender_c20732\cache_fluid_4b85f272\data..
C:\Users\GERMANO\AppData\Local\Temp\blender_c20732\cache_fluid_4b85f272\data.

But they should be:

C:\Users\GERMANO\AppData\Local\Temp\blender_c20732\cache_fluid_4b85f272\config\config_0001.uni
C:\Users\GERMANO\AppData\Local\Temp\blender_c20732\cache_fluid_4b85f272\config\..
C:\Users\GERMANO\AppData\Local\Temp\blender_c20732\cache_fluid_4b85f272\config\.
C:\Users\GERMANO\AppData\Local\Temp\blender_c20732\cache_fluid_4b85f272\data\fluid_data_0001.vdb
C:\Users\GERMANO\AppData\Local\Temp\blender_c20732\cache_fluid_4b85f272\data\..
C:\Users\GERMANO\AppData\Local\Temp\blender_c20732\cache_fluid_4b85f272\data\.

Interestingly, just below, a more appropriate function for joining directories is called: BLI_join_dirfile (added to the function in rB65d6cecd68a2)

The solution in this patch is to simply copy the result of BLI_join_dirfile instead of calling BLI_strdupcat.

NOTE: Other places in Blender avoid this problem by making sure to add a SEP_STR to the end of the directory.

Diff Detail

Repository
rB Blender
Branch
master
Build Status
Buildable 23890
Build 23890: arc lint + arc unit