Preserve uv's for texture map while creating a lightmap

I must be missing something obvious but here’s my problem. I have a model with a couple of materials. I select linked by material, go to uv editing and start unwrapping and laying out my uv’s for texture mapping. So far so good. Works just fine. Then I take the next step and I want to add a second uv map for light mapping. I can use the plus button to add a UVmap in the object data properties section but I the fail completely at making changes to only the second UV map.

I tried deselecting all, then clicking on the second uv map in the properties section to highlight it. Then select all vertices and mark the all as seam. Unwrap with margin (all of which works fine by the way) but I find that my first UV map has also been changed and all of the hard work of making sure all the face are aligned along the right U or V axis would have been lost if I not had a backup.

Again, seems so basic to me that it is probably staring me in the face but I can’t see it.

Cheers

It works for me. Make sure you not only select the 2nd UV map, but also enable it by clicking on that small camera icon. Hope this helps!

I’d suspect that you are making changes only to your second (light map) UV map, but that because you aren’t using a UV map node to specify your texture lookups in your material’s nodes, that you’re using your lightmap UV for all purposes. Use a UV map node in your nodes when using multiple UV if you aren’t already.

Thanks for the suggestion but unfortunately it doesn’t work for me. Selecting unwrap while the second uv map is selected as well as the icon will still change the mapping of the first uv map.

Ok. This sort of makes sense to me. I can imagine a sort of all purpose use for uv maps if one doesn’t specify a particular use. I am familiar with the node concept but not yet very experienced with it in Blender.

Following your suggestion this is what the material looks like now. However behaviour in the uv editing menu hasn’t changed. Both uv maps still get changed when unwrapping.

Then I’d have to see a file to tell you what’s happening.

Sure. Let me know where to send it. I’ve just made a reduced copy of about 7Mb. The objects in question all have the material WoodCabinet. One detail is that I don’t do any rendering in Blender yet. I texture the model in Substance Painter and then send it on to Unity. When you have selected all the right objects the uv map for texturing should look like this with all faces aligned to match the wood grain direction.

Cheers and thanks.

You can host it anywhere you want. If you can reproduce the issue in a small enough file, you can host it on pasteall.org, which requires no registration.

I can’t test in Unity or SP. I’ve been working under the assumption that when you say that editing the UV map in Blender changes both UV maps, that it changes both UV maps in Blender-- if that’s the case, I don’t need to do anything in Unity or SP.

If I was mistaken, and the UV maps change in Blender but you’re not reading the UV map you expect to in either/or Unity, SP, then the issues are whatever techniques you’re using with those applications, and I can’t help you with that.

No, the issues I am having all happen in Blender. I was just explaining my workflow so you’d know why, for instance, I did not set-up my material “properly” as I would replace the material completely in SP anyway. In this case I am just “interested” in the fbx, objects with a distinct material and their texture and light uvmaps.
The first parts I have under control :slight_smile: creating the light maps in Blender without destroying the texture uv maps is what I’m struggling with.

The file is at https://pasteall.org/media/7/8/784e9c233f8943aa0f1cfceace5cbec0.blend

You’ve got a lot of different objects in that file, and I don’t see that any of them have additional UV. They all only have a single UV map.

When I create a new UV map on one of them and edit it, it edits fine, and doesn’t change the other UV map.

I suspect that you probably selected everything and hit + to create a new UV map, creating a new UV map only on the actively selected object. Nothing else got a new UV map when you did that. When you entered multi-object editing on your selection, exactly one object was using the new UV map, and every object was still using the old UV map-- the only UV map they had.

With this many objects, what is the fastest way to create a new UV map on all of those objects? Well, to join them into a single object, but I imagine there are reasons you don’t want to do that (animation, although I’d be armature deforming this model personally.)

What else can you do to rapidly create a single new UV map for every object at once? I’m afraid I don’t know. Not outside of scripting. Oh, one idea, which is to data transfer UV from a joined duplicate-- you can copy modifiers via ctrl l “make links” operation, followed by alt c “convert to” mesh (writing that modifier), both of which can be done on any number of selections simultaneously. Edit: or probably that wouldn’t work, because it wouldn’t be smart enough to generate the UV layers without you telling each individual object to. I don’t know without testing.

Yes. You’re right about what you suspect. I selected all and hit +.

So I have two options I think. First add a new UV to each object individually and then multi edit it or join various objects into one or two new single objects. I did create this specific hierarchy with optional animation in mind. I will look into what armature deforming has to offer.

OK. So I’ve got something to try out tonight. See how that works out for me. I will also, at some stage, try out rendering this in Blender. For now this is what it looks like in SP.

Thanks for your help so far.

By the way, for Unity you can use directly the .blend file, works better than the FBX export.

So, it does turn out to be a multi edit problem. I added an extra uv map to every object and then tried multi edit again but it looks like when you switch between uv maps 1 and 2 it only does that for the currently actively selected object, not for all objects. I even got the impression that Blender just uses whatever uv map happens to be selected on all the other, not actively selected, objects, not respecting the uv map selections one makes in the interface (while multi editing). When editing the uv maps per object the distinction between the two uv maps is properly maintained. For the moment I have joined all objects into one and with only one set of uv maps to content with Blender purrs happily.

Thanks everyone for helping clear this up.

1 Like