Here you will find documentation on all the descriptions that Cinema 4D currently has. You can list them Alphabetically, by Type or Plugin . The sample Python and C++ code is automatically generated and in some cases may not be 100% correct. If something doesn't work then please refer to the official Cinema 4D SDK documentation for more information.

IDs and information for Ophtrackedobject

Ophtrackedobject

Attributes

  • ENGLISH NAME : ObjectTracker
  • NAME : Ophtrackedobject
  • INCLUDE : Obase
  • PATH : motiontracker/description/ophtrackedobject.res
  • PLUGIN : motiontracker
  • MAXON online help (may not exist): OPHTRACKEDOBJECT

Elements

ID UI Name Type Parameters Cycle
PH_MOTION_TRACKER_OBJECT MotionTracker LINK
ANIM OFF
FIT_H
SCALE_H
PH_REFERENCE_GEOMETRY_OBJECT GeometryObject LINK
ANIM OFF
FIT_H
SCALE_H
PH_OBJ_2D_TRACK_ASSIGNED_TRACKS_ITEMTREE ITEMTREE
HEADERS
FOLDERS
SCALE_H
MULTIPLE
COLUMNS 6
ICON
DRAGDROP
RESIZABLE
PH_OBJ_2D_TRACK_USER_AUTOKEYING VirtualKeyframes BOOL
ANIM OFF
ALIGN_LEFT
PARENTCOLLAPSE
PH_OBJ_2D_TRACK_USER_AUTOKEYING_MODE Mode LONG
PARENTCOLLAPSE PH_OBJ_2D_TRACK_USER_AUTOKEYING
ANIM OFF
PH_OBJ_2D_TRACK_USER_AUTOKEYING_ERROR_THRESHOLD ErrorThreshold REAL
PARENTCOLLAPSE PH_OBJ_2D_TRACK_USER_AUTOKEYING
ANIM OFF
STEP 0.01
MINSLIDER 0.0
MAXSLIDER 1.0
CUSTOMGUI REALSLIDER
PH_OBJ_2D_TRACK_USER_AUTOKEYING_INTERVAL FrameInterval LONG
PARENTCOLLAPSE PH_OBJ_2D_TRACK_USER_AUTOKEYING
ANIM OFF
MINSLIDER 1
MAXSLIDER 50
CUSTOMGUI LONGSLIDER
PH_OBJ_2D_TRACK_COLOR_MIX_PRESET ColorFilter LONG
ANIM OFF
ALIGN_LEFT
PARENTCOLLAPSE
PH_OBJ_2D_TRACK_USER_redWeightActive Filter.Red REAL
PARENTCOLLAPSE PH_OBJ_2D_TRACK_COLOR_MIX_PRESET
ANIM OFF
MIN -200.0
MAX 200.0
STEP 1.0
MINSLIDER -100.0
MAXSLIDER 100.0
CUSTOMGUI REALSLIDER
UNIT PERCENT
PH_OBJ_2D_TRACK_USER_greenWeightActive Filter.Green REAL
PARENTCOLLAPSE PH_OBJ_2D_TRACK_COLOR_MIX_PRESET
ANIM OFF
MIN -200.0
MAX 200.0
STEP 1.0
MINSLIDER -100.0
MAXSLIDER 100.0
CUSTOMGUI REALSLIDER
UNIT PERCENT
PH_OBJ_2D_TRACK_USER_blueWeightActive Filter.Blue REAL
PARENTCOLLAPSE PH_OBJ_2D_TRACK_COLOR_MIX_PRESET
ANIM OFF
MIN -200.0
MAX 200.0
STEP 1.0
MINSLIDER -100.0
MAXSLIDER 100.0
CUSTOMGUI REALSLIDER
UNIT PERCENT
PH_CMD_ASSIGN_SELECTED_TRACKS_TO_OBJECT AssignSelected BUTTON SCALE_H
PH_CMD_UNASSIGN_SELECTED_TRACKS_FROM_OBJECT UnassignSelected BUTTON SCALE_H
PH_KEEP_OBJECT_RECON_WHEN_TRACK_2D_CHANGES LockSolvedData BOOL ANIM
PH_3D_OBJECT_PNP_SOLVE_USE_DEFERRED_AND_BA_DEBUG RunPost-SolveBAOptimisation BOOL ANIM
PH_STRICTLY_ENFORCE_KNOWN_GEOM_FOR_OBJECT_SOLVES EnforceGeometry BOOL ANIM
PH_USE_ALTERNATE_PNP_SOLVE UseAlternateSolution BOOL ANIM
PH_CMD_SOLVE_ALL_STAGES_OBJECT Run3DSolverforObject BUTTON SCALE_H

