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 Tmograph_cache

Tmograph_cache

Attributes

  • ENGLISH NAME : MoGraphCache
  • NAME : Tmograph_cache
  • INCLUDE : Tbase
  • PATH : mograph/description/tmograph_cache.res
  • PLUGIN : mograph
  • MAXON online help (may not exist): TMOGRAPH_CACHE

Elements

ID UI Name Type Parameters Cycle
MGCACHETAG_BAKESEQUENCE_ACTIVE Range BOOL ANIM
MGCACHETAG_BAKEFROM From BASETIME  
MGCACHETAG_BAKETO To BASETIME  
MGCACHETAG_BAKESEQUENCE Bake BUTTON SCALE_H
MGCACHETAG_BAKEFRAME BakeFrame BUTTON SCALE_H
MGCACHETAG_CLEARCACHE ClearCache BUTTON SCALE_H
MGCACHETAG_CLEARFRAME ClearFrame BUTTON SCALE_H
MGCACHETAG_EXPORT_CACHEFILE Filename FILENAME
SAVE
ANIM OFF
SCALE_H
MGCACHETAG_EXPORT_TOKENS -> POPUP ANIM
MGCACHETAG_BAKETOEXTERNAL Baketofile BUTTON SCALE_H
MGCACHETAG_CACHE_EXPORT ExportCachetoFile BUTTON SCALE_H
MGCACHETAG_ACTIVE_CACHEFILE ExternalCacheFile FILENAME
ANIM OFF
HIDDEN
MGCACHETAG_CACHE_ISSEQUENCE CacheFileIsSequence BOOL
ANIM OFF
HIDDEN
MGCACHETAG_LOOPSTART LoopStartFrame LONG
ANIM OFF
MIN 0
HIDDEN
MGCACHETAG_LOOPEND LoopEndFrame LONG
ANIM OFF
MIN 0
HIDDEN
MGCACHETAG_ACTIVE Enable BOOL  
MGCACHETAG_STRENGTH Strength REAL
UNIT PERCENT
MIN 0.0
MAX 100.0
CUSTOMGUI REALSLIDER
MGCACHETAG_MODE CacheType LONG  
MGCACHETAG_MODE_INTERNAL Internal
MGCACHETAG_MODE_EXTERNAL LoadFromFile
MGCACHETAG_IMPORT_CACHEFILE Filename FILENAME
ANIM OFF
SCALE_H
MGCACHETAG_IMPORT_TOKENS POPUP ANIM
MGCACHETAG_CACHE_IMPORT LoadCacheFromFile BUTTON
ANIM OFF
SCALE_H
MGCACHETAG_OFFSET Offset BASETIME  
MGCACHETAG_LOOP Loop BOOL  
MGCACHETAG_LOOP_BLEND LoopBlending REAL
MIN 0.0
MAX 100.0
UNIT PERCENT

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.Tmograph_cache)
    doc.InsertObject(obj)
    c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
    
    #You can set parameters two different ways. 
    #First way              
    tag[c4d.MGCACHETAG_BAKESEQUENCE_ACTIVE] = True
    tag[c4d.MGCACHETAG_EXPORT_CACHEFILE] = "c:\\SomeFile.txt"
    tag[c4d.MGCACHETAG_ACTIVE_CACHEFILE] = "c:\\SomeFile.txt"
    tag[c4d.MGCACHETAG_CACHE_ISSEQUENCE] = True
    tag[c4d.MGCACHETAG_LOOPSTART] = 1
    tag[c4d.MGCACHETAG_LOOPEND] = 1
    tag[c4d.MGCACHETAG_ACTIVE] = True
    tag[c4d.MGCACHETAG_STRENGTH] = 0.1
    tag[c4d.MGCACHETAG_MODE] = c4d.MGCACHETAG_MODE_INTERNAL
    tag[c4d.MGCACHETAG_IMPORT_CACHEFILE] = "c:\\SomeFile.txt"
    tag[c4d.MGCACHETAG_LOOP] = True
    tag[c4d.MGCACHETAG_LOOP_BLEND] = 0.1
    
    #Second way, using the base container.
    bc = tag.GetDataInstance()
    bc.SetBool(c4d.MGCACHETAG_BAKESEQUENCE_ACTIVE,True)
    bc.SetFileName(c4d.MGCACHETAG_EXPORT_CACHEFILE,"c:\\SomeFile.txt")
    bc.SetFileName(c4d.MGCACHETAG_ACTIVE_CACHEFILE,"c:\\SomeFile.txt")
    bc.SetBool(c4d.MGCACHETAG_CACHE_ISSEQUENCE,True)
    bc.SetInt32(c4d.MGCACHETAG_LOOPSTART,1)
    bc.SetInt32(c4d.MGCACHETAG_LOOPEND,1)
    bc.SetBool(c4d.MGCACHETAG_ACTIVE,True)
    bc.SetFloat(c4d.MGCACHETAG_STRENGTH,0.1)
    bc.SetInt32(c4d.MGCACHETAG_MODE,c4d.MGCACHETAG_MODE_INTERNAL)
    bc.SetFileName(c4d.MGCACHETAG_IMPORT_CACHEFILE,"c:\\SomeFile.txt")
    bc.SetBool(c4d.MGCACHETAG_LOOP,True)
    bc.SetFloat(c4d.MGCACHETAG_LOOP_BLEND,0.1)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../mograph/description/tmograph_cache.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(Tmograph_cache);
    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(MGCACHETAG_BAKESEQUENCE_ACTIVE),GeData(true),flags);
    pTag->SetParameter(DescID(MGCACHETAG_EXPORT_CACHEFILE),GeData(Filename("c:\\SomeFile.txt"),flags);
    pTag->SetParameter(DescID(MGCACHETAG_ACTIVE_CACHEFILE),GeData(Filename("c:\\SomeFile.txt"),flags);
    pTag->SetParameter(DescID(MGCACHETAG_CACHE_ISSEQUENCE),GeData(true),flags);
    pTag->SetParameter(DescID(MGCACHETAG_LOOPSTART),GeData(1),flags);
    pTag->SetParameter(DescID(MGCACHETAG_LOOPEND),GeData(1),flags);
    pTag->SetParameter(DescID(MGCACHETAG_ACTIVE),GeData(true),flags);
    pTag->SetParameter(DescID(MGCACHETAG_STRENGTH),GeData(0.1),flags);
    pTag->SetParameter(DescID(MGCACHETAG_MODE),GeData(MGCACHETAG_MODE_INTERNAL),flags);
    pTag->SetParameter(DescID(MGCACHETAG_IMPORT_CACHEFILE),GeData(Filename("c:\\SomeFile.txt"),flags);
    pTag->SetParameter(DescID(MGCACHETAG_LOOP),GeData(true),flags);
    pTag->SetParameter(DescID(MGCACHETAG_LOOP_BLEND),GeData(0.1),flags);
    pTag->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pTag->GetDataInstance();
    bc->SetBool(MGCACHETAG_BAKESEQUENCE_ACTIVE,true);
    bc->SetFileName(MGCACHETAG_EXPORT_CACHEFILE,"c:\\SomeFile.txt");
    bc->SetFileName(MGCACHETAG_ACTIVE_CACHEFILE,"c:\\SomeFile.txt");
    bc->SetBool(MGCACHETAG_CACHE_ISSEQUENCE,true);
    bc->SetInt32(MGCACHETAG_LOOPSTART,1);
    bc->SetInt32(MGCACHETAG_LOOPEND,1);
    bc->SetBool(MGCACHETAG_ACTIVE,true);
    bc->SetFloat(MGCACHETAG_STRENGTH,0.1);
    bc->SetInt32(MGCACHETAG_MODE,MGCACHETAG_MODE_INTERNAL);
    bc->SetFileName(MGCACHETAG_IMPORT_CACHEFILE,"c:\\SomeFile.txt");
    bc->SetBool(MGCACHETAG_LOOP,true);
    bc->SetFloat(MGCACHETAG_LOOP_BLEND,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.MGCACHETAG_BAKESEQUENCE)
c4d.CallButton(tag,c4d.MGCACHETAG_BAKEFRAME)
c4d.CallButton(tag,c4d.MGCACHETAG_CLEARCACHE)
c4d.CallButton(tag,c4d.MGCACHETAG_CLEARFRAME)
c4d.CallButton(tag,c4d.MGCACHETAG_BAKETOEXTERNAL)
c4d.CallButton(tag,c4d.MGCACHETAG_CACHE_EXPORT)
c4d.CallButton(tag,c4d.MGCACHETAG_CACHE_IMPORT)

C++

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

DescriptionCommand dc; dc.id = DescID(MGCACHETAG_BAKEFRAME); pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc; dc.id = DescID(MGCACHETAG_CLEARCACHE); pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc; dc.id = DescID(MGCACHETAG_CLEARFRAME); pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc; dc.id = DescID(MGCACHETAG_BAKETOEXTERNAL); pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc; dc.id = DescID(MGCACHETAG_CACHE_EXPORT); pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc; dc.id = DescID(MGCACHETAG_CACHE_IMPORT); pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);