How to install

Once you receive the SofaUnity package, unzip the Unity3D package and follow those steps :

  1. From Unity3D, open your project or create a new 3D project. Use normal or HDRP project depending on the package version you requested.
  2. In Unity3D Editor, use Assets -> Import Package -> Custom Package and load the .unitypackage.



3. Once the package has been fully loaded, place the license file inside {your Unity3D project}/Assets/SofaUnity/License/. Replace the existing file if needed.

4. Finally, check the config file: {your Unity3D project}/Assets/SofaUnity/Plugins/Native/x64/sofa.ini

It should contain 2 lines leading to your project path. It should looks like this:



5. Change those paths if you want to use another directory where you store your SOFA scenes and meshes.


Once ready to be used the SofaUnity asset folder should look like this:

  • License:  Where to place license file.

  • Plugins
    • Native:  SOFA x64 .dll files folder.
    • SofaUnityAPI:  API scripts interfacing with Sofa library.
    • SU_Geomagic:  Specific plugin, contains scripts and scenes for Geomagic device support.
    • SU_XRay: Specific plugin, contains scripts and scenes for XRay simulation.
    • Virtual Capsule Endoscopy:  Specific plugin for endoscopy simulation.
  • Ressources:  Unity materials, textures and images.

  • Scenes

    • Benchmarks: Some specific scenes for benchmark tests.
    • Demos:  All the demo scenes described in the Examples section.
    • SofaScenes: Sofa .scn files with their data.
  • Scripts: all asset classes in C#:

    • Core:  Class to represent SOFA objects using Unity3D GameObject
    • Editor:  Class to implement Objects Unity Editor inspectors
    • Modules:  Specific classes inheriting from Core classes
    • UI:  3D UI controlling SOFA player in game.
    • Utils:  Scripts of useful components/algorithms.