I just tried to download the cctextures with the script on a windows computer. There is an error message that the filename, directory name, or volume label syntax is incorrect.
(.env) C:\Data\Git\truss-detection\deps\blender-proc\scripts>python download_cc_textures.py
Download asset: Bricks069 of 0/1183
Die Syntax f眉r den Dateinamen, Verzeichnisnamen oder die Datentr盲gerbezeichnung ist falsch.
Download asset: Bricks068 of 1/1183
Die Syntax f眉r den Dateinamen, Verzeichnisnamen oder die Datentr盲gerbezeichnung ist falsch.
The line in the code responsible for this is this one:
subprocess.call(["unzip {} -d {}> /dev/null".format(current_file_path, current_folder)], shell=True)
I tried to download them to another folder if the long path was the problem but it did not help as well. Any suggestions ?
Hey,
this script seems to be written for a linux based environment. We would have to port it to windows.
Be aware that windows support for BlenderProc is community driven and is not guaranteed.
@zzilch Could you help here?
Best,
Max
Hey,
but it seems that unzip is just not available, if that is the only issue, you can try to replace it:
https://superuser.com/a/1473255
I don't have access to a windows pc, but you can try out if it works with tar instead of unzip or maybe this:
Expand-Archive -Force C:\path\to\archive.zip C:\where\to\extract\to
Best,
Max
Hey,
I could test this and fix it internally.
Hey,
for now you could replace this line by subprocess.call([("tar"), "xf", current_file_path, '-C', current_folder], shell=False)
This should be fixed for windows in next release.
Hey,
for now you could replace this line by
subprocess.call([("tar"), "xf", current_file_path, '-C', current_folder], shell=False)
This should be fixed for windows in next release.
This works for me.
subprocess.call(["unzip {} -d {}".format(current_file_path, current_folder)], shell=False) also works if there is unzip in the PATH of the environment variable.
Another way is to use the tarfile and zipfile in the standard library like the way we used in run.py.
import zipfile
with zipfile.ZipFile(current_file_path) as z:
z.extractall(current_folder)
Although the docs says
Decryption is extremely slow as it is implemented in native Python rather than C.
It is acceptable for small files considering the heavy burden of subprocess.
It is acceptable for small files considering the heavy burden of subprocess.
We could make this unzipping only work for windows with zipfile, that way it works at least, but it would be super slow.
We should add a utility function for unzipping which supports several platforms.
I found that using zipfile is always faster than using subprocess both in my Windows and Linux machines when unzipping Bricks069_1K-JPG.zip and blender-2.93.0-windows-x64.zip :sweat_smile:
I think it is just slow for the encrypted file, but works well for common zipped files.
Cool I ll try this as well. Thanks for your help guys. 馃憤
I assume this helped. I close this for now.
We will fix this internally in an up coming version.