Example Code

The following code does not use the correct values when setting the data. You should check directly in C4D for the correct values that you should use in place of the ones that are shown. This code is just to show you how to access the values for getting and setting the parameters.

Python

import c4d
from c4d import gui
def main():
    obj = c4d.BaseObject(c4d.Ophtrackedobject)
    doc.InsertObject(obj)
    c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
    
    #You can set parameters two different ways. 
    #First way              
    obj[c4d.PH_OBJ_2D_TRACK_USER_AUTOKEYING] = True
    obj[c4d.PH_OBJ_2D_TRACK_USER_AUTOKEYING_MODE] = 1
    obj[c4d.PH_OBJ_2D_TRACK_USER_AUTOKEYING_ERROR_THRESHOLD] = 0.1
    obj[c4d.PH_OBJ_2D_TRACK_USER_AUTOKEYING_INTERVAL] = 1
    obj[c4d.PH_OBJ_2D_TRACK_COLOR_MIX_PRESET] = 1
    obj[c4d.PH_OBJ_2D_TRACK_USER_redWeightActive] = 0.1
    obj[c4d.PH_OBJ_2D_TRACK_USER_greenWeightActive] = 0.1
    obj[c4d.PH_OBJ_2D_TRACK_USER_blueWeightActive] = 0.1
    obj[c4d.PH_KEEP_OBJECT_RECON_WHEN_TRACK_2D_CHANGES] = True
    obj[c4d.PH_3D_OBJECT_PNP_SOLVE_USE_DEFERRED_AND_BA_DEBUG] = True
    obj[c4d.PH_STRICTLY_ENFORCE_KNOWN_GEOM_FOR_OBJECT_SOLVES] = True
    obj[c4d.PH_USE_ALTERNATE_PNP_SOLVE] = True
    
    #Second way, using the base container.
    bc = obj.GetDataInstance()
    bc.SetBool(c4d.PH_OBJ_2D_TRACK_USER_AUTOKEYING,True)
    bc.SetInt32(c4d.PH_OBJ_2D_TRACK_USER_AUTOKEYING_MODE,1)
    bc.SetFloat(c4d.PH_OBJ_2D_TRACK_USER_AUTOKEYING_ERROR_THRESHOLD,0.1)
    bc.SetInt32(c4d.PH_OBJ_2D_TRACK_USER_AUTOKEYING_INTERVAL,1)
    bc.SetInt32(c4d.PH_OBJ_2D_TRACK_COLOR_MIX_PRESET,1)
    bc.SetFloat(c4d.PH_OBJ_2D_TRACK_USER_redWeightActive,0.1)
    bc.SetFloat(c4d.PH_OBJ_2D_TRACK_USER_greenWeightActive,0.1)
    bc.SetFloat(c4d.PH_OBJ_2D_TRACK_USER_blueWeightActive,0.1)
    bc.SetBool(c4d.PH_KEEP_OBJECT_RECON_WHEN_TRACK_2D_CHANGES,True)
    bc.SetBool(c4d.PH_3D_OBJECT_PNP_SOLVE_USE_DEFERRED_AND_BA_DEBUG,True)
    bc.SetBool(c4d.PH_STRICTLY_ENFORCE_KNOWN_GEOM_FOR_OBJECT_SOLVES,True)
    bc.SetBool(c4d.PH_USE_ALTERNATE_PNP_SOLVE,True)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../motiontracker/description/ophtrackedobject.h"
