Hello Ventuzians!
THE FORUMS ARE CLOSED!

Please join our discord server HERE!! << click me :D

We are shutting our Ventuz Forum, but don't worry, it will all be archived for you to search in if you have a query. From now on, please add all your comments, questions or observations into our Discord Server

Thanks for the great time - see you on discord!!
Dee, Karol, Daniel and the whoooole Product and Support team!

Legacy Remoting in Ventuz 4

Q and A about functionality and how to solve a special task for your application.

Moderator: Support

Post Reply
hummerbaendiger
Posts: 21
Joined: 22 Mar 2012, 15:54

Legacy Remoting in Ventuz 4

Post by hummerbaendiger » 21 Oct 2014, 09:17

Hi everyone,

I have a Ventuz application that shall be ported from Ventuz 3 to Ventuz 4. Besides the pure presentation I'm also using a control software that feeds the presentation with data or triggers state changes. This software still runs with the very first version of .Net Remoting and uses the method VentuzSceneHelper.ActiveScene.SetProperties() to directly set properties that are externalized.
The presentation uses an externalized scene port to dynamically load a nested scene with properties that need to be controlled by the control software. Now that the externalization of scenes has been replaced by the scene data, I can't directly access formerly exposed properties of the nested scene (e.g. "/NestedScene/PropertyName") since this hierarchy is now interpreted as a Container named "NestedScene" with data channel "PropertyName" within my main scene.
My main scene on the other hand doesn't have these properties in the scene data and so changing these values doesn't have an effect on the nested scene.

One possible solution would be exposing all the parameters to be controlled to the scene port itself and binding them to the main scene's scene data (by creating a container in the scene data named "NestedScene" with all the properties underneath). So all the Calls could be resolved porperly. Unfortunately the scene has quite an amount of properties and exposing all fo them to the exact names is a significant source for mistakes on my side. Especially since I won't be able to test each and every functionality.

Does anyone know a simple way to easily restore the previous functionality to access properties of nested scenes directly? Changing both presentation and control software is not a problem as long as it won't involve too much reprogramming...
Some way to just get the scene data of the nested scene into the hosting scene?

Thanks for all your help!

hummerbaendiger
Posts: 21
Joined: 22 Mar 2012, 15:54

Re: Legacy Remoting in Ventuz 4

Post by hummerbaendiger » 29 Oct 2014, 15:03

I found a solution to the problem. If anyone else is faced with the same thing I would like to share my results:

Bad news first: You will either have to make modifications in your scene or the remoting program. Since the way remoting addresses are treated changed with Ventuz 4 the "externalized scene ports" are not supported anymore.

If your remoting software should stay the same, you will have to expose all formerly externalized properties to the scene port and link it into the scene data. If you group all of them into a folder that is named as your scene remoting calls should now just be redirected to your nested scene. Though this approach brings the risk of typos while exposing the formerly externalized properties.
Also this approach will be complicated if you intend to load different scenes in the same scene port.

The other way around is changing the way you access properties in the nested scene. Instead of accessing "/NestedScene/Property" you can easily get a reference of the nested scene and access "/Property" directly. As an alternative to VentuzSceneHelper.ActiveScene, your root scene can be easily accessed by accessing the Port[0] in your layout scene. Your layout scene is automatically referenced as soon as you connect to the Ventuz instance:

RemoteScene LayoutScene = RemoteScene.Connect(ip_address, port);
RemoteScene RootScene = LayoutScene.Ports[0].Scene;

If you defined a custom layout scene, you will have to select the right port it is loaded in.
In the scene reference you just got you can query

RemoteScene[] LoadedScenes = RootScene.GetLoadedScenes();
RemoteScene NestedScene = LoadedScenes[0];

In this collection you can find your nested scene - if it's the only one it will be index 0. Now the only thing you have to adapt is as soon as you send calls to "/NestedScene/..." to your former root scene, you now just redirect them to your nested scene reference and cut off the /NestedScene address.

Hope this will help someone else :-)

Post Reply