rlguy / Blender-FLIP-Fluids

The FLIP Fluids addon is a tool that helps you set up, run, and render high quality liquid fluid effects all within Blender, the free and open source 3D creation suite.
https://www.blendermarket.com/products/flipfluids
GNU General Public License v3.0
1.63k stars 184 forks source link

Command line baking error when unicode characters contained in filepaths #606

Closed PavelBlend closed 1 year ago

PavelBlend commented 1 year ago

System and Blend File Information

Blender Version: 3.4.1, blender-v3.4-release, 2022-12-19 17:00, 55485cb379f7 Addon Version: A FLIP Fluid Simulation Tool for Blender (v1.6.1 Stable 06-JAN-2022) OS: Windows-10-10.0.19042-SP0 GPU: AMD Radeon HD 7560D ATI Technologies Inc. 4.5.13399 Core Profile Context 15.201.1151.1008 CPU: AMD A8-5600K APU with Radeon(tm) HD Graphics
CPU Threads: 4 RAM: 16 GB

Blender Binary: C:\progs\blender34\blender.exe Addon Path: C:\Users\Pavel_Blend\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\flip_fluids_addon Renderer: CYCLES Cycles Device: CPU Viewport Modes: Unknown Objects: 0 FLIP Objects: 0 FLIP Domains: N/A Obstacle Objects: 0 Fluid Objects: 0 Inflow Objects: 0 Outflow Objects: 0 Force Objects: 0 Cache Path: N/A Cache Exists: N/A Cache Logs: N/A Simulation Visibility: N/A Surface Visibility: N/A Whitewater Visibility: N/A Enabled Features: N/A Enabled Attributes: N/A Lock Interface: Disabled Cycles Persistent Data: Disabled Developer Tools: Enabled Mixbox Plugin: Installed Enabled Addons: XRay Engine Tools, FLIP Fluids 1.6.1

Describe the bug

If the blend file is placed in a folder that has unicode characters, then there will be an error:

C:\progs\blender34>"C:\progs\blender34\blender.exe" --background "D:\╨║╨╕╤А╨╕╨╗╨╕╤Ж╨░\volume_force_control_object-2.9.blend" --python "C:\Users\Pavel_Blend\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\flip_fluids_addon\resources\command_line_scripts\run_simulation.py"
Blender 3.4.1 (hash 55485cb379f7 built 2022-12-20 01:51:19)
Read prefs: C:\Users\Pavel_Blend\AppData\Roaming\Blender Foundation\Blender\3.4\config\userpref.blend
╨Ю╤И╨╕╨▒╨║╨░: ╨Э╨╡ ╤Г╨┤╨░╨╗╨╛╤Б╤М ╨┐╤А╨╛╤З╨╕╤В╨░╤В╤М ╤Д╨░╨╣╨╗ ┬лD:\тХитХСтХитХХтХд╨РтХитХХтХитХЧтХитХХтХд╨ЦтХитЦС\volume_force_control_object-2.9.blend┬╗: No such file or directory

Blender quit
--------------------------------------------------------------------------------
SIMULATION TERMINATED: An unknown error has caused Blender to crash (error code 1)
Attempting to re-launch simulation (attempt 1 / 5)
--------------------------------------------------------------------------------

I am running a simulation using command line tools. Addon does not support unicode characters in the path. My blend file is in the folder: D:\кирилица\volume_force_control_object-2.9.blend

rlguy commented 1 year ago

Thanks for the report! I can confirm the issue.

Until this is fixed, a workaround can be to use the Copy Bake Command operator and then copy the command manually into the Windows Command Prompt.

image

"C:\progs\blender34\blender.exe" --background "D:\кирилица\volume_force_control_object-2.9.blend" --python "C:\Users\Pavel_Blend\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\flip_fluids_addon\resources\command_line_scripts\run_simulation.py"
rlguy commented 1 year ago

I've just had a chance to look further into this issue. This issue affects command line operators that generate a Windows Batch file (.bat) and then run the file in CMD. The operators affected by this were the Launch Bake operator and the Render > Generate/Run Batch File operators.

This resulted in a error because the batch file commands were being run with the default system settings, which likely is not set for unicode support. This has been fixed by adding a command chcp 65001 to the generated batch files so that they are interpreted correctly with unicode support (Microsoft Documentation > Console Code Pages).

This fix will be available in the next version of the FLIP Fluids addon. Date currently unknown, but at the latest this will be March 20th 2023 before the release of Blender 3.5.