[Plugin] OSC for UE4

Hi monsieurgustav,

Good to hear from you again. FYI I’m still using the plugin quite a lot - the reason I haven’t been back to post questions etc is that the plugin now seems perfect!

Glad you liked the tutorial - I was worried that my use of it would differ from your own and you’d disown it!

I thought i’d show the OSC bundle way as SendOSC caught me out in the past. My project needed to refresh about 100 items on my ipad interface in a screen refresh call (Not just text, but position, and visibility too, so it was more like 400 OSC messages) and i found that some of the data got lost somewhere during this update, so I had to throttle down the update. I originally had a load of SendOSC calls all over my blueprint and had to replace them all with a custom event which added the items to a stack and trickled the messages out over a number of ticks. Using the bundle was - I thought - good practice, and i’m eternally grateful to you for implementing it!

I agree with you on the add event for Osc Receiver - it’s just me stuck in my ways I think.

Thanks again for the plugin, and also the kind feedback on my tutorial. I’ve been thinking of doing some more tutorials for absolute coding beginners (blueprints, not c++) and have made some progress in a first pass at a kind of script for it (my background is in TV as an editor - although you wouldn’t know that from the lack of any editing in that tutorial) - with a whopping 600+ views it’s encouraged me to get on with it.

Hello everyone

Thank you very much for a great plugin !

I suceeded in installing and using it with maxmsp (a slider or a sound moves an object) but I have a speed (latency ?) problem. Unreal reacts very slowly, object "jumping " from one value to another.

If I send the message from touchosc instead of maxmsp, it works fine and smoothly. It seems also fine if i send from max to touchosc…

I am a total beginner in those things. Any idea what parameter or setup I could check ?

Best

Jerome

My guess:
UE4 gooes veeery slooooooooowly when running out of focus. (at least on Windows)
Maybe there is a setting to fix this…
Or run MaxMSP and UE4 on 2 separate machines. (the reason why it works using TouchOSC)

Yes, you can set up this on the editor preferences window
Edit=>Editor preferences => Miscellaneous => Performance => use less CPU when in Background => set it to unchecked

then the editor is always running at full

I sometimes have a host resolve problem with TouchOSC which sounds like a similar problem - try using the IP address rather than a host lookup.

That was it ! It works like a charm now.
thank you very much !

Jerome

Hello everyone

A UE4 4.13 project wich use the OSC plugin is now crashing when I launch it. It was working fine a few days ago - I don’t remember making any change except that I clicked OK to an update of the Epic Launcher today.

I got this error message :

Other projects works fine so I suspect it’s the plugin. The project was created following Dannington’s tutorial.

Any help would be greatly appreciated !

Best

Jerome

I had this updating to 4.13.1 - just re-generate the project files and recompile.

Thanks ! I guess I could have guessed it by myself if I wasn’t so nervous about this Visual Studio thing… I’ll get used to it !

Hello guys. Someone could tell me how can I route messages that are more complex than address, ip and value? I’d like to import messages that contain multiple values after the addres and route them.

Is there a better way than the mine?

Thank you.

I haven’t tried it but you should be able to use a for-each loop on the pop-float node.

Hi guys, thanks for this plugin! really helpfull!
However I have an issue when I want to package this for a windows 32bits system : osc doesn’t work anymore! “BP listening” appear but when I use TouchOSC nothing respond.
Any idea to fix it?

Hi @JuL17,

You might find that it’s that the ports are hard-wired (to 8000 I think) in the ‘packaged’ versions of the plugin and you’ll have to change them in the source code (It’s easy), or change your ports in TouchOSC.

Best!

Hi @Dannington,
You’re right the ports was set to 8000 !

I havez something else to ask you : about linking osc data to camera, how can I do it?
My skills aren’t good enough yet :wink:

Here is my research:d306c20463a0fc4e730f83e3eb4d45d89c3c2064.jpeg

Hi @JuL17.

I’ll try to write a better response shortly - i’m quite busy today.

You’re right that you want to drive your camera’s world position in this way but you’re sending your camera on a diagonal path through your scene I expect.

You need to make discrete x, y and z variables for your camera’s position and only update the one you’re adjusting.

You have tx, ty and tz switches - so you need each one of them to call a ‘set’ on only the x, y and z variables appropriately, then i’d say you could join up those execution chains (tx, ty and tz) into a set world location based on the values of those variables.

I’d use a ‘Map-To-Range-Unclamped’ node rather than your multiplier - the float output will likely produce a scalar value between 0 and 1 - if you plug that into the ‘value’ node, then set In Range A to 0 and Range B to 1 (the min and max for the float) - then you can set OutA and OutB to the coordinate range of your choosing - like (-1000 to 1000) - that way if you get a 0 from the float your camera will move to -1000 or if it gets 0.5 (half) it’ll go to 0. Do this for each axis - you might want the mimimum range for Z to be 0, otherwise it might go through the ground.

Also you could use a spring arm with your camera attached to produce a smooth motion when you adjust these values. In this case you move the world position of your spring arm rather than your camera.

I’ll try to post a BP grab at some point.

I tests on 4.14 and it works just fine, except one thing:

