Mantaflow not caching if path contains characters with accent #98467

Open
opened 2022-05-28 15:54:10 +02:00 by Didier TRESSE · 18 comments

System Information
Operating system: Windows-10-10.0.22000-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3060 Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 512.96

Blender Version
Broken: version: 3.1.0, branch: master, commit date: 2022-03-08 18:16, hash: c77597cd0e

Short description of error
If the cache folder path for Manta FLow contains "french" accent character, no sim data is computed.

Exact steps for others to reproduce the error

  • Create a simple blen file in a folder named "d:\Données\Blender\2 - Projets Blender\MyFluidSim\fluidSim.blend"
  • Create a simple sphere
  • Choose Object/Quick effect/Quick fluid to create a simple domain
  • Set the cache directory to a subfolder of the .blend file

Move forward to the fluid sim... No simulation data create

To fix it :

  • Just rename "d:*Données*\Blender\2 - Projets Blender\MyFluidSim\fluidSim.blend" to "d:*Workspace*\Blender\2 - Projets Blender\MyFluidSim\fluidSim.blend"
  • Re-open the same file

It works

If cache folder is relative to .blend file or absolute, it doesn't create data if the path contains any character with accent.

Thank you for the great job you are doing
Have a nice day

Didier

**System Information** Operating system: Windows-10-10.0.22000-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 3060 Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 512.96 **Blender Version** Broken: version: 3.1.0, branch: master, commit date: 2022-03-08 18:16, hash: `c77597cd0e` **Short description of error** If the cache folder path for Manta FLow contains "french" accent character, no sim data is computed. **Exact steps for others to reproduce the error** - Create a simple blen file in a folder named "d:\Données\Blender\2 - Projets Blender\MyFluidSim\fluidSim.blend" - Create a simple sphere - Choose Object/Quick effect/Quick fluid to create a simple domain - Set the cache directory to a subfolder of the .blend file # Move forward to the fluid sim... No simulation data create To fix it : - Just rename "d:\**Données**\Blender\2 - Projets Blender\MyFluidSim\fluidSim.blend" to "d:\**Workspace**\Blender\2 - Projets Blender\MyFluidSim\fluidSim.blend" - Re-open the same file # It works If cache folder is relative to .blend file or absolute, it doesn't create data if the path contains any character with accent. Thank you for the great job you are doing Have a nice day Didier
Author

Added subscriber: @MagicDid

Added subscriber: @MagicDid

Added subscriber: @iss

Added subscriber: @iss

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

Can confirm, but since there is no active developer for mantaflow, will set as known issue

Can confirm, but since there is no active developer for mantaflow, will set as known issue
Sonny Campbell self-assigned this 2022-06-27 12:23:36 +02:00
Member

@MagicDid Can you check if this bug is still happening for you in the 3.3 daily build? I think it might have already been resolved there...

@MagicDid Can you check if this bug is still happening for you in the 3.3 daily build? I think it might have already been resolved there...
Author

Hi,

I've downloaded the 3.3 daily build and tried to bake a Mantaflow simulation and it doesn't work if the path of the .blend file contains an accent. A single default cube and apply quick effet / smoke doesn't generate simulation data if the file is stored in ..../Données/MyProject/anyfile.blend

I just renamed it to .../Data/MyProject/anyfile.blend, reopened it and this time simulation data are generated.

Tell me if you need any log/file/etc...

Hi, I've downloaded the 3.3 daily build and tried to bake a Mantaflow simulation and it doesn't work if the path of the .blend file contains an accent. A single default cube and apply quick effet / smoke doesn't generate simulation data if the file is stored in `..../Données/MyProject/anyfile.blend` I just renamed it to `.../Data/MyProject/anyfile.blend`, reopened it and this time simulation data are generated. Tell me if you need any log/file/etc...
Member

@MagicDid |I have created a C:\Données\test.blend . I added a Object > Quick Effects > Quick Smoke to the cube. The cache directory is relative to the blend file as indicated, and when I hit Bake All I can play the animation and see the simulation in Blender 3.3 alpha.

When I try that on Blender 3.2.1 I don't see any simulation. Are you certain it was the 3.3 build you used to test it? Or am I missing somethiing in my test?

image.png

@MagicDid |I have created a C:\Données\test.blend . I added a Object > Quick Effects > Quick Smoke to the cube. The cache directory is relative to the blend file as indicated, and when I hit Bake All I can play the animation and see the simulation in Blender 3.3 alpha. When I try that on Blender 3.2.1 I don't see any simulation. Are you certain it was the 3.3 build you used to test it? Or am I missing somethiing in my test? ![image.png](https://archive.blender.org/developer/F13234689/image.png)
Author

Here is the test environment (see screenshot). The 3.3.0 alpha is from June 28th (this morning).

It seems you're doing the right test. Cannot understand what is the difference between the 2 environment. The only thing I have to change to make it work is the Données changed to Data.

