Files that are dynamically loaded may not be automatically detected by the publish wizard. Common examples of this include files loaded after user defined events and timer expirations, and files loaded in later phases of an application (e.g. viztask function). Add the following code and run the script. Press the space bar to load the dojo model:
Next, follow the publish process as in the previous section. Make sure:
This is a short exercise showing how to create and detect an error in the publish process. The published EXE references a file dojo.osgb that's not included in the final build. Run the EXE and press the space bar; nothing happens. Look in the console and you should see the error:
ERROR: Failed to load model: 'dojo.osgb'
This message is generated if a file is not included in the EXE. There are two ways to resolve this type of error:
Go ahead and re-publish the script. This time press the spacebar during Step 1. Browse through the dependency list and you should see dojo.osgb included.
In addition to the resource itself (e.g. model, image, media file), the EXE requires specific file loader(s) for each file extension. Vizard will automatically detect all file loader plugins that are used during the publish process. However, if your script dynamically loads certain files, then the file loader plugin might not be included in your published executable. For example, if a dynamically loaded model references external texture files, the image loader for those textures may not be included.
To manually add a file loader use the viz.res.addPublishFileLoader() command:
To add image loaders for common image types to the EXE, use the viz.res.addPublishImageLoaders() command:
Sometimes it's helpful to specify all the files or files of a certain type within a directory. For example, the following adds all osgb files from the resource directory of the Vizard installation to the dependency list: