- This topic has 2 replies, 2 voices, and was last updated 2 years, 11 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
Home › Forum › SofaPython3 › Getting Started › [SOLVED] VS code SofaRuntime.importPlugin cannot be resolved
Tagged: GCC, Linux_ubuntu, SOFA_2106, SofaPython3
Hi all,
I just installed Sofapython3 and defined environmental variables following the tutorial on https://sofapython3.readthedocs.io/en/latest/menu/SofaPlugin.html
Now I am ready to write my script in VS code by starting from import Sofa and import SofaRuntime, both of which can be resolved by VS code. However, it fails to resolve SofaRuntime.importPlugin, Sofa.Core.Node etc, although libSofaComponentAll.so is successfully loaded after building the task. Wonder if there is a way to configure VS code so that SofaRuntime.importPLugin etc could be resolved?
Cheers
I think this will be a very difficult task because any SOFA plugin libraries are loaded at the C++ level, so python and any IDEs would have a hard time knowing what components would become available before runtime. Maybe it’d be possible to hide the importPlugin call to a python wrapping of individual plugins that contain explicit pybinding files. Then a user could just call something like “import SofaComponentAll” at the top of a python script… Would be cool. Honestly sounds like a lot of upkeep work though. 🙁
Thanks for your reply and advice. I am now aware that there is no “direct” way of writing up a sofa python script with autocompletion. In this case, I will reevaluate the workload of developing tissue cutting simulation using C++ against python3 given available online references.
Cheers
WARNING
The forum has been moved to GitHub Discussions.
Old topics and replies are kept here as an archive.