Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Savestates are not listed in order on Linux systems #626

Closed
sentharn opened this issue Sep 28, 2023 · 3 comments
Closed

Savestates are not listed in order on Linux systems #626

sentharn opened this issue Sep 28, 2023 · 3 comments
Labels

Comments

@sentharn
Copy link

sentharn commented Sep 28, 2023

System Information

Blender Version (including hash): 3.6.2
FLIP Fluids Version: 1.7.1
Operating System: Ubuntu 22.04
CPU: i7-3770k
GFX: Nvidia GTX 1070
RAM: 32GB

Describe the bug

savestates

Savestates on windows are listed in order, while on Linux they are arbitrarily ordered

_update_savestate_enums() in domain_bake_properties.py reads each savestate in the savestates directory and iterates through them in the order that os.listdir() returns them. This order is not guaranteed to be stable according to Python docs.

On Windows, they happen to be in the desired order (probably because of some property of NTFS) but on Linux it returns them in a seemingly random order.

I "fixed" this by sorting the directory list first:

        sorted_dirs = os.listdir(savestates_directory)
        sorted_dirs.sort()
        subdirs = [d for d in sorted_dirs if os.path.isdir(os.path.join(savestates_directory, d))]

...but my python is rusty and an actual fix probably needs to do natural sorting, which I think .sort() does not do natively.

Thanks for looking into this!

@rlguy rlguy added the bug label Sep 28, 2023
@rlguy
Copy link
Owner

rlguy commented Sep 28, 2023

Thanks for the report and info! That's good info to know. We'll check it out and get this fixed for the next version.

@rlguy
Copy link
Owner

rlguy commented Sep 28, 2023

Just had a chance to look into this and I think your solution should work fine. The filename numbers are all padded with zeroes to be 6 digits, so regular sort() should work.

This fix will be included in FLIP Fluids 1.7.2, release TBA, but likely will be released shortly before the release of Blender 4.0 on Nov 7, 2023.

@rlguy rlguy closed this as completed Sep 28, 2023
@sentharn
Copy link
Author

Wow, thank you so much for the quick response!

looking forward to seeing it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants