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 Tcameramapping

Tcameramapping

Attributes

  • ENGLISH NAME : CameraCalibrator
  • NAME : Tcameramapping
  • INCLUDE : Texpression
  • PATH : motiontracker/description/tcameramapping.res
  • PLUGIN : motiontracker
  • MAXON online help (may not exist): TCAMERAMAPPING

Elements

ID UI Name Type Parameters Cycle
CM_IMAGE_FILENAME Image FILENAME
ANIM OFF
FIT_H
SCALE_H
CM_RDATA_FILMASPECT FilmAspect REAL
ANIM OFF
STEP 0.01
MIN 0.001
MAX 1000.0
CM_RDATA_FILMPRESET LONG ANIM
CM_RDATA_FILMPRESET_CUSTOM Custom
CM_RDATA_FILMPRESET_SQUARE Square(1:1)
CM_RDATA_FILMPRESET_STANDARD Standard(4:3)
CM_RDATA_FILMPRESET_HDTV HDTV(16:9)
CM_RDATA_FILMPRESET_35MMSTILL 35mmStill(3:2)
CM_RDATA_FILMPRESET_WIDESCREEN Widescreen(14:9)
CM_RDATA_FILMPRESET_35MM 35mm(1.85:1)
CM_RDATA_FILMPRESET_PANAVISION Panavision(2.39:1)
CM_LENS_PROFILE_FILENAME LensProfile FILENAME
ANIM OFF
FIT_H
SCALE_H
PARENTCOLLAPSE
CM_IMAGE_VIEW_SCALE ImageScale REAL
ANIM OFF
STEP 1.0
MIN 1.0
MAX 10000.0
UNIT PERCENT
CM_IMAGE_VIEW_OFFSET_X ImageOffsetX REAL
ANIM OFF
STEP 1.0
MIN -500.0
MAX 500.0
UNIT PERCENT
CM_IMAGE_SHOW_IMAGE ShowImage BOOL ANIM
CM_IMAGE_VIEW_OFFSET_Y ImageOffsetY REAL
ANIM OFF
STEP 1.0
MIN -500.0
MAX 500.0
UNIT PERCENT
CM_IMAGE_USE_FOREGROUND_DISPLAY KeepinForeground BOOL ANIM
CM_IMAGE_BRIGHTNESS Brightness REAL
ANIM OFF
MIN 0.0
MAX 200.0
MINSLIDER 0.0
MAXSLIDER 200.0
CUSTOMGUI REALSLIDER
UNIT PERCENT
CM_IMAGE_VIEW_FULL FullImage BUTTON  
CM_IMAGE_MATCH_VIEW_WIDTH MatchWidth BUTTON  
CM_IMAGE_MATCH_VIEW_HEIGHT MatchHeight BUTTON  
ADD_NEW_LINE AddLine BUTTON  
ADD_NEW_GRID AddGrid BUTTON  
ADD_NEW_PIN AddPin BUTTON  
DELETE_LINE DeleteLine BUTTON  
DELETE_GRID DeleteGrid BUTTON  
DELETE_PIN DeletePin BUTTON  
CM_LINE_HAS_MEASUREMENT BOOL ANIM
CM_LINE_WORLD_LENGTH REAL
ANIM OFF
UNIT METER
MIN 0.0
CM_GRID_HAS_MEASUREMENT_A BOOL ANIM
CM_GRID_WORLD_LENGTH_A REAL
ANIM OFF
UNIT METER
MIN 0.0
CM_GRID_HAS_MEASUREMENT_B BOOL ANIM
CM_GRID_WORLD_LENGTH_B REAL
ANIM OFF
UNIT METER
MIN 0.0
CM_GRID_HAS_ASPECT BOOL ANIM
CM_GRID_WORLD_ASPECT_A_OVER_B_USER REAL
ANIM OFF
MIN 0.0
STEP 0.05
CM_NUM_GRID_SEGMENTS_0 LONG
MIN 1
MAX 100
CM_GRID_OFFSET_0 REAL
MIN 0.0
MAX 100.0
STEP 1.0
UNIT PERCENT
CM_NUM_GRID_SEGMENTS_1 LONG
MIN 1
MAX 100
CM_GRID_OFFSET_1 REAL
MIN 0.0
MAX 100.0
STEP 1.0
UNIT PERCENT
CM_PIN_COORDS VECTOR
ANIM OFF
UNIT METER
COLOR_X_VP_STATE COLORBAR  
IDC_X_VP_STATE VARTEXT  
COLOR_Y_VP_STATE COLORBAR  
IDC_Y_VP_STATE VARTEXT  
COLOR_Z_VP_STATE COLORBAR  
IDC_Z_VP_STATE VARTEXT  
COLOR_CAM_CAL_FOCAL_STATE COLORBAR  
IDC_CAM_CAL_FOCAL_STATE VARTEXT  
COLOR_CAM_CAL_ORIENTATION_STATE COLORBAR  
IDC_CAM_CAL_ORIENTATION_STATE VARTEXT  
COLOR_CAM_CAL_POS_STATE COLORBAR  
IDC_CAM_CAL_POS_STATE VARTEXT  
CREATE_CAMERA_MAPPING_TEXTURE_TAG CreateCameraMappingTag BUTTON  
CREATE_BACKGROUND_OBJECT CreateBackgroundObject BUTTON  
CM_CALC_PP_WHEN_3VPS CalculatePPfor3VPs BOOL ANIM
CM_LOUPE_USE_OFFSET OffsetMagnifier BOOL ANIM
CM_LOUPE_MAGNIFICATION MagnifierZoomValue REAL
ANIM OFF
STEP 1.0
MIN 100.0
MAX 1000.0
UNIT PERCENT
CM_LOUPE_SIZE_PIX MagnifierSize REAL
ANIM OFF
STEP 1.0
MIN 8.0
MAX 512.0
LINKED_ELEMENT_LIST IN_EXCLUDE NUM_FLAGS

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.Osphere)
    tag = obj.MakeTag(c4d.Tcameramapping)
    doc.InsertObject(obj)
    c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
    
    #You can set parameters two different ways. 
    #First way              
    tag[c4d.CM_IMAGE_FILENAME] = "c:\\SomeFile.txt"
    tag[c4d.CM_RDATA_FILMASPECT] = 0.1
    tag[c4d.CM_RDATA_FILMPRESET] = c4d.CM_RDATA_FILMPRESET_CUSTOM
    tag[c4d.CM_LENS_PROFILE_FILENAME] = "c:\\SomeFile.txt"
    tag[c4d.CM_IMAGE_VIEW_SCALE] = 0.1
    tag[c4d.CM_IMAGE_VIEW_OFFSET_X] = 0.1
    tag[c4d.CM_IMAGE_SHOW_IMAGE] = True
    tag[c4d.CM_IMAGE_VIEW_OFFSET_Y] = 0.1
    tag[c4d.CM_IMAGE_USE_FOREGROUND_DISPLAY] = True
    tag[c4d.CM_IMAGE_BRIGHTNESS] = 0.1
    tag[c4d.CM_LINE_HAS_MEASUREMENT] = True
    tag[c4d.CM_LINE_WORLD_LENGTH] = 0.1
    tag[c4d.CM_GRID_HAS_MEASUREMENT_A] = True
    tag[c4d.CM_GRID_WORLD_LENGTH_A] = 0.1
    tag[c4d.CM_GRID_HAS_MEASUREMENT_B] = True
    tag[c4d.CM_GRID_WORLD_LENGTH_B] = 0.1
    tag[c4d.CM_GRID_HAS_ASPECT] = True
    tag[c4d.CM_GRID_WORLD_ASPECT_A_OVER_B_USER] = 0.1
    tag[c4d.CM_NUM_GRID_SEGMENTS_0] = 1
    tag[c4d.CM_GRID_OFFSET_0] = 0.1
    tag[c4d.CM_NUM_GRID_SEGMENTS_1] = 1
    tag[c4d.CM_GRID_OFFSET_1] = 0.1
    tag[c4d.CM_PIN_COORDS] = c4d.Vector(1.0,1.0,1.0)
    tag[c4d.CM_CALC_PP_WHEN_3VPS] = True
    tag[c4d.CM_LOUPE_USE_OFFSET] = True
    tag[c4d.CM_LOUPE_MAGNIFICATION] = 0.1
    tag[c4d.CM_LOUPE_SIZE_PIX] = 0.1
    
    #Second way, using the base container.
    bc = tag.GetDataInstance()
    bc.SetFileName(c4d.CM_IMAGE_FILENAME,"c:\\SomeFile.txt")
    bc.SetFloat(c4d.CM_RDATA_FILMASPECT,0.1)
    bc.SetInt32(c4d.CM_RDATA_FILMPRESET,c4d.CM_RDATA_FILMPRESET_CUSTOM)
    bc.SetFileName(c4d.CM_LENS_PROFILE_FILENAME,"c:\\SomeFile.txt")
    bc.SetFloat(c4d.CM_IMAGE_VIEW_SCALE,0.1)
    bc.SetFloat(c4d.CM_IMAGE_VIEW_OFFSET_X,0.1)
    bc.SetBool(c4d.CM_IMAGE_SHOW_IMAGE,True)
    bc.SetFloat(c4d.CM_IMAGE_VIEW_OFFSET_Y,0.1)
    bc.SetBool(c4d.CM_IMAGE_USE_FOREGROUND_DISPLAY,True)
    bc.SetFloat(c4d.CM_IMAGE_BRIGHTNESS,0.1)
    bc.SetBool(c4d.CM_LINE_HAS_MEASUREMENT,True)
    bc.SetFloat(c4d.CM_LINE_WORLD_LENGTH,0.1)
    bc.SetBool(c4d.CM_GRID_HAS_MEASUREMENT_A,True)
    bc.SetFloat(c4d.CM_GRID_WORLD_LENGTH_A,0.1)
    bc.SetBool(c4d.CM_GRID_HAS_MEASUREMENT_B,True)
    bc.SetFloat(c4d.CM_GRID_WORLD_LENGTH_B,0.1)
    bc.SetBool(c4d.CM_GRID_HAS_ASPECT,True)
    bc.SetFloat(c4d.CM_GRID_WORLD_ASPECT_A_OVER_B_USER,0.1)
    bc.SetInt32(c4d.CM_NUM_GRID_SEGMENTS_0,1)
    bc.SetFloat(c4d.CM_GRID_OFFSET_0,0.1)
    bc.SetInt32(c4d.CM_NUM_GRID_SEGMENTS_1,1)
    bc.SetFloat(c4d.CM_GRID_OFFSET_1,0.1)
    bc.SetVector(c4d.CM_PIN_COORDS, c4d.Vector(1.0,1.0,1.0)
    bc.SetBool(c4d.CM_CALC_PP_WHEN_3VPS,True)
    bc.SetBool(c4d.CM_LOUPE_USE_OFFSET,True)
    bc.SetFloat(c4d.CM_LOUPE_MAGNIFICATION,0.1)
    bc.SetFloat(c4d.CM_LOUPE_SIZE_PIX,0.1)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../motiontracker/description/tcameramapping.h"
void SampleFunction()
{
    BaseDocument *pDoc = GetActiveDocument();
    BaseObject *pObject = BaseObject::Alloc(Osphere);
    pDoc->InsertObject(pObject);
    pDoc->StartUndo();
    pDoc->AddUndo(UNDOTYPE_NEW,pObject);
    pDoc->EndUndo();
    pDoc->StartUndo();
    BaseTag *pTag = pObject->MakeTag(Tcameramapping);
    pDoc->AddUndo(UNDOTYPE_NEW,pTag);
    pDoc->EndUndo();
    pObject->Message(MSG_UPDATE);
    
    //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;
    pTag->SetParameter(DescID(CM_IMAGE_FILENAME),GeData(Filename("c:\\SomeFile.txt"),flags);
    pTag->SetParameter(DescID(CM_RDATA_FILMASPECT),GeData(0.1),flags);
    pTag->SetParameter(DescID(CM_RDATA_FILMPRESET),GeData(CM_RDATA_FILMPRESET_CUSTOM),flags);
    pTag->SetParameter(DescID(CM_LENS_PROFILE_FILENAME),GeData(Filename("c:\\SomeFile.txt"),flags);
    pTag->SetParameter(DescID(CM_IMAGE_VIEW_SCALE),GeData(0.1),flags);
    pTag->SetParameter(DescID(CM_IMAGE_VIEW_OFFSET_X),GeData(0.1),flags);
    pTag->SetParameter(DescID(CM_IMAGE_SHOW_IMAGE),GeData(true),flags);
    pTag->SetParameter(DescID(CM_IMAGE_VIEW_OFFSET_Y),GeData(0.1),flags);
    pTag->SetParameter(DescID(CM_IMAGE_USE_FOREGROUND_DISPLAY),GeData(true),flags);
    pTag->SetParameter(DescID(CM_IMAGE_BRIGHTNESS),GeData(0.1),flags);
    pTag->SetParameter(DescID(CM_LINE_HAS_MEASUREMENT),GeData(true),flags);
    pTag->SetParameter(DescID(CM_LINE_WORLD_LENGTH),GeData(0.1),flags);
    pTag->SetParameter(DescID(CM_GRID_HAS_MEASUREMENT_A),GeData(true),flags);
    pTag->SetParameter(DescID(CM_GRID_WORLD_LENGTH_A),GeData(0.1),flags);
    pTag->SetParameter(DescID(CM_GRID_HAS_MEASUREMENT_B),GeData(true),flags);
    pTag->SetParameter(DescID(CM_GRID_WORLD_LENGTH_B),GeData(0.1),flags);
    pTag->SetParameter(DescID(CM_GRID_HAS_ASPECT),GeData(true),flags);
    pTag->SetParameter(DescID(CM_GRID_WORLD_ASPECT_A_OVER_B_USER),GeData(0.1),flags);
    pTag->SetParameter(DescID(CM_NUM_GRID_SEGMENTS_0),GeData(1),flags);
    pTag->SetParameter(DescID(CM_GRID_OFFSET_0),GeData(0.1),flags);
    pTag->SetParameter(DescID(CM_NUM_GRID_SEGMENTS_1),GeData(1),flags);
    pTag->SetParameter(DescID(CM_GRID_OFFSET_1),GeData(0.1),flags);
    pTag->SetParameter(DescID(CM_PIN_COORDS),GeData(Vector(1.0,1.0,1.0)),flags);
    pTag->SetParameter(DescID(CM_CALC_PP_WHEN_3VPS),GeData(true),flags);
    pTag->SetParameter(DescID(CM_LOUPE_USE_OFFSET),GeData(true),flags);
    pTag->SetParameter(DescID(CM_LOUPE_MAGNIFICATION),GeData(0.1),flags);
    pTag->SetParameter(DescID(CM_LOUPE_SIZE_PIX),GeData(0.1),flags);
    pTag->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pTag->GetDataInstance();
    bc->SetFileName(CM_IMAGE_FILENAME,"c:\\SomeFile.txt");
    bc->SetFloat(CM_RDATA_FILMASPECT,0.1);
    bc->SetInt32(CM_RDATA_FILMPRESET,CM_RDATA_FILMPRESET_CUSTOM);
    bc->SetFileName(CM_LENS_PROFILE_FILENAME,"c:\\SomeFile.txt");
    bc->SetFloat(CM_IMAGE_VIEW_SCALE,0.1);
    bc->SetFloat(CM_IMAGE_VIEW_OFFSET_X,0.1);
    bc->SetBool(CM_IMAGE_SHOW_IMAGE,true);
    bc->SetFloat(CM_IMAGE_VIEW_OFFSET_Y,0.1);
    bc->SetBool(CM_IMAGE_USE_FOREGROUND_DISPLAY,true);
    bc->SetFloat(CM_IMAGE_BRIGHTNESS,0.1);
    bc->SetBool(CM_LINE_HAS_MEASUREMENT,true);
    bc->SetFloat(CM_LINE_WORLD_LENGTH,0.1);
    bc->SetBool(CM_GRID_HAS_MEASUREMENT_A,true);
    bc->SetFloat(CM_GRID_WORLD_LENGTH_A,0.1);
    bc->SetBool(CM_GRID_HAS_MEASUREMENT_B,true);
    bc->SetFloat(CM_GRID_WORLD_LENGTH_B,0.1);
    bc->SetBool(CM_GRID_HAS_ASPECT,true);
    bc->SetFloat(CM_GRID_WORLD_ASPECT_A_OVER_B_USER,0.1);
    bc->SetInt32(CM_NUM_GRID_SEGMENTS_0,1);
    bc->SetFloat(CM_GRID_OFFSET_0,0.1);
    bc->SetInt32(CM_NUM_GRID_SEGMENTS_1,1);
    bc->SetFloat(CM_GRID_OFFSET_1,0.1);
    bc->SetVector(CM_PIN_COORDS, c4d.Vector(1.0,1.0,1.0);
    bc->SetBool(CM_CALC_PP_WHEN_3VPS,true);
    bc->SetBool(CM_LOUPE_USE_OFFSET,true);
    bc->SetFloat(CM_LOUPE_MAGNIFICATION,0.1);
    bc->SetFloat(CM_LOUPE_SIZE_PIX,0.1);
    pTag->Message(MSG_UPDATE);                                                      
}
             

Buttons

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

Python

c4d.CallButton(tag,c4d.CM_IMAGE_VIEW_FULL)
c4d.CallButton(tag,c4d.CM_IMAGE_MATCH_VIEW_WIDTH)
c4d.CallButton(tag,c4d.CM_IMAGE_MATCH_VIEW_HEIGHT)
c4d.CallButton(tag,c4d.ADD_NEW_LINE)
c4d.CallButton(tag,c4d.ADD_NEW_GRID)
c4d.CallButton(tag,c4d.ADD_NEW_PIN)
c4d.CallButton(tag,c4d.DELETE_LINE)
c4d.CallButton(tag,c4d.DELETE_GRID)
c4d.CallButton(tag,c4d.DELETE_PIN)
c4d.CallButton(tag,c4d.CREATE_CAMERA_MAPPING_TEXTURE_TAG)
c4d.CallButton(tag,c4d.CREATE_BACKGROUND_OBJECT)

C++

DescriptionCommand dc;
dc.id = DescID(CM_IMAGE_VIEW_FULL);             
pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);

DescriptionCommand dc; dc.id = DescID(CM_IMAGE_MATCH_VIEW_WIDTH); pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc; dc.id = DescID(CM_IMAGE_MATCH_VIEW_HEIGHT); pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc; dc.id = DescID(ADD_NEW_LINE); pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc; dc.id = DescID(ADD_NEW_GRID); pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc; dc.id = DescID(ADD_NEW_PIN); pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc; dc.id = DescID(DELETE_LINE); pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc; dc.id = DescID(DELETE_GRID); pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc; dc.id = DescID(DELETE_PIN); pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc; dc.id = DescID(CREATE_CAMERA_MAPPING_TEXTURE_TAG); pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc; dc.id = DescID(CREATE_BACKGROUND_OBJECT); pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);