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

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);

Further Reading

AutoFree::Assign
void Assign(TYPE *p)
Definition: ge_autoptr.h:225
BaseObject
Definition: c4d_baseobject.h:224
Filename
Manages file and path names.
Definition: c4d_file.h:93
AutoFree
Definition: ge_autoptr.h:151
MtFootageData::GetResolutionWidthPix
Int32 GetResolutionWidthPix(Bool originalRes) const
MtFootageData::GetFootageName
Filename GetFootageName() const
MAXON_SOURCE_LOCATION
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:66
Omotiontracker
#define Omotiontracker
Motion tracker.
Definition: ge_prepass.h:1034
Filename::GetString
String GetString(void) const
String
Definition: c4d_string.h:38
String::IntToString
static String IntToString(Int32 v)
Definition: c4d_string.h:495
MotionTrackerObject::GetFootageData
MtFootageData * GetFootageData() const
MtFootageData
Definition: lib_motiontracker.h:273
Int32
maxon::Int32 Int32
Definition: ge_sys_math.h:58
ApplicationOutput
#define ApplicationOutput(formatString,...)
Definition: debugdiagnostics.h:207
MtFootageData::GetResolutionHeightPix
Int32 GetResolutionHeightPix(Bool originalRes) const
BaseDocument::GetActiveObject
BaseObject * GetActiveObject(void)
C4DAtom::IsInstanceOf
Bool IsInstanceOf(Int32 id) const
Definition: c4d_baselist.h:1373
MtFootageData::Free
static void Free(MtFootageData *&p)
MotionTrackerObject
Definition: lib_motiontracker.h:357