17 May 2016 at 17 h 36 min #6779MichelParticipant
- Old Dominion University
Dear SOFA users,
this summer I get to wear the grad student hat, and I’ve gotten funding to integrate SOFA features into a Unity-based surgery simulator. Has anyone researched how to best combine Unity with SOFA, and provide suggestions on how to best proceed?
Michel17 May 2016 at 17 h 56 min #6780
I know @alexbilger already did something very similar to what you mention.
Maybe could he have some suggestions!
Hugo17 May 2016 at 18 h 36 min #6781MichelParticipant
- Old Dominion University
thanks for your insightful post. This is a good start.
Michel18 May 2016 at 7 h 55 min #6782
the best I can do is to give you this link: http://docs.unity3d.com/Manual/Plugins.html. I’ve never done that, but I admit this combination would be very useful! Let us know your progress or your questions.
Alex6 June 2016 at 13 h 30 min #7016
Any advances about SOFA with Unity ?
Can we help in any way ?
Hugo22 August 2016 at 11 h 27 min #7369MegaMindParticipant
I have been wanting SOFA and Unity3d together for years and asked around and even tried a little. Please look at the work done by digital-trainers.com that created a way to incorporate SOFA with other apps and they did as an example with Blender which is very cool but of course not fully realized for functionality and buggy (I really hope they continue to build it so let them know). They have a free version of the product but it’s not open source unfortunately and the source version is super expensive. But hey maybe you can get funding for it actually and it would get you a huge start on the project in a professional way and then you can work on really getting a good integration of all the SOFA features into Unity3d. Please let us know the GitHub or BitBucket etc info so we can help and try it out.
Blender SOFA is a version of the 3D modelling tool Blender that has been modified to propose SOFA as an alternative physical engine for the Game engine. That modification has been made using the Sofa Front-end library.
Blender SOFA is currently based on the version 2.74 of Blender and is currently only available for Linux and Windows (a Mac version is scheduled).
This first version of Blender SOFA is limited to only a small subset of all the SOFA models. We will complete it gradually according to the feedback we receive.
What can I do with it ?
You can use Blender SOFA for instance to ease the creation of your SOFA scenes, by taking advantage of all the functionalities provided by Blender.
The main functionalities of Blender SOFA are the following:
creation of the following deformable models:
regular and sparse grids,
collision models based on meshes,
fixed point constraints,
constant force fields,
constraints or penalty contact resolution,
iteration of the simulation in Blender,
export to .scn and .obj files, that can be read for instance by runSofa.23 August 2016 at 12 h 06 min #7381
You are perfectly right.
Coupling SOFA with either Unity or Blender is a very hot topic. DigitalTrainers were looking at the coupling with Blender, but there is no further development than their available SofaBlender.
We are looking at ways to fund this work. A collaborative project could be very productive.
We will let you know about the advancement of this project.
Finally, if anyone else is interested in this, please let ut know or contact the consortium.
Hugo25 August 2016 at 0 h 06 min #7400MegaMindParticipant
Can anyone describe the theoretical steps involved to combining SOFA and Unity3d? There is an established way to create a wrapper for C++ code and there is a Python interpreter.
This may seem a simplistic method that is based on ignorance but since Unity3d can use ‘Layers’ for visualization could it be possible to just run SOFA to that layer and then auto mesh the model in Unity3d. And since SOFA uses layers as well it could use the generated layer to be the bridge between the two engines so the SOFA model could interact with native Unity objects/environment. Andrey P2 September 2016 at 11 h 49 min #7428
Hi Andrey !
I just asked to our devs if some of them had experience on this. Hopefully, you’ll soon get some feedback! Fore sure, from an architecture point of view, both SOFA and Unity couple well with eachother.
A project (in applications/project) is already available in SOFA: SofaPhysicsAPI. This project allows to use SOFA as a lib external projects. I think this could be most helpful.
Moreover, several SOFA developers are also interested in coupling SOFA with Unity: @samai just started looking at it, and @michelodu started this topic some months ago. They might both give you feedback about their experience / issues.
So if any of you, made some progress or want to share his/her experience about SOFA and unity, please do not hesitate to carry on commenting this.
Hugo2 September 2016 at 12 h 37 min #7431samParticipant
We’re developing our medical application with UE4, not Unity. I’d like to know if any developers are working on SOFA UE4 plugin?
Sam2 September 2016 at 13 h 50 min #7432
Hi, sorry Sam !
Indeed there is a topic dedicated for this.
You can find it here: https://www.sofa-framework.org/community/forum/topic/combining-sofa-with-unreal-engine/
Please do not hesitate to post your questions there.
What I wrote about the the project SofaPhysicsAPI (available in applications/project) remains valid for Unreal.
Hugo12 December 2016 at 23 h 28 min #8081
Here is a post from Erik about SofaPhysicsAPI, it could be of interest.
Hugo19 April 2017 at 11 h 42 min #896219 April 2017 at 12 h 02 min #8963
It’s good news! Glad to know someone has results. Good job Erik!19 June 2017 at 16 h 48 min #9333WongParticipant
Hello @alexbilger ,
Which way do you use to combine Sofa with Unity? Managed Plugins or Native Plugins? How to use the C++ classes in C#?
The data structure type in C++ is different from that in C#.So how to pass the data from C++ to C# ?19 June 2017 at 16 h 57 min #9335
- You must be logged in to reply to this topic.