/
Configure Shogun Post to locate HSL scripts

Configure Shogun Post to locate HSL scripts

Shogun Post looks for HSL scripts in the Scripts folder (by default, C:\Program Files\Vicon\ShogunPost#.#\Scripts). Scripts in this folder can be selected from the Pipelines panel and the Script Viewer (available from the Script Editor toolbar).

Shogun is supplied with a set of default scripts: a core set of generic scripts likely to be used by most Shogun users, as well as additional scripts that may be less commonly used but that illustrate what can be done in Shogun and how to script this behavior. You can modify these or write your own custom scripts to suit your requirements.

For information on specifying additional script folders, or changing the location of the button shelf script from the Directories tab in the Preferences dialog box, see the following topics covered in this page.

Set Script folder locations

The Shogun Post Scripts folder contains the default HSL scripts supplied with Shogun, organized by category into sub-folders. By default, the Scripts folder is installed under the main Shogun program folder (C:\Program Files\Vicon\ShogunPost#.#\Scripts). Scripts in this folder can be selected from the Pipelines panel and the Script Viewer (available from the Script Editor toolbar). You can specify additional script folders in the Preferences dialog box, on the Directories tab:

  • General menu > Preferences option > Preferences dialog box > Directories tab > Scripts tab

You can specify more than one folder here, but Shogun will execute the first version of a given script file that it finds. That means that if you have two script files named greatScript.hsl, Shogun will execute the first one it finds as it searches the specified script folders in the order in which they appear in this field. You can use this search order to manage when customized scripts are used over standard Shogun scripts.

Review the default scripts in the Scripts folder and all its sub-folders because they may save you time. Each script supplied with Shogun is documented, so you can quickly determine its function and modify its commands to meet your own needs. Most Shogun users find these scripts can streamline many standard operations as written, and they also can be customized to meet other needs as required.

Tip
Make sure you save a custom version of a Shogun script under a new file name. This ensures that if your script doesn't work, you still have the original.

To specify additional script file locations:

  1. From the General menu, open the Shogun Post Preferences dialog box, click the Directories tab, and view the Script directories section, which contains a row of buttons and a file list.
  2. For each folder you want to add, in the Script directories mini toolbar, click the Add button and then in the Folder box, either type in the full path or click the Browse button and navigate to the desired location.
  3. If you have specified multiple directories, use the Move up and Move down buttons in the mini toolbar to arrange the directories in the desired order, remembering that scripts are executed in the order listed.
  4. To view the folder contents, select a folder in the list and click the Open Folder button on the mini toolbar.
  5. To update the contents of the selected folder, click the Reparse button.

Set Button Shelf script file location

Shogun uses the ScriptShelves.hsl HSL script to build the Button Shelf interface. The button shelf tabs are displayed as custom tabs on the ribbon. By default, this script is located in the main ShogunPost program folder (C:\Program Files\Vicon\ShogunPost#.#). You can specify a different filename and/or location for this file on the Directories tab in the Preferences dialog box:

  • General menu > Preferences dialog box > Directories tab > Scripts tab.

You may find it useful to create a copy of the file and/or your own folder for storing a backup file. You can specify the location of this file and/or folder as described below.

To specify a different location for the Button Shelf script file:

  1. From the General menu, open the Preferences dialog box.
  2. On the Directories tab, in the Button Shelf File section, open the Open button at the end of the line.
  3. In the Open dialog box, navigate to and select the ScriptShelves.hsl file that Shogun is to use, or supply a different name for the file and click Open.

Default Scripts folder structure

The Scripts folder (by default, C:\Program Files\Vicon\ShogunPost#.#\Scripts), contains a standard set of HSL scripts supplied with Shogun in the following structure:

FolderContents
\DefaultOpsScripts that are set up specifically for use in a pipeline, though many other scripts can be used in pipelines.
\FileIOScripts relating to import to and export from Shogun Post.
\InterfaceScripts that control the 3D view, layout of views, hiding and showing of objects, etc.
\LabelingScripts that are for labeling markers.
\MayaScripts that operate on FBX imported to Maya from Shogun Post.
\ModulesScripts that operate on a single module, or collection of modules, often performing a low-level task:

\AttributesScripts that modify generic attributes of a module.

\ChannelsScripts that operate on the channels of a module. This folder contains most of the functionality for modifying keys, marker data editing, and clips that are containers of keys.

\DeletionScripts that delete things.

\HierarchyScripts that modify the parent-child relationship of modules.

\SelectionScripts that select modules.
\MXhardwareScripts that operate on optical cameras and hardware units.
\NLEScripts that perform NLE operations like shifting, blending, looping, and adjusting clip start and end.
\SolvingScripts that affect solving skeletons.
\SubjectCalibrationScripts that calibrate subjects.
\TimeScripts that change the current time or select time ranges.
\TutorialsScripts that are used in Shogun tutorials.
\UtilitiesScripts that are generic in use and can be used to create other scripts.
Important
The scripts that are supplied with Shogun Post are subject to change with each release.

Custom scripts directories

If you create customized scripts, we recommend that you put these in a separate folder. You can call this folder anything and locate it anywhere. If you create customized scripts only for a single user, we recommend that you put these in a separate folder. It's a good idea to include the user name in the folder name.

Shogun Post searches for scripts in the same order that script folder locations are specified on the Directories tab in the Preferences dialog box. By putting customized scripts in separate folders from the standard Shogun Post Scripts folder and specifying their position, you can manage the priority in which scripts are applied. For example, if you have multiple scripts of the same name, Shogun executes the first version of a given script file that it finds. So, if you want to ensure that scripts customized for a specific user get used before a facility-wide version of that script, or the standard Shogun Post version, you would specify the following order: Personal, Facility, then ShogunPost#.#\Scripts.

Related content


© Copyright Vicon Motion Systems. All rights reserved.

Vicon trademarks