Page 2 of 3

Re: Motive to Unity

Posted: Fri Mar 13, 2015 3:55 pm
by beckdo
Hey Brad,

We include a DLL based Unity plug-in project with the Camera SDK. It's unfortunately a bit dated. We found that there were a number of down-sides to the DLL approach to Unity. It's platform-specific, requires a pro license, and struggled with some issues related to connecting directly to the hardware from within the Unity DLL plug-in.

Our customers have had great traction with the simplicity of the sockets based approach and it doesn't suffer from any of the down-sides listed above.

That said, we might in the future and also there's nothing stopping a customer from putting together the DLL.

Thanks,
Doug

Re: Motive to Unity

Posted: Tue Mar 24, 2015 8:18 pm
by hulnglei
Hello, the google share is dated. Can you share it again?

Re: Motive to Unity

Posted: Tue Mar 24, 2015 8:47 pm
by BradleyNewman
hulnglei wrote:Hello, the google share is dated. Can you share it again?
The link should still work..can you explain in more detail the problem you are experiencing?

Re: Motive to Unity

Posted: Wed Jun 17, 2015 4:42 pm
by DmitriG
BradleyNewman wrote:The link should still work..can you explain in more detail the problem you are experiencing?
Hey Bradley,
your UnityProject works perfectly fine for me with rigidBodies!

I'm currently developing a couple of avatar based Unity 5 scenes for my thesis and wondering myself if you had may be already written some parts of code to acquire skeleton data with NatNet SDK (UnityToMotive v2) from Motive (C#) during your project?
In the NatNetSDK\include\NatNetTypes.h file I've found sSkeletonDescription and sSkeletonData structures, but I'm not sure how their actual xml representation in a stream does look like.

Would the following lines be enough to get the skeleton data out of the stream properly?

Code: Select all

public XmlNodeList skeletonList;
// (...) and inside of the 'void OnPacketReceived(...)' method:
xmlDoc.LoadXml(Packet);
skeletonList = xmlDoc.GetElementsByTagName("Skeleton");
Inside this list there is also a child object called 'Bones', but I haven't figured out yet how to traverse through it properly, since I'm not quite familiar with XmlDocument Class:
https://msdn.microsoft.com/en-us/librar ... .110).aspx

Or is there another way to distinguish between DataDescriptors in C# in Unity (e.g. whether it's Descriptor_RigidBody or Descriptor_Skeleton)?

I would appreciate any help or hints on this issue from anyone!

Re: Motive to Unity

Posted: Thu Jun 18, 2015 11:49 am
by BradleyNewman
I haven't looked into skeletons and don't have plans to do so anytime soon unfortunately. Best of luck though!

Brad

Re: Motive to Unity

Posted: Sun Jun 21, 2015 9:52 am
by danwarom
Hey Bradley,

I just wanted to thank you for offering this up, it was a great framework to start building on top of. I was wondering if you had any problems (or Natural Motion for that matter) with this getting uploaded to Github so we can all contribute? It looks like there's a fair number of us developing on top of something similar and who doesn't love a bit of open source collaboration eh?!

Also, regarding skeleton streaming, the code actually exists in the demo scene provided by Natural Motion. Its a fairly simple tasks to add this to the UDP Streaming code provided by Bradley and look for both. Although I will warn you that in my test case, streaming the skeleton in any capacity took a huge performance hit on the scene in Unity, I went from 60fps to 12fps. While several rigid bodies can stream in realtime with practically no overhead. This was tried both with my integrated UDP streamer and the UDP streamer provided by NM (that streams only skeletons).

Thanks again and like I said, with Bradleys blessing, i'll get these onto Github for all to contribute too.

Cheers
Dan Warom

Re: Motive to Unity

Posted: Mon Jun 22, 2015 10:10 am
by DmitriG
Hey Dan,
Also, regarding skeleton streaming, the code actually exists in the demo scene provided by Natural Motion. Its a fairly simple tasks to add this to the UDP Streaming code provided by Bradley and look for both.
Somehow I haven't found this skeleton streaming code in Natural Motion samples or demo scenes. At least not for Unity3D (c# version of it). Could you please point out in what file is it located?
Or do you mean there are some lines related to skeleton streaming in the UnitySample.cpp file?

I'm now on the way to steam skeletons as rigid bodies (there is an option in Motive and I coded according to its xml stream represantation, such as Skeleton>Bones>Bone[], but haven't tested it yet), so that shouldn't actually affect overall performance more than the default rigid bodies' stream.

Cheers,
Dmitri

Re: Motive to Unity

Posted: Mon Jun 22, 2015 10:22 am
by BradleyNewman
Sure thing, go for it! Here is the latest version which included a fix for a linker error: https://drive.google.com/open?id=0B_5Y8 ... authuser=0

Something that would be cool is if somebody built a Unity plugin for Windows that connected directly with the NatNet stream instead of using UnitySample.exe to connect NatNet and Unity. I'm using this plugin for VR and want to minimize as much latency as possible, so a plugin would be the most direct connection to NatNet to shave off some milliseconds of latency. Although, this would mean somebody would have to maintain the plugin for new Unity versions.

Best,
Brad

Re: Motive to Unity

Posted: Sun Jul 12, 2015 11:05 am
by danwarom
Thanks for that Brad, for those interested, its now live at;

https://github.com/DanWuh/Motive2Unity

Saves you having to maintain a Google Drive entry for it! I'll also add my tweaks to it next week when I'm back in the office.

Cheers
Dan

Re: Motive to Unity

Posted: Thu Jul 16, 2015 6:06 pm
by DmitriG
Hey all

finally I've figured it out and extended Bradley's version with the support of multiple skeletons and correct names' representations of their attributes in xml. I also altered xml node names a bit.

Moreover, I added some new stuff to OptitrackRigidBodyManager.cs and to SlipStream.cs.
Also take a look at RigidBody_Local.cs file in attached Unity Project, where I use some getters from OptitrackRigidBodyManager.

It was a bit tricky to get the xml structure for two or more skeletons right, but I haven't experienced any performance drops described by Dan in my Unity scene. Within what size of skeleton's crowd have you tested it? :-)

MotiveToUnity v2.3:
https://drive.google.com/file/d/0B0OTJ5 ... sp=sharing

Make sure you use the correct local interface and Motive streaming settings look as follows in Data Streaming panel:
Stream Markers: False;
Stream Rigid Bodies: True;
Stream Skeletons: True;
Local Rigid Bodies: True;
Skeleton as Rigid Body: False

Cheers,
Dmitri