Quickest way to recreate UVs for light-map in Maya... Advice needed

I’m a Maya user and I have a huge depot of geometry was modeled without UE4 lightmapping requirements in mind. Here is a little background to halt comments that might not be on topic.

  • Yes, I could remake the UV’s by remapping all the geometry in a second channel, but I do not have that time and I am a single individual.
  • I could try and use the auto-generate in the engine but that hasn’t been really successful, unless I’m not following the process effectively.
  • Much of the process in the texture process was mirroring and overlapping of UVs relative to texturing.

Within Maya, I’m trying to find a process to successfully eliminate overlapping for light mapping for UVs and quickly. Any help, advice or direction would be very helpful.

Thanks so much!

Well. I know 3ds max has a very good uv process. Where it automatically gives your uvs the proper spacing and padding… but setting up each face is on you.

The automatic method in the engine uses your UV seams so the UV’s have to be split up in the first place. Maya should have a method that automatically splits the mesh based on angle and then flattens it out–note that this will not give very good results for lightmaps because very often it splits things too much.

I had to fix UVs in ~300 meshes for a project last year… I totally would hate to do it by hand, so I took some experimentation with the Python/Mel scripting and ended up doing this to fix the UV shells for my models:

import maya.cmds as cmds
import maya.mel as mel

name = "WallProps"
fileType = "fbx"
pathOfFiles = "C:/Users/Bruno/Desktop/SciFiMeshes/Walls/"+name+"/"

files = cmds.getFileList(folder=pathOfFiles, filespec="*.fbx")
if len(files) == 0:
    cmds.warning("No files found")
    idx = 0
    for f in files:
        cmds.file(pathOfFiles + f, i=True)
        mel.eval('polyQuad  -a 30 -kgb 0 -ktb 0 -khe 0 -ws 0 -ch 0 Wall_X600_Y300_Z20;')
        mel.eval('select -r Wall_X600_Y300_Z20;')
        mel.eval('polyForceUV -unitize;')
        mel.eval('polyLayoutUVPrescale0polyMultiLayoutUV -lm 1 -sc 1 -rbf 1 -fr 1 -ps 0.2 -l 2 -gu 1 -gv 1 -psc 0 -su 1 -sv 1 -ou 0 -ov 0;')
        mel.eval('select -r Wall_X600_Y300_Z20;')
        idx = idx+1
        output = "C:/Users/Bruno/Desktop/SciFiMeshes/Walls/WallProps/Release/Wall_"+name+"_"+`idx`+".fbx"
        cmds.FBXExport('-file', output, '-s')

Basically through that script I’d take all the FBX models inside the C:/Users/Bruno/Desktop/SciFiMeshes/Walls/WallProps/ folder, process the UVs, and export the result as FBX again to a Release folder with all UVs ready for lighting.
They all were SciFi walls built by 90º flat square polygons, so the Unitize command worked perfectly for what I needed.
A simple cube/wall would export to FBX with UVs set to be like this:

Maya Please… as the thread states. Thanks!

Very interesting… Thanks for the point on the MEL.

I might attempt to see if it solves my challenge. There are a number of great UV additions with bonus tools but I have just a ton of really fantastic geometry but having to go through it to make the lightmaps is daunting. I’m certainly not going to go through and retexture all of these models when they are already masterfully done, they just don’t fit/adapt to UE4 on the lighting side.

You can get close but always no cigar. I use CE, UE4 and Unity and probably in that order but the options that continue to come, especially with sequencer give me an abundence of power on the visual side of story-telling but not if you have to go back and spend an extraordinary amount of time modifying the UVs.

As I’ve said, I’ve tried coming up with a recipe of sorts and automatic mapping with layout and a few other mixing of techniques but nothing really solves it, always leaving you with an overlapping of 10 to 20% and that won’t complete the task.

Thanks though for your advice. For anyone that provide any more assistance I’d be very grateful for advice!

Thanks again Folks!

Yup… what I have found out since I started using UE4.

Depending on what you’re making, you might want to look into Nvidia VXGI which is a dynamic solution–not as accurate but it can do very well and if you don’t care much about performance it can give you fast results.