Forum

Sending data from VVVV to Unity3D via OSC

Hi there ! :)

I’m working on a project in which i want 3d objects (mainly made in cinema4D) to react to sounds and video capture in realtime. So to do it, i’ve searched a bit and found that Unity3D could do the job as it’s a realtime 3D renderer, handle c4d files and seems to work with OSC which is great !

I’ve already made the analysis part in vvvv and it works good, but I didn’t manage to send correctly the data from VVVV to Unity, as i’m not really used to the osc part i don’t know where the problem come from (vvvv “send part” or unity “receive part” or maybe both °-°)

I’ve only found 2 example project of vvvv communicating with unity on the net ( youtube videos, without description ) so i’m a bit lost.

as anybody here already managed to do that ?

i join my vvvv osc send part, (simple with just a slider to make it clear if I made something wrong with it)

does anybody know a project or tutorial where vvvv and unity are communicating via OSC that I can study ?

thanks for help ^^

vvvvSend.v4p (7.1 kB)

I did it thanks to this tuto, with unity plugin to download
http://www.sundh.com/blog/2012/05/unity-processing-arduino/

Hi!

thanks a lot ! :D

I’ve checked the page quickly, seems to be really clear about the unity part and come with a source, that’s awesome for me :)

i’ll try it out as soon as i got time and come back to give a feedback

Hi!

so i’ve tried to make it work but the fact i’m really too unexperienced with unity3d and got problem with loading scripts and linking them to objects parameters so i’ll do some starters tutorials on unity3d and then try again with osc ( and then come back here to give some news :) )

Hi ! :)

So I managed to pratice unity, doing some beginner tutorials this week end, still doing curently, everything goes well with my practicing, but i’m still lost with the OSC stuff.

I’m trying to receive data sent from VVVV in Unity3D via OSC, using the method gundorf linked here.

but still, unity seems reluctant to my intentions xD

I got continuously this error :
“CompareBaseObjectsInternal can only be called from the main thread” and didn’t find a clue about it and my project when googling it (mainly because i didn’t understand clearly what this error refer to.

Anyway if anybody can have a look to my scripts, that would be great, they are really small and simple, i’m just trying for the moment to link the data from VVVV, which is float constantly varying, to a Sphere width in Unity.

I imported UDPPacketIO.cs, Osc.cs and OSCReceiver.js onto a blank object in unity, and playerController.cs on my sphere.

I link my vvvv sender patch, which is really simple for the moment, just randomly generated values.

and also my unity project.
In the unity project, i try to link the osc data to the width of the sphere (mainly to just monitor it simply).

if anybody can help me, that would be really nice :D

vvvvSend.v4p (7.5 kB)
osctest.7z (50.1 kB)

it sounds like this would be a question better asked in the unity forum where chances should be greater to find people having similar issues.

in the vvvv forum one could only wonder why you’re trying to go this route at all. you say “I’m working on a project in which i want 3d objects (mainly made in cinema4D) to react to sounds and video capture in realtime” that sounds like a perfect job for vvvv itself. and you could skip network communication alltogether. or are you missing something specific?

Hi there !

Yes joreg you’re right about he unity part, it has nothing to do there :)
anyway, Finally i came with a solution yesterday night, the problem, located in the unity part came from the fact that i was trying to make a script in js communicate with a script in C# (i read that it can be done, but with my current noob level in coding, that’s not a great idea to begin with :) ), everything is in C# now, so I got my data from VVVV arriving to unity rightly !

I’m also convinced that vvvv can do that job by itself also, but I need to learn Unity for another incoming project, that’s why i’m doing this one with unity right now. (in fact i’m forcing myself also because I’m not really used to code writing, I really prefer the way that vvvv, puredata, and other of their kind work, with nodes, pin, subpatches and “cable”, but code writing logic can be useful for me in the next months)

thanks for your interest ^^

is it ok now ?
osc from vvvv to unity is pretty easy actually.
I succeed to modify particle emitter parameters via osc…
Everything in unity can run into a script; very very powerful

Hi,
Please Crasse, could you please explain more about what is going wrong in you osctest Unity project…? You said everything is in C# now… is it the OSCReceiver script that you write in CS ? Could you post the osctest Unity project corrected please. Like you said, writing code is a bit inhuman I my mind is much more adapted to VVVV style.
Hope you can help,

Aurelien