9 October 2020 at 19 h 14 min #17338
How can I consider the file name in GmshLoader as a variable in python scripting, so it can change during run time?
Zahra10 October 2020 at 0 h 22 min #17347
Hey @zahra !
First of all, for a proper update of the GmshLoader, you might have to use the master branch of SOFA. Current work are ongoing on building a robust architecture for component updates. (If you want to know more, do not hesitate to join the SOFA Symposium and Technical Committee !)
Anyway, in python, you would just need to access and replace the Data field
filenamein your python function.
If you share with us a simplified version of your scene I could give you a more relevant example. Best,
Hugo10 October 2020 at 20 h 00 min #17353
Thank you for reminding, I registered for the event.
Regarding the question, I tried a similar approach that you suggested, but it doesn’t work. Please find the codes and gmsh files in the link below:
I uploaded three gmsh files, but in my work I need to load a large number of gmsh files during the animation.
Zahra11 October 2020 at 21 h 47 min #17363
I think you will never succeed to get a different filename (here filename being a string variable) by writing this:
Let us know if it helps.
Hugo11 October 2020 at 22 h 56 min #17368
Thank you for your reply. I tried your suggestion at first and it didn’t work (In struggling to find a solution, I wrote it as a string and forgot to correct it before uploading).11 October 2020 at 23 h 13 min #17369
Which version of SOFA are you using?12 October 2020 at 21 h 12 min #17388
It is currently 17.06 stable version (I tried it using 18.06 and it didn’t work either). Is it working on the newest versions?12 October 2020 at 21 h 21 min #17389
As I said in my previous message, you might have to go for the master branch or wait for the v20.12 (not so far away !). The automatic reload of a mesh when changing the filename has been introduced in #1408. Until this PR, MeshLoader was a passive class in the scene.
I hope this helps.
Hugo12 October 2020 at 22 h 01 min #17390
Thank you for the explanation on “MeshLoader being a passive class in the scene”. I now understand the necessity of using the master branch to solve this issue.
- You must be logged in to reply to this topic.