In the .uplugin file, the plugin is marked as disabled by default.
Before 4.14, it was loaded anyway…
Now, it’s not anymore: if you experience strange behavior, check that the plugin is loaded in the “Plugins” window.

I also pushed an update that make the plugin enabled by default from now on.

@Narcyssus

Your way is perfectly fine.

An alternative would be to use the traditional Array functions (“Data” is an array of “OscDataElem”), like that :
OSC_Array.png

Hi @monsieurgustav

Hope you are well. Is there any reason that a long string sent into the engine would cause a crash? I’m trying to get a node.js OSC module to send in a long base64 string and it crashes the editor:

Assertion failed: TCString<TCharType>::Strlen(InName)<=NAME_SIZE [File:D:\Build++UE4+Release-4.14+Compile\Sync\Engine\Source\Runtime\Core\Private\UObject\UnrealNames.cpp] [Line: 582]

Here’s my string!

V2hhdCUyMGlzJTIweW91ciUyMGZhdm91cml0ZSUyMHR5cGUlMjBvZiUyMGJpc2N1aXQ/XypfdW5kZWZpbmVkXypfbnVsbF8qX251bGxfKl9udWxsXypfdW5kZWZpbmVkXypfdW5kZWZpbmVkXypfdW5kZWZpbmVkXypfdW5kZWZpbmVkXypfNF9TUExJVF9fL19FbGVtZW50MF8qXyJodHRwOi8vNjUubWVkaWEudHVtYmxyLmNvbS81ZmIyNTQ4OTNkNTE1ZTQwYTY1ZWFjNmRhNjZkNzZjZi90dW1ibHJfaW5saW5lX216ZG96ZHhIVm4xc254emN3LmpwZyJfKl8lQzIlQTAlQzIlQTBDdXN0YXJkJTIwQ3JlYW0lQzIlQTAlQzIlQTBfKl9fKl9fL19FbGVtZW50MV8qXyJodHRwczovL21vcm5pbmdiaXNjdWl0bG92ZS5maWxlcy53b3JkcHJlc3MuY29tLzIwMTIvMDgvMjAxMjA4MTEtMTMyNzQyLmpwZyJfKl8lQzIlQTAlQzIlQTBDaG9jb2xhdGUlMjBEaWdlc3RpdmUlQzIlQTAlQzIlQTBfKl9fKl9fL19FbGVtZW50Ml8qXyJodHRwOi8vd3d3LmhpbGxiaXNjdWl0cy5jb20vMjEtMjMtYmlzY3VpdC1pbWFnZS9oaWxsLWdpbmdlci1udXRzLTE1MGcuanBnIl8qXyVDMiVBMCVDMiVBMEdpbmdlciUyME51dCVDMiVBMCVDMiVBMF8qX2NlbnRlciBjZW50ZXJfKl9fL19FbGVtZW50M18qXyJodHRwOi8vd3d3LmNvbmZlY3Rpb25lcnluZXdzLmNvbS92YXIvcGxhaW5fc2l0ZS9zdG9yYWdlL2ltYWdlcy9wdWJsaWNhdGlvbnMvZm9vZC1iZXZlcmFnZS1udXRyaXRpb24vY29uZmVjdGlvbmVyeW5ld3MuY29tL21hbnVmYWN0dXJlcnMvYnVydG9uLXMtYmlzY3VpdHMtbmVlZHMtc2hvcHBpbmctc3ByZWUtdG8tc3RheS1jb21wZXRpdGl2ZS1zYXlzLWFuYWx5c3QvODU4MzIxNS0xLWVuZy1HQi9CdXJ0b24tcy1CaXNjdWl0cy1uZWVkcy1zaG9wcGluZy1zcHJlZS10by1zdGF5LWNvbXBldGl0aXZlLXNheXMtYW5hbHlzdC5qcGciXypfJUMyJUEwJUMyJUEwSmFtbWllJTIwRG9kZ2VyJUMyJUEwJUMyJUEwXypfXypfX1NQTElUX1JlczJfZF9CYXNlIFZvdGVfZF80MF9kXzMwX2RfMjBfZF8xMF9sX1JlczNfZF9NZW5fZF8xMF9kXzIwX2RfMzBfZF80MF9sX1JlczRfZF9Xb21lbl9kXzI1X2RfMzVfZF8yOV9kXzExX2xf

It’s just a few configs and some urls.

Cheers!

I think it must be an RX buffer set to 1024 somewhere - I tried changing the global buffer but it didn’t fix it.

OK, it totally makes sense but I haven’t seen it coming.

The OSC plugin stores OSC strings as FName objects. (as you can see, PopString actually returns a Name value)

It would make sense to use FString here, but it would cause a lot of buffer copy (every Pop* function call, etc.) if used naively.
A less naive approach would be to store those strings in a shared container and store a pointer to it.
Which is basically what FName does.

Unfortunately, FName content is limited to 1024 characters.
Hum.

I see 2 issues here:

  • It will take some work to remove this limitation. Not a lot, but some.
  • It will break old OSC related blueprints, as PopString will actually return a FString now. (instead of FName)