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

NotADirectoryError when exporting objects that contain special filesystem characters in the name #462

Closed
rlguy opened this issue Jun 26, 2019 · 2 comments
Labels

Comments

@rlguy
Copy link
Owner

rlguy commented Jun 26, 2019

If a simulation object is named with a special filesystem character (Ex: \ / : * ? " < > | on Windows), a NotADirectoryError Python error will be produced when beginning baking a simulation.

NotADirectoryError: [WinError 267] The directory name is invalid: 'C:\\Users\\ryanl\\AppData\\Local\\Temp\\untitled_flip_fluid_cache\\export\\Inflow:Cube'

This error happens because the addon exports object mesh data to files using the object's name. When saving files with invalid characters, the operating system will not be able to create the file and an error will be generated.

Workaround

Until this issue is fixed, a workaround is to remove all special filesystem characters from the object's name.

@rlguy rlguy added the bug label Jun 26, 2019
@rlguy
Copy link
Owner Author

rlguy commented Oct 8, 2019

I will likely wait for a large version update to fix this issue. Fixing this issue will make older FLIP Fluids caches unsupported which I would prefer to avoid in minor releases.

@rlguy
Copy link
Owner Author

rlguy commented Feb 5, 2020

This issue has been fixed! And good news: it will not cause older caches to be unsupported.

Object names will now be stored on the filesystem by slugifying the name. The name will be converted using a whitelist of characters and truncated to 48 characters:

"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-"

Characters not on the whitelist will be replaced with -.

To avoid collisions in edge cases, a 16 hexdigit hash will be appended to the end of the filename.

@rlguy rlguy closed this as completed Feb 5, 2020
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

1 participant