Hello, I’m having trouble getting Unreal and Touch Designer communicating with the Touch Engine API and am looking for some assistance. I’m willing to pay for a support session if someone can help me out as soon as possible. Derivative support recommended posting here since the Touch Engine API for unreal is outside of their purview.
I want to send the position of a camera in Unreal to an instance of Touch Designer on the same computer using a 4x4 transformation matrix with SharedMem. - Get float array from Unreal into Touch
I think I have it setup pretty closely to what I need in Unreal and Touch. As soon as I load the Tox file in Unreal the disconnection symbol goes away in Touch, but when changing the position of the camera in Unreal nothing is received in Touch. It only shows the values of the inputs on the tox loaded into Unreal. Unreal sees the proper inputs specified in the Tox file and I can see the data from the transform matrix changing on the print string, but it doesn’t appear to be writing that data to the Tox inputs via the Set TouchEngine Inputs.
I have tested sending the whole array and individual floats into the Set TouchEngine Input.
Hey, thanks for posting this. TouchEngine/Unreal engine integration is definitely in our purview. We just like to do support here if possible, as that’ll help other people that may run into similar issues.
We’ll take a look at this and see if we can determine what the issue is.
Just to clarify:
This SharedMem Out CHOP is from the .tox being loaded in Unreal with the TouchEngine, pushing to a TouchDesigner process (with a SharedMem In) ?
As soon as I load the Tox file in Unreal the disconnection symbol goes away in Touch
I’m not quite sure what you mean by this? You mean in the TouchDesigner process with the SharedMem In ?
For what I see from those screenshots, you are not preceding your input with
o/ to read from output,
p/ to read or write from/to a parameter)
I have a feeling that your last blueprint where you just pass the whole array and use only one Set TouchEngine Input would be more efficient.
Note that there is a whole Sample project here with a bunch of samples: GitHub - TouchDesigner/TouchEngine-UE-Samples: A sample project relying on the TouchEngine-UE plugin.
With a doc (maybe slightly outdated / UE4 based but should be accurate enough) for every single sample, explaining what’s the .tox being loaded like and what it does, and how is the data used in Unreal: TouchEngine-UE-Samples/Content at UE5.0-Release · TouchDesigner/TouchEngine-UE-Samples · GitHub
I hope this helps,
Hey, thanks for the quick response.
1 - yes
2 - Once the Unreal project is loaded up that includes the Tox which has the SharedMem Out CHOP with the matching name it shows connected in TD, or the yellow ! symbol goes away on the SharedMem in CHOP.
I didn’t see any example in the samples that shows how to communicate with a live instance of the Touch Designer application, just communicating to and from the Tox file loaded into Unreal.
I put i/ on all my Set TE Inputs and tested with the individuals and the whole array and put input_chop before my input string just incase, but still no luck.
Do I need to have the Start TouchEngine node in unreal connected like I do in the screenshot?
Would you be willing to do a quick screen share over Discord or another software?
Please send me a DM if so.
To confirm and for the sake of clarity:
Do you run the project by clicking the “Play” button?
Can you also please confirm all versions you have been using:
- What is the TouchDesigner build version installed ?
- If multiple builds of TouchDesigner are installed on the machine, what build is linked to the Unreal project using a shortcut ?
- What version of the plugin are you using ?
- Is the plugin used from the release package ?
- If not, was the plugin compiled from source and what branch of the Github repository was used ?
- What version of Unreal Engine 5 is used ?
- What RHI is your project set to in Unreal ?
Yes, they are no specific samples for that case. If you can run a .tox in an Engine COMP from a TouchDesigner process A to a receiving TouchDesigner process B, then it should behave the same.
Do I need to have the Start TouchEngine node in unreal connected like I do in the screenshot?
Your setup from the second screenshot makes sense to me: when Unreal is running and “playing”, you kick the TouchEngine and tell it to load the TouchEngine Component associated with the variable and component object you are passing.
On the TouchEngine component, in world editor → Detials panel, you can see Load on begin play toggle:
This should be enough to get the .tox loaded in an engine. You can confirm that by looking at the number of Sub-processes in your task manager, under the main Unreal Editor process. You should see at least 1 or 2 TouchEngine sub-process running.
Can you please answer all the questions above to start with? I am wondering if the TouchEngine is running at all when your project is in play state.
You could also try to switch the cook mode to Independent. I vaguely remember an issue with this that got recently fixed in TouchEngine but I will need to confirm on Monday.
I do use the normal Play button(not simulate)
2022.29850 - only build installed
Touch Engine 0.9.5
Plugin obtained from here - GitHub - TouchDesigner/TouchEngine-UE: The TouchEngine-UE plugin allows UE developers to load TouchDesigner components within UE while relying on the TouchEngine API.
Compiled with C++ project and copied to Blueprint project after
Load on begin play is checked
3 Touch Engine processes show up in Task Manager
Independent cook mode is the same
I just did a fresh install to test and be on par with you / your version and I’m not encountering issues passing parameter changes from Unreal to a / many TouchEngines.
Did you try the Samples project?
Does anything happen when you interact with a sample of the samples project, such as with sample 04?
Apologies for the back and forth, I got to setup a sample with Shared Memory and it might be that there is an issue with it at the moment when used with TouchEngine.
I am checking with a developer internally and will get back to you.
We have identified an issue where an instance of the TouchEngine is kept around when it shouldn’t. This instance is used to load the parameters you see in the editor when you first start everything.
This would mean that, in your case, a Shared Mem Out CHOP with the name you expect already exists in the system / is loaded.
When you go into “play” mode, the second instance gets loaded. But, unknowingly, the name this new Shared Mem Out CHOP is trying to use would already be taken.
We are looking into a potential fix in the TouchEngine plugin.
In the meantime, what you can do is ensure that you don’t start your Unreal project with the details panel open on the TouchEngine Component that hosts your .tox with the Shared Mem. Then when going into play mode, it should be fine.
I know this is not the best solution for now but this will need a fix on our end…
Let me know if that helps,
Unfortunately that didn’t work. Upon opening the Unreal project there is a single instance of the Touch Engine process active in Task Manager. With all panels and tabs closed in Unreal except the viewport once I hit play there are an additional two Touch Engine processes created and once I stop playback they are removed. I did also make sure the the component wasn’t open before closing the panels in case that would make a difference.
Have you considered doing this with OSC between Touch and Unreal? We’ve been using this method for quite a while for passing parameters such as this. That might be easier in this instance?
For this scenario the lowest possible latency is a necessity. This project deals with robotics and moving parts where safety is a concern and ultimately the effect we’re going for to work. I’m not sure if you can send whole arrays of data via single OSC addresses which might cause additional latency or potential for inaccuracy. I am interested to learn more about all the potential data types that can be used for cross application communication with Touch Engine and their latency if anyone has some data on that.
Hi @Veiss - if you are keen for a solution for this now, we have a fix in the
UE5.0-Dev branch of the UE plugin, so you could switch to that branch for now - DX11 support is pretty stable there.
Still can’t seem to get it to work. I’ve compiled the plugin on launch and confirmed there is no longer additional engine processes running.
Both the Touch Engine and live instance of Touch are connected as communicated by the disappearance of the disconnection symbol on the SharedMemIn and it showing the same constant set on the SharedMemOut.
It seems the value connected to the Set TouchEngine Input is not being written to the input.
Is the Start TouchEngine node necessary? I have auto activate enabled in the component. Doesn’t seem to make a difference either way.
Does this input section look right? Changing these floats with component set to active in editor doesn’t make a difference either. I initially noticed it’s possible to have the tox set in the component details in the main viewport panel but not in the blueprint component details panel. I set it in both and matched the input array, but no help there either.
I tried without the constant as well. input value set to i/CameraMatrix on the set node and CameraMatrix on the In node in Touch.
The live instance of the Touch application only has a SharedMemIn matching the SharedMemOut name.
@Veiss The Shared mem type needs to be set to Global. On both the In and Out Shared Mem CHOPs.
If that doesn’t help, can you please change your Send Mode to be Every Frame and give it another try ?
Unfortunately that didn’t work.
Could you please forward your project to support with a dropbox or wetransfer link, or equivalent?
A simple sample of how you setup things (if it’s a big project that has a lot of moving parts), with your Unreal solution and the .tox file that you are loading.
I’d like to have a closer look.
You can remove all the temporary build folders from the zip: Intermediate, Saved, DerivedDataCache, .vs, .git if any, Plugins/TouchEngine-UE/Intermediate