Vz:Doc:IpControl

From M1Research

(Difference between revisions)
Jump to: navigation, search
(TCP shell=)
 
(5 intermediate revisions not shown)
Line 1: Line 1:
IP Control protocol is simplest way for <b>VZ</b> control.
IP Control protocol is simplest way for <b>VZ</b> control.
-
By default <b>VZ</b> uses 8001 IP port for that service. To connect to this port and send commands you need a telnet client program. Find appropriate "telnet" program for operating. "putty" is nice free program.
+
By default <b>VZ</b> uses TCP/8001 port for shell style control protocol and UDP/8002 for non-interactive datagram proto.  
 +
 
 +
=UDP messages=
 +
 
 +
This protocol provides fast and sessionless control type. Due to binary nature of command data block you need to use <b>vzCmdSender.exe</b> program.
 +
 
 +
It can send futher list of commands for scene and vz control:
 +
 
 +
<pre>LOAD_SCENE <filename>
 +
START_DIRECTOR <director> <pos>
 +
RESET_DIRECTOR <director> <pos>
 +
CONTINUE_DIRECTOR <director>
 +
STOP_DIRECTOR <director>
 +
SET <container> <param> <value>
 +
CONTAINER_VISIBLE <container> <flag>
 +
</pre>
 +
 
 +
Make sure udpserver is allowed to start:
 +
<pre>[...]
 +
<module name="udpserver">
 +
<param name="enable" value="defined"/>
 +
<!-- <param name="port" value="8001"/>
 +
<param name="bufsize" value="8192"/> -->
 +
</module>
 +
[...]</pre>
 +
 
 +
Some examples:
 +
 
 +
load new scene
 +
<pre>vzCmdSender.exe localhost LOAD_SCENE "./projects/demo1.xml"</pre>
 +
Set text fields
 +
<pre>vzCmdSender.exe localhost SET text_2 s_text "Senior Deputy Officer" SET text_1 s_text "Vasilij Pupkin"</pre>
 +
start animation
 +
<pre>vzCmdSender.exe localhost START_DIRECTOR main 0</pre>
 +
continue (hide) animation
 +
<pre>vzCmdSender.exe localhost CONTINUE_DIRECTOR main</pre>
 +
 
 +
=TCP shell=
 +
 
 +
To connect to TCP/8001 and send commands you need a telnet client program. Find appropriate "telnet" program for operating. "putty" is nice free program.
==Connecting==
==Connecting==
Line 27: Line 66:
*<code>tree.function.<function_id>.<parameter_name>=<value></code>
*<code>tree.function.<function_id>.<parameter_name>=<value></code>
perform parameter setting for function, for example:
perform parameter setting for function, for example:
-
<pre>vz in$> scene.tree.function.text_1.s_text=Maksym Veremeyenko
+
<pre>vz in$> scene.tree.function.text_1.s_text=Prived Medved
 +
vz out$> OK
 +
vz in$> scene.tree.function.text_2.s_text=Hi Man!
vz out$> OK</pre>
vz out$> OK</pre>
Line 37: Line 78:
*<code>tree.motion.director.<director_id>.continue()</code>
*<code>tree.motion.director.<director_id>.continue()</code>
*<code>tree.motion.director.<director_id>.reset([<position>])</code>
*<code>tree.motion.director.<director_id>.reset([<position>])</code>
-
Directors (animation) control, for example:
+
Directors (animation) control
-
<pre>vz in$> scene.tree.motion.director.main.start()
+
For example:
-
vz out$> OK</pre> Start animation on director <code>main</code>.
+
-
<pre>vz in$> scene.tree.motion.director.main.cont()
+
Start animation on director <code>main</code>.<pre>vz in$> scene.tree.motion.director.main.start()
-
vz out$> OK</pre> Continue animation on director <code>main</code> after pausing.
+
vz out$> OK</pre>
 +
 
 +
Continue animation on director <code>main</code> after pausing.<pre>vz in$> scene.tree.motion.director.main.cont()
 +
vz out$> OK</pre>
*<code>tree.motion.timeline.<timeline_id>.<t1|t2|y1|y2>=<value></code>
*<code>tree.motion.timeline.<timeline_id>.<t1|t2|y1|y2>=<value></code>
timeline modification.
timeline modification.

Latest revision as of 07:34, 26 January 2009

IP Control protocol is simplest way for VZ control.

By default VZ uses TCP/8001 port for shell style control protocol and UDP/8002 for non-interactive datagram proto.

Contents

UDP messages

This protocol provides fast and sessionless control type. Due to binary nature of command data block you need to use vzCmdSender.exe program.

It can send futher list of commands for scene and vz control:

LOAD_SCENE <filename>
START_DIRECTOR <director> <pos>
RESET_DIRECTOR <director> <pos>
CONTINUE_DIRECTOR <director>
STOP_DIRECTOR <director>
SET <container> <param> <value>
CONTAINER_VISIBLE <container> <flag>

Make sure udpserver is allowed to start:

[...]
	<module name="udpserver">
		<param name="enable" value="defined"/>
<!--		<param name="port" value="8001"/>
		<param name="bufsize" value="8192"/> -->
	</module>
[...]

Some examples:

load new scene

vzCmdSender.exe localhost LOAD_SCENE "./projects/demo1.xml"

Set text fields

vzCmdSender.exe localhost SET text_2 s_text "Senior Deputy Officer" SET text_1 s_text "Vasilij Pupkin"

start animation

vzCmdSender.exe localhost START_DIRECTOR main 0

continue (hide) animation

vzCmdSender.exe localhost CONTINUE_DIRECTOR main

TCP shell

To connect to TCP/8001 and send commands you need a telnet client program. Find appropriate "telnet" program for operating. "putty" is nice free program.

Connecting

[verem@elbrus reports]$ telnet vz-dev 8001
Trying 10.1.5.23...
Connected to vz-dev.internal.m1stereo.tv (10.1.5.23).
Escape character is '^]'.
ViZualizator (vz-1.0-release) [tcpserver]

vz in$>

As use can see vz service is online and is ready to accept commands.

Commands

NOTE! Tune your telnet program for UTF-8 characters.

Each command sent to VZ has javascript-like structure. I try to descibe most usefull commands format with examples.

  • renderman.load(<scene_name>)

Perform scene loading into rendering engine, for example:

vz in$> renderman.load(./projects/demo1.xml)
vz out$> OK!Load
  • tree.function.<function_id>.<parameter_name>=<value>

perform parameter setting for function, for example:

vz in$> scene.tree.function.text_1.s_text=Prived Medved
vz out$> OK
vz in$> scene.tree.function.text_2.s_text=Hi Man!
vz out$> OK
  • tree.container.<container_id>.visible=<value>

Container visibility control

  • tree.motion.director.<director_id>.start([<position>])
  • tree.motion.director.<director_id>.stop()
  • tree.motion.director.<director_id>.continue()
  • tree.motion.director.<director_id>.reset([<position>])

Directors (animation) control

For example:

Start animation on director main.
vz in$> scene.tree.motion.director.main.start()
vz out$> OK
Continue animation on director main after pausing.
vz in$> scene.tree.motion.director.main.cont()
vz out$> OK
  • tree.motion.timeline.<timeline_id>.<t1|t2|y1|y2>=<value>

timeline modification.

Personal tools