Motive Batch Processor
The Motive Batch Processor is a separate stand-alone Windows application, built on the new NMotive scripting and programming API, that can be utilized to process a set of Motive Take files via IronPython or C# scripts. While the Batch Processor includes some example script files, it is primarily designed to utilize user-authored scripts.
Initial functionality includes scripting access to file I/O, reconstructions, high-level Take processing using many of Motive's existing editing tools, and data export. Upcoming versions will provide access to track, channel, and frame-level information, for creating cleanup and labeling tools based on individual marker reconstruction data.
Motive Batch Processor Scripts make use of the NMotive .NET class library, and you can also utilize the NMotive classes to write .NET programs and IronPython scripts that run outside of this application. The NMotive assembly is installed in the Global Assembly Cache and also located in the
assembliessub-directory of the Motive install directory. For example, the default location for the assembly included in the 64-bit Motive installer is:
The full source code for the Motive Batch Processor is also installed with Motive, at:
You are welcome to use the source code as a starting point to build your own applications on the NMotive framework.
- A batch processor script using the NMotive API. (C# or IronPython)
- Take files that will be processed.
- 2.First, select and load a Batch Processor Script. Sample scripts for various pipelines can be found in the
- 3.Load the captured Takes (TAK) that will be processed using the imported scripts.
- 4.Click Process Takes to batch process the Take files.
When running the reconstruction pipeline in the batch processor, the reconstruction settings must be loaded using the ImportMotiveProfile method. From Motive, export out the user profile and make sure it includes the reconstruction settings. Then, import this user profile file into the Batch Processor script before running the reconstruction, or trajectorizer, pipeline so that proper settings can be used for reconstructing the 3D data. For more information, refer to the sample scripts located in the TakeManipulation folder.
A class reference in Microsoft compiled HTML (.chm) format can be found in the
Helpsub-directory of the Motive install directory. The default location for the help file (in the 64-bit Motive installer) is:
The Motive Batch Processor can run C# and IronPython scripts. Below is an overview of the C# script format, as well as an example script.
A valid Batch Processor C# script file must contain a single class implementing the
ItakeProcessingScriptinterface. This interface defines a single function:
Result ProcessTake( Take t, ProgressIndicator progress ).
Result, Take, and ProgressIndicatorare all classes defined in the
NMotivenamespace. The Take object
tis an instance of the NMotive
Takeclass. It is the take being processed. The
progressobject is an instance of the NMotive
ProgressIndicatorand allows the script to update the Batch Processor UI with progress and messages. The general format of a Batch Processor C# script is:
// any other using statements
public class MyCSharpScript : ITakeProcessingScript
public Result ProcessTake(Take t, ProgressIndicator progress)
// Script processing code here
progress.SetMessage(“Done processing take “ + t.Name);
progress.SetProgress( 100 );
[Motive Directory]\MotiveBatchProcessor\ExampleScripts\folder, there are multiple C# (.cs) sample scripts that demonstrate the use of the NMotive for processing various different pipelines including tracking data export and other post-processing tools. Note that your C# script file must have a '.cs' extension.
Included sample script pipelines:
- ExporterScript - BVH, C3D, CSV, FBXAscii, FBXBinary, TRC
- TakeManipulation - AddMarker, DisableAssets, GapFill, MarkerFilterSCript, ReconstructAutoLabel, RemoveUnlabeledMarkers, RenameAsset
IronPython is an implementation of the Python programming language that can use the .NET libraries and Python libraries. The batch processor can execute valid IronPython scripts in addition to C# scripts.
Your IronPython script file must import the clr module and reference the NMotive assembly. In addition, it must contain the following function:
def ProcessTake(Take t, ProgressIndicator progress)
The following illustrates a typical IronPython script format.
#import sys and clr modules
# Add a reference to the NMotive assembly
# Import everything from sys and NMotive.
from System import *
from NMotive import *
# Define the ProcessTake function.
def ProcessTake(take, progress):
# Take processing code here
# return result object
[Motive Directory]\MotiveBatchProcessor\ExampleScripts\folder, there are sample scripts that demonstrate the use of the NMotive for processing various different pipelines including tracking data export and other post-processing tools. Note that your IronPython script file must have a '.cs' extension.