Page 1 of 1

SetPropertiesInvokeMethods() won't change value in scene

Posted: 10 Apr 2013, 15:57
by bastidererste
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
    
    }
}

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

Posted: 11 Apr 2013, 12:58
by bastidererste
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_);

      }
}