Home › Forum › SOFA › Using SOFA › Combining SOFA and Unity
- This topic has 15 replies, 6 voices, and was last updated 7 years, 6 months ago by Alex Bilger.
-
AuthorPosts
-
17 May 2016 at 17:36 #6779MichelBlocked
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?
Best wishes,
Michel
17 May 2016 at 17:56 #6780HugoKeymasterHi Michel,
I know @alexbilger already did something very similar to what you mention.
Maybe could he have some suggestions!Cheers,
Hugo
17 May 2016 at 18:36 #6781MichelBlockedHi Hugo,
thanks for your insightful post. This is a good start.
Cheers,
Michel
18 May 2016 at 07:55 #6782Alex BilgerBlockedHi Michel,
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.
Good luckAlex
6 June 2016 at 13:30 #7016HugoKeymaster22 August 2016 at 11:27 #7369MegaMindBlockedI 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.
http://www.digital-trainers.com/blender-sofa-en/
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.
BlenderPatient
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:
rigid,
regular and sparse grids,
triangular FEM,
tetrahedron FEM,
collision models based on meshes,
fixed point constraints,
bilateral 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:06 #7381HugoKeymasterHi Pavlov,
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.Cheers.
Hugo
25 August 2016 at 00:06 #7400MegaMindBlockedCan 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:49 #7428HugoKeymasterHi 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.
Best wishes,
Hugo
2 September 2016 at 12:37 #7431samBlockedHi Hugo,
We’re developing our medical application with UE4, not Unity. I’d like to know if any developers are working on SOFA UE4 plugin?
Best,
Sam2 September 2016 at 13:50 #7432HugoKeymasterHi, 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.Cheers,
Hugo
12 December 2016 at 23:28 #8081HugoKeymaster19 April 2017 at 11:42 #8962HugoKeymasterRead our latest news about it!
SOFA being integrated
in unity 3d
19 April 2017 at 12:02 #8963Alex BilgerBlockedIt’s good news! Glad to know someone has results. Good job Erik!
19 June 2017 at 16:48 #9333WongBlockedHello @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:57 #9335Alex BilgerBlockedI recommend @epernod for answering this question
-
AuthorPosts
- You must be logged in to reply to this topic.