Unity自动导入LightMap Shader快捷方法

No replies
uke
User offline. Last seen 17 小时 56 分钟 ago. Offline
超级管理员
Joined: 09/07/2009
Points: 2478

蛮实用的变通办法!

Here is a unityPackage that contains two Editor scripts, one that "merge" two OBJ meshes and transfers the UVs from one to the other and creates a text file with the UV-coordinates. The other script reapplies the UVs when reimporting a mesh.

It also sets all materials to a lightmap material automatically, so you don't need to manually go over the object and change the material type and drag the lightmap texture onto it.

The only weird "side effect" to it, is that the lightmap model gets a color map texture applied as its lightmap. This isn't really a problem as the lightmap OBJ can be deleted after the UVs have been transferred.

For the transfer script to work, you must select two mesh objects as shown in the screenshot, and rightclick to select TransferUVs.

This is an update to Unity 2.1 of the earlier script i posted, and it has only been tested with OBJs exported from LW 9.5. It should work for OBJs from other applications as well.

Media:UVTransfer.unityPackage.zip

UVTransfer.png