void SampleFunction()
{
    BaseDocument *pDoc = GetActiveDocument();
    BaseObject *pObject = BaseObject::Alloc(Ophtrackedobject);
    pDoc->InsertObject(pObject);
    pDoc->StartUndo();
    pDoc->AddUndo(UNDO_NEW,pObject);
    pDoc->EndUndo();
    EventAdd(EVENT_FORCEREDRAW);
    
    //You can set parameters two different ways. 

    //First way              
    //Some objects do not store all their data in the container. You need to use GetParameter()/SetParameter() instead. 

    DESCFLAGS_SET flags = DESCFLAGS_SET_PARAM_SET;
    pObject->SetParameter(DescID(PH_OBJ_2D_TRACK_USER_AUTOKEYING),GeData(true),flags);
    pObject->SetParameter(DescID(PH_OBJ_2D_TRACK_USER_AUTOKEYING_MODE),GeData(1),flags);
    pObject->SetParameter(DescID(PH_OBJ_2D_TRACK_USER_AUTOKEYING_ERROR_THRESHOLD),GeData(0.1),flags);
    pObject->SetParameter(DescID(PH_OBJ_2D_TRACK_USER_AUTOKEYING_INTERVAL),GeData(1),flags);
    pObject->SetParameter(DescID(PH_OBJ_2D_TRACK_COLOR_MIX_PRESET),GeData(1),flags);
    pObject->SetParameter(DescID(PH_OBJ_2D_TRACK_USER_redWeightActive),GeData(0.1),flags);
    pObject->SetParameter(DescID(PH_OBJ_2D_TRACK_USER_greenWeightActive),GeData(0.1),flags);
    pObject->SetParameter(DescID(PH_OBJ_2D_TRACK_USER_blueWeightActive),GeData(0.1),flags);
    pObject->SetParameter(DescID(PH_KEEP_OBJECT_RECON_WHEN_TRACK_2D_CHANGES),GeData(true),flags);
    pObject->SetParameter(DescID(PH_3D_OBJECT_PNP_SOLVE_USE_DEFERRED_AND_BA_DEBUG),GeData(true),flags);
    pObject->SetParameter(DescID(PH_STRICTLY_ENFORCE_KNOWN_GEOM_FOR_OBJECT_SOLVES),GeData(true),flags);
    pObject->SetParameter(DescID(PH_USE_ALTERNATE_PNP_SOLVE),GeData(true),flags);
    pObject->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pObject->GetDataInstance();
    bc->SetBool(PH_OBJ_2D_TRACK_USER_AUTOKEYING,true);
    bc->SetInt32(PH_OBJ_2D_TRACK_USER_AUTOKEYING_MODE,1);
    bc->SetFloat(PH_OBJ_2D_TRACK_USER_AUTOKEYING_ERROR_THRESHOLD,0.1);
    bc->SetInt32(PH_OBJ_2D_TRACK_USER_AUTOKEYING_INTERVAL,1);
    bc->SetInt32(PH_OBJ_2D_TRACK_COLOR_MIX_PRESET,1);
    bc->SetFloat(PH_OBJ_2D_TRACK_USER_redWeightActive,0.1);
    bc->SetFloat(PH_OBJ_2D_TRACK_USER_greenWeightActive,0.1);
    bc->SetFloat(PH_OBJ_2D_TRACK_USER_blueWeightActive,0.1);
    bc->SetBool(PH_KEEP_OBJECT_RECON_WHEN_TRACK_2D_CHANGES,true);
    bc->SetBool(PH_3D_OBJECT_PNP_SOLVE_USE_DEFERRED_AND_BA_DEBUG,true);
    bc->SetBool(PH_STRICTLY_ENFORCE_KNOWN_GEOM_FOR_OBJECT_SOLVES,true);
    bc->SetBool(PH_USE_ALTERNATE_PNP_SOLVE,true);
    pObject->Message(MSG_UPDATE);                                                      
}
             

Buttons

This node has buttons. Buttons can manually be executed by calling the following code

Python

c4d.CallButton(obj,c4d.PH_CMD_ASSIGN_SELECTED_TRACKS_TO_OBJECT)
c4d.CallButton(obj,c4d.PH_CMD_UNASSIGN_SELECTED_TRACKS_FROM_OBJECT)
c4d.CallButton(obj,c4d.PH_CMD_SOLVE_ALL_STAGES_OBJECT)

C++

DescriptionCommand dc;
dc.id = DescID(PH_CMD_ASSIGN_SELECTED_TRACKS_TO_OBJECT);             
pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);

DescriptionCommand dc; dc.id = DescID(PH_CMD_UNASSIGN_SELECTED_TRACKS_FROM_OBJECT); pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc; dc.id = DescID(PH_CMD_SOLVE_ALL_STAGES_OBJECT); pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);