Xsi can't find temporary file
Closed this issue · 2 comments
XSI adds a temporary folder string during the session.. so the filepath:
filePath = os.path.dirname(os.path.normpath(tempfile.gettempdir())) + os.sep + "ODVertexData.txt"
needs to be changed to the actual temp folder (explorer %temp%)
If i use just tempfile.gettempdir() alone then yes I get the xsi temp dir, so thats why I'm using the os.path.dirname() to get the parent dir without the xsitemp dir and the result of that is the same path I got with explorer %temp%.
Can you maybe post the error returned so I see what is happening please?
XSI seems to do double folders temp folders ( temp(temp)), going two levels deep and so the ..\ doesn't seem to work correctly.
If you do a print FilePath, you see it won't be pointing to the same location as the other apps. Just try it with Houdini. What this will mean is that XSI will only be accessing ODVertexData.txt files that XSI created in the same session (since the folders seem to have random number suffixes _5453, _3243, etc).
Here was the quick and dirty fix used yesterday for the FilePath to work like the other apps: https://pastebin.com/T5gUNSN1
Cheers