Vizard 7 » Reference » Clustering » Handling project resources
7.6

Handling project resources

Cluster clients do not need to have a copy of the vizard script in order to run properly, however they do need a copy of all resources that are used in order to display on the clients. There are a few ways to ensure the sharing of resources.

Sync Resources

The easiest way to share resources with cluster clients is to enable the Sync Resources option in the Cluster Master application. When this option is enabled, before running a script, the cluster master will automatically send all resources in the directory and sub-directories of the script to the cluster clients. When using this option, make sure all resources reside in the same directory or sub-directory as the script. If your script loads resources within a parent folder of the main script, then those resources will not be accessible by the cluster clients.

Vizard's Resource Folder

Using files that exist in each client's Vizard resource folder (\resources) will ensure each can load them.

Identical Path

Resources across all machines need to be located in identical path locations. If the resources for that master are located on the Desktop for the Windows user WorldViz, then the path may be C:\Users\WorldViz\Desktop thus all other computers need to have their resources in that location.

Absolute Network  Path

To avoid having to distribute copies of files across machines an absolute network path can be specified. Assuming a simple file sharing network with computer bender and resource folder res then files should be added to the script like so:

plane = viz.add('\\\\bender\\res\\plane.wrl')

Note that each back slash needs to be duplicated, and that the master and each client computer needs to have access to the network share.

Note: Using this method can slow down loading times due to simultaneous disk access by multiple computers.

Modifying the Resource Path

To avoid absolute paths, one can modify the resource path at run time by calling viz.res.addPath(). To achieve the same result with importing the plane as before, one can do the following:

viz.res.addPath('\\\\bender\\res')
plane = viz.add('plane.wrl')

Once again note the double back slashes in place of the single back slashes. This can also be used with local paths just remember to use double back slashes in place of back slashes. Also multiple paths can be added if files are stored in different locations on different machines.

See also

In this section:

Cluster basics

Connecting your cluster

Collaboration

Cluster masks

Cluster callbacks

Clustering Command Table

Other sections:

Vizcave

Networking basics