Substance 3D Blender 3.0.1 crashes on Windows with non-UTF-8 OEM code page (CP866)
Environment:
Windows 10 22H2
Blender 5.2
Substance 3D Add-on for Blender 3.0.1
Substance Integration Tools 3.0.0
System locale: Russian
Console OEM code page: CP866
Issue:
The Substance 3D add-on fails during registration and the SBSAR Load button remains disabled.
The failure happens in:
Substance3DInBlender/toolkit/manager.py
inside SRE_ToolkitManager.is_running().
The code launches PowerShell using:
subprocess.Popen(..., text=True)
without specifying the output encoding.
On Windows with OEM code page CP866, PowerShell output is not valid UTF-8, while Blender/Python attempts to decode it as UTF-8.
This causes:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8c
followed by:
AttributeError: 'NoneType' object has no attribute 'splitlines'
Steps to reproduce:
- Use Windows with Russian system locale / CP866 console code page.
- Install Blender 5.2.
- Install Substance 3D Add-on 3.0.1 and Integration Tools 3.0.0.
- Launch Blender normally.
- The add-on fails during registration and SBSAR loading is unavailable.
Workaround:
Running Blender from a console after:
chcp 65001
makes the add-on initialize successfully.
Proposed fix:
Explicitly decode PowerShell output using the Windows OEM code page, for example:
encoding="oem", errors="replace"
A more robust implementation would also query only the process ID rather than parsing the full WMI object output.
Example:
Get-WmiObject win32_process -Filter "Name = 'substance_remote_engine.exe'" | Select-Object -ExpandProperty ProcessId
