MasterInterface Class
Inherits: | SynckerInterface |
This class represents the master interface of the Syncker.
Syncker plugin must be loaded.
MasterInterface Class
Members
void setUdpSendSize ( int size ) #
Sets the maximum size of a UDP packet to be sent.Arguments
- int size - UDP packet size, in bytes. The default value is 1432.
int getUdpSendSize ( ) #
Sets the maximum size of a UDP packet to be sent.Return value
UDP packet size, in bytes. The default value is 1432.int getNumSlaves ( ) #
Returns the total number of the slaves connected to the master.Return value
Total number of slaves connected to the master.string getSlaveName ( int num ) #
Returns the name of the given slave computer. The default name is unknown (if not set).Arguments
- int num - Slave number.
Return value
Slave name.string getSlaveAddress ( int num ) #
Returns the network address of the given slave computer.Arguments
- int num - Slave number.
Return value
Network address of the slave computer.string getSlavePort ( int num ) #
Returns the TCP port of the given slave computer.Arguments
- int num - Slave number.
Return value
TCP port of the slave computer.String getSlaveWorldName ( int num ) #
Returns the name of the world file currently loaded on the specified slave.Arguments
- int num - Slave number.
Return value
Name of the world file currently loaded on the specified slave.string getSlaveView ( int num, int display_num ) #
Returns the name of the display or projector stored in the configuration file and assigned to the given display of the given slave computer.Arguments
- int num - Slave number.
- int display_num - Display number.
Return value
Name of the display or projector.void setSyncPlayer ( int enabled ) #
Enables synchronization of the current player's parameters via the UDP protocol:- Its transformation
- Projection matrix
- Viewport mask
- Mask for reflections
- Applied post-materials (if any)
Current player synchronization is used only when all slaves use the same camera.
Arguments
- int enabled - 1 to enable synchronization; 0 - to disable it.
void setSyncCAVE ( int enabled, vec3 position ) #
Enables synchronization of the viewer's head position via the UDP protocol.If viewer's head position is tracked, this method must me called every update().
Arguments
- int enabled - 1 to enable synchronization; 0 - to disable it.
- vec3 position - Viewer's head position coordinates.
void setSyncRender ( int enabled ) #
Enables synchronization of all render parameters via the UDP protocol: light scattering, occlusion, etc.When all slaves use the same rendering settings, synchronization of render parameters can be disabled.
Arguments
- int enabled - 1 to enable synchronization; 0 - to disable it.
int isSyncPlayer ( ) #
Returns a value indicating if synchronization of the current player is enabled.Current player synchronization is used only when all slaves use the same camera.
Return value
1 if synchronization of the current player is enabled; otherwise, 0.int isSyncCAVE ( ) #
Returns a value indicating if synchronization of the viewer's head position is enabled.Return value
1 if synchronization of the viewer's head position is enabled; otherwise, 0.int isSyncRender ( ) #
Returns a value indicating if synchronization of all render parameters is enabled.When all slaves use the same rendering settings, synchronization of render parameters can be disabled.
Return value
1 if synchronization of all render parameters is enabled; otherwise, 0.void addSyncNode ( Node node, unsigned char sync_mask = ~0 ) #
Enables synchronization of parameters of the given node via the UDP protocol.Scene nodes are not synchronized by default, this method is used to add a particular node to the synchronization queue.
Arguments
- Node node - Node to synchronize.
- unsigned char sync_mask - Synchronization mask.
void addSyncNodes ( Node[] nodes, unsigned char sync_mask = ~0 ) #
Enables synchronization of parameters of given nodes via the UDP protocol.Scene nodes are not synchronized by default, this method is used to add particular nodes to the synchronization queue.
Arguments
- Node[] nodes - Array of nodes to synchronize.
- unsigned char sync_mask - Synchronization mask.
int isSyncNode ( Node node ) #
Returns a value indicating if synchronization of the given node is enabled. Using this method you can quickly check if a node is monitored by the Syncker (node's states are dispatched to Slaves over the network).Arguments
- Node node - Node to be checked.
Return value
1 if synchronization of the given node is enabled; otherwise, 0.int getNumSyncNodes ( ) #
Returns the total number of nodes in the synchronization queue.Return value
Total number of nodes in the synchronization queue.Node getSyncNode ( int num ) #
Returns the synchronized node with the given number.Arguments
- int num - Node number in the synchronization queue.
Return value
Synchronized node.int removeSyncNode ( Node num ) #
Removes the specified node from the synchronization queue.Arguments
- Node num - Node to be removed.
Return value
1 if the node was successfully removed from the synchronization queue; otherwise, 0.void clearSyncNodes ( ) #
Removes all nodes from the synchronization queue.void addSyncMaterial ( Material material ) #
Enables synchronization of the given material via the UDP protocol.Scene materials are not synchronized by default, this method is used to add a particular material to the synchronization queue.
Arguments
- Material material - Material to synchronize.
void addSyncMaterials ( Material[] nodes ) #
Enables synchronization of given materials via the UDP protocol.Scene materials are not synchronized by default, this method is used to add particular materials to the synchronization queue.
Arguments
- Material[] nodes - Array of materials to synchronize.
int isSyncMaterial ( Material mat ) #
Returns a value indicating if synchronization of the given material is enabled. Using this method you can quickly check if a material is monitored by the Syncker (material's states are dispatched to Slaves over the network).Arguments
- Material mat - Material to be checked.
Return value
1 if synchronization of the given material is enabled; otherwise, 0.int getNumSyncMaterials ( ) #
Returns the total number of materials in the synchronization queue.Return value
Total number of materials in the synchronization queue.Material getSyncMaterial ( int num ) #
Returns the synchronized material with the given number.Arguments
- int num - Material number in the synchronization queue.
Return value
Synchronized material.void removeSyncMaterial ( int num ) #
Removes the material with the given number from the synchronization queue.Arguments
- int num - Material number in the synchronization queue.
void clearSyncMaterials ( ) #
Removes all materials from the synchronization queue.int createNode ( Node node, int include_children = 1, int add_to_sync = 1, unsigned char sync_mask = ~0 ) #
Synchronizes creation of the given node on all slaves via the TCP protocol.This method is to be called after node creation on the master.
Arguments
- Node node - Node to create.
- int include_children - 1 to create the given node with all its children; 0 - to create the given node only. The default value is 1.Create all child nodes.
- int add_to_sync - 1 to add the created node(s) to the synchronization queue; 0 - not to add. The default value is 1.
Use 0 if a static node is to be created.
- unsigned char sync_mask - Synchronization mask.
Return value
1 if the node is successfully created on all slaves; otherwise, 0.int isNodeCreated ( Node node ) #
Returns a value indicating if the given node was created via the createNode() method. Using this method you can quickly check if a node is in the run-time objects creation buffer.Arguments
- Node node - Node to be checked.
Return value
1 if if the given node was created via the createNode() method; otherwise, 0.void deleteNode ( Node node, int include_children = 1 ) #
Synchronizes deletion of the given node on all slaves via the TCP protocol.Arguments
- Node node - Node to delete.
- int include_children - 1 to delete the given node with all its children; 0 - to delete the given node only. The default value is 1.
void editorSet ( int mask, string name, int value ) #
Sets an editor script variable value for slaves defined in a mask.Arguments
- int mask - Bit mask, that defines slaves, for which variables should be set. Use ~0 for all slaves.
Each bit of the mask corresponds to a slave. To specify certain slave use: 1 << slave_number
- string name - Name of the variable in the editor script.
- int value - Value to be set.
void editorCall ( int mask, string name, Variable[] args ) #
Calls an editor script function on slaves defined in a mask.Arguments
- int mask - Bit mask, that defines slaves, on which a function should be called. Use ~0 for all slaves.
Each bit of the mask corresponds to a slave. To specify certain slave use: 1 << slave_number
- string name - Name of the function in the editor script.
- Variable[] args - Array of arguments to be passed (passing up to 6 arguments is supported).
void editorStream ( int mask, string name, Blob buffer ) #
Calls a function that receives a buffer as an argument on the slaves specified by the mask. The buffer contains the states of the slave displays.Arguments
- int mask - Bit mask, that defines slaves, on which a function should be called. Use ~0 for all slaves.
Each bit of the mask corresponds to a slave. To specify certain slave use: 1 << slave_number
- string name - Name of the function.
- Blob buffer - Buffer with states of the displays that need to be passed to the function.
void systemSet ( int mask, string name, int value ) #
Sets a system script variable value for slaves defined in a mask.Arguments
- int mask - Bit mask, that defines slaves, for which a variable should be set. Use ~0 for all slaves.
Each bit of the mask corresponds to a slave. To specify certain slave use: 1 << slave_number
- string name - Name of the variable in the system script.
- int value - Value to be set.
void systemCall ( int mask, string name, Variable[] args ) #
Calls a system script function on slaves defined in a mask.Arguments
- int mask - Bit mask, that defines slaves, on which a function should be called. Use ~0 for all slaves.
Each bit of the mask corresponds to a slave. To specify certain slave use: 1 << slave_number
- string name - Name of the function in the system script.
- Variable[] args - Array of arguments to be passed (passing up to 6 arguments is supported).
void systemStream ( int mask, string name, Blob buffer ) #
Calls a function that receives a buffer as an argument on the slaves specified by the mask. The buffer contains the states of the slave displays.Arguments
- int mask - Bit mask, that defines slaves, on which a function should be called. Use ~0 for all slaves.
Each bit of the mask corresponds to a slave. To specify certain slave use: 1 << slave_number
- string name - Name of the function.
- Blob buffer - Buffer with states of the displays that need to be passed to the function.
void worldSet ( int mask, string name, int value ) #
Sets a world script variable value for slaves defined in a mask.Arguments
- int mask - Bit mask, that defines slaves, for which a variable should be set. Use ~0 for all slaves.
Each bit of the mask corresponds to a slave. To specify certain slave use: 1 << slave_number
- string name - Name of the variable in the world script.
- int value - Value to be set.
void worldCall ( int mask, string name, Variable[] args ) #
Calls a world script function on slaves defined in a mask.Arguments
- int mask - Bit mask, that defines slaves, on which a function should be called. Use ~0 for all slaves.
Each bit of the mask corresponds to a slave. To specify certain slave use: 1 << slave_number
- string name - Name of the function in the world script.
- Variable[] args - Array of arguments to be passed (passing up to 6 arguments is supported).
void worldStream ( int mask, string name, Blob buffer ) #
Calls a function that receives a buffer as an argument on the slaves specified by the mask. The buffer contains the states of the slave displays.Arguments
- int mask - Bit mask, that defines slaves, on which a function should be called. Use ~0 for all slaves.
Each bit of the mask corresponds to a slave. To specify certain slave use: 1 << slave_number
- string name - Name of the function.
- Blob buffer - Buffer with states of the displays that need to be passed to the function.
void waitSlaves ( int slaves_count, float timeout = 10.0f ) #
Sets Syncker to standby mode, for the specified minimum number of slaves to connect.Synchronization is suspended until the specified number of slaves are connected. If some of the connected slaves have a world, that differs from the one loaded by the master, they are forced to load the same. Synchronization resumes as the last slave reports that the world was loaded.
Arguments
- int slaves_count - Minimum number of slaves to be connected.
- float timeout - Timeout value for loading the world on all slaves, in seconds. The default value is 10.0.
void setSlavePlayer ( int mask, Player player ) #
Sets the specified player for all slave computers specified by the mask.Syncronization of the main master camera is disabled.
Arguments
- int mask - Bit mask, that defines slaves, on which the specified player is to be set. Use ~0 for all slaves.
Each bit of the mask corresponds to a slave. To specify certain slave use: 1 << slave_number
- Player player - Player to be set.
void sendTCPUser ( int mask, Blob message ) #
Sends a user message contained in the specified buffer to the specified slave(s) via the TCP protocol.Arguments
- int mask - Bit mask, that defines slaves, to which a message is to be sent. Use ~0 for all slaves.
Each bit of the mask corresponds to a slave. To specify certain slave use: 1 << slave_number
- Blob message - Buffer, containing a user message.
Last update:
2019-08-16
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)