Skip to content

Commit

Permalink
Fix running nestmap multiple times after mesh step
Browse files Browse the repository at this point in the history
  • Loading branch information
vbousquet committed Aug 22, 2023
1 parent ffa99a5 commit 891c86f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion addons/vpx_lightmapper/vlm_nestmap_baker.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ def render_nestmaps(op, context):
op.report({'ERROR'}, f'Object {obj.name} is missing the required unwrapped UV map named \'UVMap\'.')
return {'CANCELLED'}
obj.data.uv_layers.active = uvmap
obj.data.uv_layers.new(name='UVMap Nested')
if not obj.data.uv_layers.get('UVMap Nested'):
obj.data.uv_layers.new(name='UVMap Nested')
obj.data.uv_layers.active = uvmap
has_normalmap = next((mat for mat in obj.data.materials if mat.get('VLM.HasNormalMap') == True and mat['VLM.IsLightmap'] == False), None) is not None
# VPX only supports opaque HDR therefore we pack all non lightmaps as LDR (luckily base bake is usually LDR, and we don't really need this for lightmaps which are RGB only)
Expand Down

0 comments on commit 891c86f

Please sign in to comment.