Bug #5569
.png files are not loading
100%
Description
The Flags from the Squad/Flags Folder do not appear in the game, also any mod part using .png missing textures.
The bug occured since I updated to Windows 10.
Example Line from the output Log:
Load(Texture): AsteroidDay/Assets/CamSat
(Filename: C:/buildslave/unity/build/artifacts/StandalonePlayerGenerated/UnityEngineDebug.cpp Line: 56)
Texture load error in 'D:\#Spiele\Kerbal Space Program Bug\GameData\AsteroidDay\Assets\CamSat.png': Couldn't open file D:\
(Filename: C:/buildslave/unity/build/artifacts/StandalonePlayerGenerated/UnityEngineDebug.cpp Line: 56)
History
#1 Updated by Quazar501 over 8 years ago
Problem seems to be fixed if the file path doesn't include a "#".
#2 Updated by sal_vager over 8 years ago
- Severity changed from Normal to Very Low
Interesting though not unavoidable, but I have to ask, why did you use a # in the filename?
#4 Updated by Squelch over 8 years ago
- Status changed from New to Confirmed
- % Done changed from 0 to 10
This is caused by the method of loading that is used. Some textures and images use the Unity URL type of addressing, and it seems that special control characters are being parsed when present in the path. In the case of # it is a special Web character commonly used for colour information. It is a legal character for filesystems, so the mismatch between file system and web use is tripping up the loading of images here.
This issue has already been reported internally.
PS. When downloading attached content from issues on this tracker, I use the issue number for reference. A craft named #xxxx-craftname.craft will not load a thumbnail in the craft loader for this reason.
#5 Updated by sal_vager over 8 years ago
So this may really be a Unity bug, as it's the method that Unity provides to load images that cannot handle a # in the path.
Specifically the www class for loading local image files.
Unity doesn't offer an alternative that I know of, the only workaround I have found is here, http://answers.unity3d.com/questions/623448/www-class-for-loading-local-texture-is-very-slow.html?sort=oldest
That is to avoid the network adapter blocking that occurs with Hamachi and similar when trying to load files, it reads in the raw binary data then puts that into a texture object.
As is mentioned in the thread you need to know the image size beforehand.
It'd be a hack, and really Unity should fix the www class so it can handle both Hamachi and a # in the file path.
#6 Updated by TriggerAu over 7 years ago
- Status changed from Confirmed to Needs Clarification
- % Done changed from 10 to 0
#7 Updated by sal_vager over 7 years ago
- Category changed from 30 to 368
- Status changed from Needs Clarification to Unity Bug
- % Done changed from 0 to 100
Signing off as PNG's do load, but Unity can't parse that character.