Skip to content

Commit

Permalink
Misc fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vbousquet committed Aug 22, 2023
1 parent e36f68e commit d12c859
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions addons/vpx_lightmapper/vlm_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ def append_structure(src_path, mode, hashed):
writer.write_tagged_bool(b'CLDR', obj == pfobj)
writer.write_tagged_bool(b'ISTO', obj != pfobj)
writer.write_tagged_bool(b'U3DM', True)
writer.write_tagged_bool(b'STRE', obj == pfobj or (not is_lightmap and col.vlmSettings.use_static_rendering))
writer.write_tagged_bool(b'STRE', obj == pfobj or (not is_lightmap and col.vlmSettings.use_static_rendering and col.vlmSettings.is_opaque))
writer.write_tagged_u32(b'DILI', 255) # 255 is 1.0 for disable lighting
writer.write_tagged_float(b'DILB', 1.0) # also disable lighting from below
writer.write_tagged_bool(b'REEN', False)
Expand Down Expand Up @@ -483,7 +483,6 @@ def append_structure(src_path, mode, hashed):
compressed_indices = zlib.compress(struct.pack(f'<{n_indices}H', *indices))
writer.write_tagged_u32(b'M3CJ', len(compressed_indices))
writer.write_tagged_data(b'M3CI', compressed_indices)
print(3)
if (obj == pfobj) or col.vlmSettings.is_opaque:
depth_bias = 0
elif is_lightmap:
Expand All @@ -496,7 +495,7 @@ def append_structure(src_path, mode, hashed):
writer.write_tagged_u32(b'COLR', 0xFFFFFF)
writer.write_tagged_bool(b'LOCK', True)
writer.write_tagged_bool(b'LVIS', True)
writer.write_tagged_bool(b'ZMSK', True if (is_lightmap or (obj == pfobj) or not col.vlmSettings.is_opaque) else False)
writer.write_tagged_bool(b'ZMSK', False if (is_lightmap or (obj == pfobj) or not col.vlmSettings.is_opaque) else True)
writer.write_tagged_u32(b'LAYR', 0)
writer.write_tagged_string(b'LANR', 'VLM.Lightmaps' if is_lightmap else 'VLM.Visuals')
if is_lightmap:
Expand Down

0 comments on commit d12c859

Please sign in to comment.