Capture.PNG

Here is the test environment (see screenshot). The 3.3.0 alpha is from June 28th (this morning). It seems you're doing the right test. Cannot understand what is the difference between the 2 environment. The only thing I have to change to make it work is the `Données` changed to `Data`. ![Capture.PNG](https://archive.blender.org/developer/F13234775/Capture.PNG)
Author

Have you tried both accent and space in the path ?

Have you tried both accent and space in the path ?
Author

Hello,

I've downloaded the last Blender release from Git, rebuilt it and when I check the MANTA_main.cpp file, it seems that the modification detailed in https://developer.blender.org/D15301 are not included in this release.

Didier

Hello, I've downloaded the last Blender release from Git, rebuilt it and when I check the `MANTA_main.cpp` file, it seems that the modification detailed in https://developer.blender.org/D15301 are not included in this release. Didier
Author

Hi again,

I've added some Log to understand what happens. Here are the Python command strings "tried" to be executed :

PythonString : bake_fluid_data_3('D:\\Mes Documents\\2 - Personnel\\Blender\\Blender_Projects\\Donn├®es\\TrashTest\\cache_fluid_4b85f272\\data', 241, '.vdb')
PythonString : smoke_save_data_3('D:\\Mes Documents\\2 - Personnel\\Blender\\Blender_Projects\\Donn├®es\\TrashTest\\cache_fluid_4b85f272\\data', 241, '.vdb', False)

Indeed the "é" character is interpreted into something else between the GUI and the internal Manta wrapping implementation.

Hi again, I've added some Log to understand what happens. Here are the Python command strings "tried" to be executed : ``` PythonString : bake_fluid_data_3('D:\\Mes Documents\\2 - Personnel\\Blender\\Blender_Projects\\Donn├®es\\TrashTest\\cache_fluid_4b85f272\\data', 241, '.vdb') PythonString : smoke_save_data_3('D:\\Mes Documents\\2 - Personnel\\Blender\\Blender_Projects\\Donn├®es\\TrashTest\\cache_fluid_4b85f272\\data', 241, '.vdb', False) ``` Indeed the "é" character is interpreted into something else between the GUI and the internal Manta wrapping implementation.
Member

Hey @MagicDid , yeah the problem is that code doesn't actually fix the issue. I thought that was fixing the issue, but the problem is that it's already working for me in the latest release. So when I tested my changes I thought it was fixing the bug, but it wasn't actually doing anything different.

I tried to recreate this issue with a space in the filepath C:\Données\Folder With Space and it also works as expected for me on 3.3, but not on 3.2.1. I'm not really sure why we're seeing different results, maybe it's an issue with environments, but I'm not able to dig any further on it without being able to recreate it I'm afraid...

image.png

