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!

SetPropertiesInvokeMethods() won't change value in scene

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

Moderator: Support

Post Reply
bastidererste

SetPropertiesInvokeMethods() won't change value in scene

Post by bastidererste » 10 Apr 2013, 15:57

Im doing my first steps in remoting2
My scene contains a MeshText node and the Text Value is externalized as "Text". I can get the value in my code. So the connection is working... If I try to change the Value with SetPropertiesInvokeMethods() a strange behavior occurs: SetPropertiesInvokeMethods() changes the value only on the scene object in my code but it doesn't take effect in the actual scene. So if i get the value again, it is the new text, but the scene still shows the old value... what am i missing? See code below...

regards
b#

Code: Select all

using System;
using Ventuz.Remoting2;
using Ventuz.Remoting2.Helpers;

class Program
{
    static void Main(string[] args)
    {

        RemoteScene ventuz = RemoteScene.Connect("localhost");
        RemoteScene scene = ventuz.LoadScene("/scene1");
        
        object Text_ = scene.GetProperties(new string[] { "/Text" })[0];
        Console.WriteLine(Text_);
        //prints the value 'ABCDEFG" from the node "/Text" correctly
       
  
        scene.SetPropertiesInvokeMethods(new string[] { "/Text" }, new object[] { "Hello World" }, null, null, RemoteScene.IMMEDIATE, null);
        Text_ = scene.GetProperties(new string[] { "/Text" })[0];
        Console.WriteLine(Text_);
        //prints the new text in the MeshText node, so changes have been applied..
        //but unfornatly the scene still shows the old value!!??
        //what do I miss
    
    }
}

bastidererste

Re: SetPropertiesInvokeMethods() won't change value in scene

Post by bastidererste » 11 Apr 2013, 12:58

solved it!!

i forgott to set and activate the scene on the default port...

Code: Select all

class Program
{
      static void Main(string[] args)
      {

      RemoteScene ventuz = RemoteScene.Connect("localhost");
      RemoteScene scene = ventuz.LoadScene("/scene1");

      ventuz.Ports[0].SetScene(scene, RemoteScene.IMMEDIATE, null);  //<<<----------
      ventuz.Ports[0].SetActive(true, RemoteScene.IMMEDIATE, null);  //<<<----------

      object Text_ =scene.GetProperties(new string[] {"/Text"})[0];
      Console.WriteLine(Text_);

      scene.SetPropertiesInvokeMethods(new string[] { "/Text" }, new object[] { "UZ fI faz fiUAZ f" }, null, null, RemoteScene.IMMEDIATE,       null);
      Text_ = scene.GetProperties(new string[] { "/Text" })[0];
      Console.WriteLine(Text_);

      }
}

Post Reply