Motive Batch Processor

Introduction

The Motive Batch Processor is a Windows application that applies a function, in the form of an IronPython or C# script file, to a set of selected Take files. The Batch Processor includes some example script files but, in general, you must write your own. Scripts make use of the NMotive .NET class library. Note that you can also use the NMotive classes to write .NET programs and IronPython scripts that run outside of the Batch Processor. The NMotive assembly installed in the Global Assembly Cache and also located in the assemblies sub-directory of the Motive install directory. For example, the default location for the assembly included in the 64-bit Motive installer is:

C:\Program Files\OptiTrack\Motive\assemblies\x64

A class reference in Microsoft compiled HTML format can be found in the Help sum-directory of the the Motive install directory. For example the default location for the help file is (64-bit Motive installer): C:\Program Files\OptiTrack\Motive\Help\NMotiveAPI.chm

C# Scripts

Motive Batch Processor can run C# and IronPython scripts. Here we describe the C# script format and give an example.

C# Script Format

A valid Batch Processor C# script file must contain a single class implementing the ItakeProcessingScript interface. This interface defines a single function -

Result ProcessTake( Take t, ProgressIndicator progress ).

Result, Take, and ProgressIndicator are all classes defined in the NMotive namespace. The Take object t is an instance of the NMotive Take class. It is the take being processed. The progress</codee> object is an instance of the NMotive ProgressIndicator and allows the script to update the Batch Processor UI with progress and messages. The general format of an Batch Processor C# script is:

<code> using NMotive; // any other using statements public class MyCSharpScript : ITakeProcessingScript {

  public Result ProcessTake(Take t, ProgressIndicator progress)
  {
     Result scriptResult;
     // Script processing code here
     progress.SetMessage(“Done processing take “ + t.Name);
     progress.SetProgress( 100 );
     return scriptResult;
  }

}