Skip to content

Error opening demo Python scenes #269

Open

Description

@inn-pgonzalez

Hello! I tried opening one of the Python demo scenes included with the plugin. According to the changelog, this issue was supposed to be fixed, but when I open the scene I still get the following error:

Image

Has anyone else run into this issue or knows what might be causing it?

Activity

  1. PierreFonda3D commented on Jul 7, 2026

    @PierreFonda3D
    Contributor

    Hello.

    The problem seems to be caused by a missing Python plugin. Could you check that in "YourProject\Assets\SofaUnity\Core\Plugins\Native\Windows\x64\" there is a file named "SofaPython3.dll" and a folder named "python3" that is not empty?

    If either of those is missing, let us know and we will send it to you.

    If those two things are present, could you try the following:

    • Open the Unity scene: "Assets\SofaUnity\Scenes\Demos\Python\LiverPython.unity"
    • In the Hierarchy, delete the SofaContext GameObject.
    • Create a new SofaContext. :
    Image
    • Click the SofaContext, then in the Inspector click the "Load SOFA Python Scene" button.
    • Open "Assets\SofaUnity\Scenes\SofaScenes\liver.py".

    If you still get the same error, we will investigate further.

    Thanks!

  2. inn-pgonzalez commented on Jul 8, 2026

    @inn-pgonzalez
    Author

    Hello,

    Inside the Native folder, I only have the x64 folder. Inside x64, there is the python3 folder and the SofaPython3.dll file.

    When I try to create the context, I get an error saying that the DLL cannot be loaded, even though the SofaPython3.dll file is present.

    SofaContextAPI::loadPlugin: C:/Users/Qablo/Desktop/Proyectos/Proyectos Autopilot/autopilot-haptics-sofa/Autopilot/Assets/SofaUnity/Core/Plugins/Native/x64/SofaPython3.dll, method returns: -12: Sofa plugin loading failed. Cause: invalid loading.
    UnityEngine.Debug:LogError (object)
    SofaUnityAPI.SofaContextAPI:loadPlugin (string) (at Assets/SofaUnity/Core/Plugins/SofaUnityAPI/SofaContextAPI.cs:245)
    SofaUnity.PluginManagerInterface:LoadPlugins () (at Assets/SofaUnity/Core/Scripts/Core/System/PluginManager.cs:254)
    SofaUnity.SofaContextEditor:PluginSection (SofaUnity.SofaContext) (at Assets/SofaUnity/Core/Scripts/Editor/SofaContextEditor.cs:147)
    SofaUnity.SofaContextEditor:OnInspectorGUI () (at Assets/SofaUnity/Core/Scripts/Editor/SofaContextEditor.cs:113)
    UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
    
  3. azizsnd commented on Sep 2, 2026

    @azizsnd

    hello i have the same problem, when i tested scene .scn its work but when i test scene python its not work

    The SofaPython3.dll shipped with my SofaUnity v25.12 package depends on python313.dll, while the SofaPython3.dll from my SOFA v25.12 installation depends on python312.dll. The Unity project does not contain a Python DLL. SofaPython3.dll is x64 in both cases. When I enable SofaPython3 in SofaContext, Unity reports -12: Sofa plugin loading failed (invalid loading) and may close immediately @PierreFonda3D

  4. epernod commented on Sep 13, 2026

    @epernod
    Contributor

    Hi,

    invalid loading means the dll can't be load in memory in SOFA, so there is probably an error in the dll dependencies. I guess it is the version of python.

    could you downlaod the Dependencies application: https://github.com/lucasg/dependencies
    and using the DependenciesGui.exe load the SofaPython3.dll and check for any error. You should have something like this:

    Image
  5. inn-pgonzalez commented on Sep 28, 2026

    @inn-pgonzalez
    Author

    Hi,

    I’ve downloaded the Dependencies application and checked the SofaPython3.dll using DependenciesGui.exe.

    It looks exactly the same as in your example, but the same errors are still showing up.

    Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions