About

A MtFootageData object stores information on the video footage loaded by the parent MotionTrackerObject.

Access

The MtFootageData object is obtained from the parent MotionTrackerObject.

Warning
The returned object is a copy owned by the caller.
// This example accesses the Motion Tracker object
// to print the used footage filename to the console.
// check if an object is selected and if it is a Motion Tracker object
BaseObject* const obj = doc->GetActiveObject();
if (obj == nullptr || !obj->IsInstanceOf(Omotiontracker))
return maxon::IllegalArgumentError(MAXON_SOURCE_LOCATION);
const MotionTrackerObject* const moTrackObject = static_cast<MotionTrackerObject*>(obj);
MtFootageData* footage = moTrackObject->GetFootageData();
if (footage == nullptr)
return maxon::UnexpectedError(MAXON_SOURCE_LOCATION);
const Filename footageName = footage->GetFootageName();
ApplicationOutput("Footage: " + footageName.GetString());
// do not forget to free the copy
Definition: c4d_baseobject.h:225
Manages file and path names.
Definition: c4d_file.h:94
String GetString() const
Definition: lib_motiontracker.h:358
MtFootageData * GetFootageData() const
Definition: lib_motiontracker.h:274
static void Free(MtFootageData *&p)
Filename GetFootageName() const
PyObject * obj
Definition: complexobject.h:60
#define Omotiontracker
Motion tracker.
Definition: ge_prepass.h:1093
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:67
#define ApplicationOutput(formatString,...)
Definition: debugdiagnostics.h:210
const char * doc
Definition: pyerrors.h:226

Footage Data

The MtFootageData object provides read-access to several properties of the loaded video footage.

General information on the loaded footage:

Video Resolution and Ratio of the loaded footage:

// This example prints various settings of the
// used footage to the console window.
MtFootageData* footage = moTrackObject->GetFootageData();
if (footage == nullptr)
return maxon::UnexpectedError(MAXON_SOURCE_LOCATION);
// AutoFree takes ownership
freeFootage.Assign(footage);
// access and print footage filename
const Filename footageName = footage->GetFootageName();
ApplicationOutput("Footage: " + footageName.GetString());
// access footage resolution
const Int32 width = footage->GetResolutionWidthPix(true);
const Int32 height = footage->GetResolutionHeightPix(true);
// print result
const String widthStr = String::IntToString(width);
const String heightStr = String::IntToString(height);
ApplicationOutput("Width: " + widthStr + ", Height: " + heightStr);
Definition: ge_autoptr.h:155
void Assign(TYPE *p)
Definition: ge_autoptr.h:234
Int32 GetResolutionWidthPix(Bool originalRes) const
Int32 GetResolutionHeightPix(Bool originalRes) const
Definition: c4d_string.h:39
static String IntToString(Int32 v)
Definition: c4d_string.h:495
maxon::Int32 Int32
Definition: ge_sys_math.h:60
unsigned long Py_ssize_t width
Definition: pycore_traceback.h:88

Further Reading