Hey @MagicDid , yeah the problem is that code doesn't actually fix the issue. I *thought* that was fixing the issue, but the problem is that it's already working for me in the latest release. So when I tested my changes I *thought* it was fixing the bug, but it wasn't actually doing anything different. I tried to recreate this issue with a space in the filepath `C:\Données\Folder With Space` and it also works as expected for me on 3.3, but not on 3.2.1. I'm not really sure why we're seeing different results, maybe it's an issue with environments, but I'm not able to dig any further on it without being able to recreate it I'm afraid... ![image.png](https://archive.blender.org/developer/F13242898/image.png)
Sonny Campbell removed their assignment 2022-06-30 15:12:42 +02:00
Member

Added subscriber: @SonnyCampbell_Unity

Added subscriber: @SonnyCampbell_Unity
Member

@MagicDid where did you add that logging and I can add it in the same place to see if I can spot any difference?

@MagicDid where did you add that logging and I can add it in the same place to see if I can spot any difference?
Author

In file C:\Projects\Blender\blender\intern\mantaflow\intern

In runPythonStringmethod :

bool MANTA::runPythonString(vector<string> commands)
{
  bool success = true;
  PyGILState_STATE gilstate = PyGILState_Ensure();

  /* Temporarily set `sys.modules["__main__"]` as some Python modules expect this. */
  PyObject *main_mod_backup;
  manta_python_main_module_backup(&main_mod_backup);

  /* If we never want to run this when the module isn't initialize,
   * assign with `manta_python_main_module_ensure()`. */
  BLI_assert(manta_main_module != nullptr);
  manta_python_main_module_activate(manta_main_module);

  for (vector<string>::iterator it = commands.begin(); it != commands.end(); ++it) {
    string command = *it;

    PyObject *globals_dict = PyModule_GetDict(manta_main_module);
    PyObject *return_value = PyRun_String(
        command.c_str(), Py_file_input, globals_dict, globals_dict);
	string tmp = "PythonString : " ;
	tmp = tmp + command ;
	cout << tmp.c_str() << endl ;

I'm working on using the BLI_get_short_name function to solve this issue (at least on Windows platforms)

In file `C:\Projects\Blender\blender\intern\mantaflow\intern` In `runPythonString`method : ``` bool MANTA::runPythonString(vector<string> commands) { bool success = true; PyGILState_STATE gilstate = PyGILState_Ensure(); /* Temporarily set `sys.modules["__main__"]` as some Python modules expect this. */ PyObject *main_mod_backup; manta_python_main_module_backup(&main_mod_backup); /* If we never want to run this when the module isn't initialize, * assign with `manta_python_main_module_ensure()`. */ BLI_assert(manta_main_module != nullptr); manta_python_main_module_activate(manta_main_module); for (vector<string>::iterator it = commands.begin(); it != commands.end(); ++it) { string command = *it; PyObject *globals_dict = PyModule_GetDict(manta_main_module); PyObject *return_value = PyRun_String( command.c_str(), Py_file_input, globals_dict, globals_dict); string tmp = "PythonString : " ; tmp = tmp + command ; cout << tmp.c_str() << endl ; ``` I'm working on using the `BLI_get_short_name` function to solve this issue (at least on Windows platforms)
Member

Yeah I see the same in mine:

PythonString : bake_fluid_data_3('C:\\Donn├®es\\Folder With Space\\cache_fluid_4b85f272\\data', 50, '.vdb')
PythonString : liquid_save_data_3('C:\\Donn├®es\\Folder With Space\\cache_fluid_4b85f272\\data', 50, '.vdb', False)

but my simulation runs when I play the animation

image.png

and my fluid cache has the data

image.png

I'm on Windows 10 too.

Yeah I see the same in mine: ``` PythonString : bake_fluid_data_3('C:\\Donn├®es\\Folder With Space\\cache_fluid_4b85f272\\data', 50, '.vdb') PythonString : liquid_save_data_3('C:\\Donn├®es\\Folder With Space\\cache_fluid_4b85f272\\data', 50, '.vdb', False) ``` but my simulation runs when I play the animation ![image.png](https://archive.blender.org/developer/F13243216/image.png) and my fluid cache has the data ![image.png](https://archive.blender.org/developer/F13243220/image.png) I'm on Windows 10 too.
Author

Hi,

I finally succeeded in understanding what happens in my case. The issue is due to the OpenVDB implementation at the end of the C++ => Python => C++ architecture of Mantaflow in Blender. Here is a sequence diagram of the successive calls leading to the erroneous interpretation of the path at the end.
TrashSequence.png

During all the sequence the path is correctly interpreted as UTF-8 and finally in the OpenVDB implementation the path is interpreted as a basic string (ASCII) by use of std::ofstream with std::string instead of std::swstring. As this is in OpenVDB distribution, there is no chance this to be fixed.

To prove this, I changed the export format to "UNI cache" instead (which is not implemented the same way) and the simulation bake works and I can play it...

Now I know it I'll change my folder's name.

Thanks for your time

Question : how can I help by fixing some issues in Blender ? How to pick up issues ?

Hi, I finally succeeded in understanding what happens in my case. The issue is due to the OpenVDB implementation at the end of the C++ => Python => C++ architecture of Mantaflow in Blender. Here is a sequence diagram of the successive calls leading to the erroneous interpretation of the path at the end. ![TrashSequence.png](https://archive.blender.org/developer/F13261034/TrashSequence.png) During all the sequence the path is correctly interpreted as UTF-8 and finally in the OpenVDB implementation the path is interpreted as a basic string (ASCII) by use of std::ofstream with std::string instead of std::swstring. As this is in OpenVDB distribution, there is no chance this to be fixed. To prove this, I changed the export format to "UNI cache" instead (which is not implemented the same way) and the simulation bake works and I can play it... Now I know it I'll change my folder's name. Thanks for your time **Question :** how can I help by fixing some issues in Blender ? How to pick up issues ?

@MagicDid Thanks for detailed analysis.

In #98467#1385779, @MagicDid wrote:
Question : how can I help by fixing some issues in Blender ? How to pick up issues ?

In general, pick area you would like to work on and contact developers that maintain this area. They can probably provide you with easier tasks here on tracker so you can get familiar with development process. See https://wiki.blender.org/wiki/Modules

It's good idea to read through wiki and good starting point is https://wiki.blender.org/wiki/Developer_Intro/Overview

@MagicDid Thanks for detailed analysis. > In #98467#1385779, @MagicDid wrote: > **Question :** how can I help by fixing some issues in Blender ? How to pick up issues ? In general, pick area you would like to work on and contact developers that maintain this area. They can probably provide you with easier tasks here on tracker so you can get familiar with development process. See https://wiki.blender.org/wiki/Modules It's good idea to read through wiki and good starting point is https://wiki.blender.org/wiki/Developer_Intro/Overview
Philipp Oeser removed the
Interest
Nodes & Physics
label 2023-02-10 08:44:01 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#98467
No description provided.