- Home /
Lightmap UV problem with external version control
I have a problem with external version control causing UV/lightmap misalignment on any machine other than the one that created the lightmaps (I'm using the built in Beast lightmapper).
To begin with I was using the 'Auto Generate Lightmap UVs' option on the FBX and I put the problem down to the fact that Unity would generate the UVs slightly differently on each machine, but apparently Unity guarantee that the UVs will be the same every time.
I tested this a bit further by turning off the auto generate option and setting up the second UV set on the FBX before bringing it in to Unity. However the same problem occurs so I figure it can't be down to the auto generate process.
I then thought it might be the UV atlasing settings somehow not getting through to other machines, but after checking this they are exactly the same on all machines so it's not that.
Another thing for me to check on the Unity side of things is that the lightmaps themselves are getting through ok but I've not had a chance to check yet and I can't see that being the problem anyway to be honest.
If it's not that then I suppose the version control process could possibly be doing something to the FBX itself maybe? Sounds unlikely but otherwise I'm out of ideas.
Any help is much appreciated.
Are you using Pro and have enabled version control at Edit->Project Settings->Editor ?
Yes to both. I have pro and have enabled external version control. We also make sure all meta files are going in to the version control system.
Our studio was hoping this would be fixed in 3.5, but it hasn't been. This is a really annoying bug. Any chance on getting a fix for it?
Answer by Walrus · Nov 03, 2011 at 05:28 PM
We're dealing with the same problem right now. I'm actually here searching to see if this is a known issue, but I saw your post and thought I'd let you know what we've discovered.
Turning on the Generate UV setting works fine for FBX imports. However, turning it off stays only as a local setting. So, when another machine is used to open the scene, it still has Generate UVs turned on. Turning it off on the second machine resolved the lightmaps correctly, in our case.
Digging deeper, we found that turning off Generate UVs doesn't change the setting in the meta file to "false", it deletes the line entirely. Unity apparently doesn't like this, so when you open the scene on any other machine, Unity adds the line back in with a "true" setting. We manually edited the meta file by adding the line back in with the option set to "false". Checking that in resolved the problem on other machines, although it means we'll have to do it on every FBX import.
Hope that helps. If I don't find this as a known issue, I'll be reporting it as a bug.
Thanks Walrus! That perfectly explains the problem we were seeing. After I posted this we moved over to manually generated UVs so the problem went away.
Glad that helped.
One addition: Unity will continue to modify the metafile locally to remove the "generatesecondaryUV=0 line". (It apparently doesn't like it.) Once everyone is synched, you may want to check in a version with that line deleted to get rid of version control warnings.