Update leenkx/blender/lnx/lightmapper/utility/build.py

This commit is contained in:
2025-09-19 22:52:01 +00:00
parent 58e009f709
commit b6e96553c2

View File

@ -1,4 +1,16 @@
import bpy, os, subprocess, sys, platform, aud, json, datetime, socket
import bpy, os, subprocess, sys, platform, json, datetime, socket
aud = None
try:
import aud
except (ImportError, AttributeError) as e:
if any(err in str(e) for err in ["numpy.core.multiarray", "_ARRAY_API", "compiled using NumPy 1.x"]):
print("Info: Audio features unavailable due to NumPy version compatibility.")
else:
print(f"Warning: Audio module unavailable: {e}")
aud = None
from . import encoding, pack, log
from . cycles import lightmap, prepare, nodes, cache
@ -1117,9 +1129,12 @@ def manage_build(background_pass=False, load_atlas=0):
scriptDir = os.path.dirname(os.path.realpath(__file__))
sound_path = os.path.abspath(os.path.join(scriptDir, '..', 'assets/'+soundfile))
device = aud.Device()
sound = aud.Sound.file(sound_path)
device.play(sound)
if aud is not None:
device = aud.Device()
sound = aud.Sound.file(sound_path)
device.play(sound)
else:
print(f"Build completed!")
if logging:
print("Log file output:")