About
The MotionTrackerObject class represents a Cinema 4D motion tracker object. It provides read-only access to properties of the loaded video footage and the created 2D tracks.
MotionTrackerObject objects are an instance of Omotiontracker
.
Access
A MotionTrackerObject object can be accessed like any other object.
BaseObject*
const obj =
doc->GetActiveObject();
const MotionTrackerObject*
const moTrackObject =
static_cast<MotionTrackerObject*
>(
obj);
MtFootageData* footage = moTrackObject->GetFootageData();
if (footage == nullptr)
const Filename footageName = footage->GetFootageName();
MtFootageData::Free(footage);
PyObject * obj
Definition: complexobject.h:60
#define Omotiontracker
Motion tracker.
Definition: ge_prepass.h:1102
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:69
#define ApplicationOutput(formatString,...)
Definition: debugdiagnostics.h:204
const char * doc
Definition: pyerrors.h:226
Allocation/Deallocation
MotionTrackerObject objects are created with the usual tools:
- MotionTrackerObject::Alloc(): Creates a new MotionTrackerObject.
- MotionTrackerObject::Free(): Deletes the given MotionTrackerObject.
MotionTrackerObject* const moTrackObj = MotionTrackerObject::Alloc();
if (moTrackObj == nullptr)
moTrackObj->SetName("New Motion Tracker"_s);
doc->InsertObject(moTrackObj,
nullptr,
nullptr);
Parameters
The standard object parameters of the Motion Tracker object can be accessed with C4DAtom::GetParameter() and C4DAtom::SetParameter(). The parameter IDs are defined in omotiontracker.h
.
Additionally, footage information can be accessed with MotionTrackerObject::GetFootageData() (see below).
Access Data
Internal data of a MotionTrackerObject can be accessed by acquiring specialised data containers that store information on the footage and the 2D tracking data.
- MotionTrackerObject::Get2dTrackData(): Returns the MtFootageData object that stores information on the footage.
- MotionTrackerObject::GetFootageData(): Returns the Mt2dTrackData object that stores 2D track information.
See MtFootageData Manual and Mt2dTrackData / Mt2dTrack / MtData Manual.
MtFootageData* footage = moTrackObject->GetFootageData();
if (footage == nullptr)
const Int32 firstFrame = footage->GetFirstFrameNumber();
const Int32 lastFrame = footage->GetLastFrameNumber();
const String firstFrameStr = String::IntToString(firstFrame);
const String lastFrameStr = String::IntToString(lastFrame);
MtFootageData::Free(footage);
Mt2dTrackData* trackData = moTrackObject->Get2dTrackData();
if (trackData == nullptr)
const Int32 trackCount = trackData->GetTrackCount();
Mt2dTrackData::Free(trackData);
maxon::Int32 Int32
Definition: ge_sys_math.h:51
Further Reading