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 Tprotection

Tprotection

Attributes

  • ENGLISH NAME : ProtectionTag
  • NAME : Tprotection
  • INCLUDE : Tbase
  • PATH : c4dplugin/description/tprotection.res
  • PLUGIN : c4dplugin
  • MAXON online help (may not exist): TPROTECTION

Elements

ID UI Name Type Parameters Cycle
PROTECTION_P Position LONG  
PROTECTION_NONE None
PROTECTION_LOCK Lock
PROTECTION_LIMIT Limit
PROTECTION_P_X X BOOL  
PROTECTION_P_MIN_X Min REAL UNIT
PROTECTION_P_MAX_X Max REAL UNIT
PROTECTION_P_Y Y BOOL  
PROTECTION_P_MIN_Y Min REAL UNIT
PROTECTION_P_MAX_Y Max REAL UNIT
PROTECTION_P_Z Z BOOL  
PROTECTION_P_MIN_Z Min REAL UNIT
PROTECTION_P_MAX_Z Max REAL UNIT
PROTECTION_S Scale LONG  
PROTECTION_NONE None
PROTECTION_LOCK Lock
PROTECTION_LIMIT Limit
PROTECTION_S_X X BOOL  
PROTECTION_S_MIN_X Min REAL  
PROTECTION_S_MAX_X Max REAL  
PROTECTION_S_Y Y BOOL  
PROTECTION_S_MIN_Y Min REAL  
PROTECTION_S_MAX_Y Max REAL  
PROTECTION_S_Z Z BOOL  
PROTECTION_S_MIN_Z Min REAL  
PROTECTION_S_MAX_Z Max REAL  
PROTECTION_R Rotation LONG  
PROTECTION_NONE None
PROTECTION_LOCK Lock
PROTECTION_LIMIT Limit
PROTECTION_R_X H BOOL  
PROTECTION_R_MIN_X Min REAL UNIT
PROTECTION_R_MAX_X Max REAL UNIT
PROTECTION_R_Y P BOOL  
PROTECTION_R_MIN_Y Min REAL UNIT
PROTECTION_R_MAX_Y Max REAL UNIT
PROTECTION_R_Z B BOOL  
PROTECTION_R_MIN_Z Min REAL UNIT
PROTECTION_R_MAX_Z Max REAL UNIT
PROTECTION_ALLOW_EXPRESSIONS AllowExpressions BOOL  
PROTECTION_ALLOW_DUPLICATION AllowViewportDuplication BOOL  

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.Tprotection)
    doc.InsertObject(obj)
    c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
    
    #You can set parameters two different ways. 
    #First way              
    tag[c4d.PROTECTION_P] = c4d.PROTECTION_NONE
    tag[c4d.PROTECTION_P_X] = True
    tag[c4d.PROTECTION_P_MIN_X] = 0.1
    tag[c4d.PROTECTION_P_MAX_X] = 0.1
    tag[c4d.PROTECTION_P_Y] = True
    tag[c4d.PROTECTION_P_MIN_Y] = 0.1
    tag[c4d.PROTECTION_P_MAX_Y] = 0.1
    tag[c4d.PROTECTION_P_Z] = True
    tag[c4d.PROTECTION_P_MIN_Z] = 0.1
    tag[c4d.PROTECTION_P_MAX_Z] = 0.1
    tag[c4d.PROTECTION_S] = c4d.PROTECTION_NONE
    tag[c4d.PROTECTION_S_X] = True
    tag[c4d.PROTECTION_S_MIN_X] = 0.1
    tag[c4d.PROTECTION_S_MAX_X] = 0.1
    tag[c4d.PROTECTION_S_Y] = True
    tag[c4d.PROTECTION_S_MIN_Y] = 0.1
    tag[c4d.PROTECTION_S_MAX_Y] = 0.1
    tag[c4d.PROTECTION_S_Z] = True
    tag[c4d.PROTECTION_S_MIN_Z] = 0.1
    tag[c4d.PROTECTION_S_MAX_Z] = 0.1
    tag[c4d.PROTECTION_R] = c4d.PROTECTION_NONE
    tag[c4d.PROTECTION_R_X] = True
    tag[c4d.PROTECTION_R_MIN_X] = 0.1
    tag[c4d.PROTECTION_R_MAX_X] = 0.1
    tag[c4d.PROTECTION_R_Y] = True
    tag[c4d.PROTECTION_R_MIN_Y] = 0.1
    tag[c4d.PROTECTION_R_MAX_Y] = 0.1
    tag[c4d.PROTECTION_R_Z] = True
    tag[c4d.PROTECTION_R_MIN_Z] = 0.1
    tag[c4d.PROTECTION_R_MAX_Z] = 0.1
    tag[c4d.PROTECTION_ALLOW_EXPRESSIONS] = True
    tag[c4d.PROTECTION_ALLOW_DUPLICATION] = True
    
    #Second way, using the base container.
    bc = tag.GetDataInstance()
    bc.SetInt32(c4d.PROTECTION_P,c4d.PROTECTION_NONE)
    bc.SetBool(c4d.PROTECTION_P_X,True)
    bc.SetFloat(c4d.PROTECTION_P_MIN_X,0.1)
    bc.SetFloat(c4d.PROTECTION_P_MAX_X,0.1)
    bc.SetBool(c4d.PROTECTION_P_Y,True)
    bc.SetFloat(c4d.PROTECTION_P_MIN_Y,0.1)
    bc.SetFloat(c4d.PROTECTION_P_MAX_Y,0.1)
    bc.SetBool(c4d.PROTECTION_P_Z,True)
    bc.SetFloat(c4d.PROTECTION_P_MIN_Z,0.1)
    bc.SetFloat(c4d.PROTECTION_P_MAX_Z,0.1)
    bc.SetInt32(c4d.PROTECTION_S,c4d.PROTECTION_NONE)
    bc.SetBool(c4d.PROTECTION_S_X,True)
    bc.SetFloat(c4d.PROTECTION_S_MIN_X,0.1)
    bc.SetFloat(c4d.PROTECTION_S_MAX_X,0.1)
    bc.SetBool(c4d.PROTECTION_S_Y,True)
    bc.SetFloat(c4d.PROTECTION_S_MIN_Y,0.1)
    bc.SetFloat(c4d.PROTECTION_S_MAX_Y,0.1)
    bc.SetBool(c4d.PROTECTION_S_Z,True)
    bc.SetFloat(c4d.PROTECTION_S_MIN_Z,0.1)
    bc.SetFloat(c4d.PROTECTION_S_MAX_Z,0.1)
    bc.SetInt32(c4d.PROTECTION_R,c4d.PROTECTION_NONE)
    bc.SetBool(c4d.PROTECTION_R_X,True)
    bc.SetFloat(c4d.PROTECTION_R_MIN_X,0.1)
    bc.SetFloat(c4d.PROTECTION_R_MAX_X,0.1)
    bc.SetBool(c4d.PROTECTION_R_Y,True)
    bc.SetFloat(c4d.PROTECTION_R_MIN_Y,0.1)
    bc.SetFloat(c4d.PROTECTION_R_MAX_Y,0.1)
    bc.SetBool(c4d.PROTECTION_R_Z,True)
    bc.SetFloat(c4d.PROTECTION_R_MIN_Z,0.1)
    bc.SetFloat(c4d.PROTECTION_R_MAX_Z,0.1)
    bc.SetBool(c4d.PROTECTION_ALLOW_EXPRESSIONS,True)
    bc.SetBool(c4d.PROTECTION_ALLOW_DUPLICATION,True)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../c4dplugin/description/tprotection.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(Tprotection);
    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(PROTECTION_P),GeData(PROTECTION_NONE),flags);
    pTag->SetParameter(DescID(PROTECTION_P_X),GeData(true),flags);
    pTag->SetParameter(DescID(PROTECTION_P_MIN_X),GeData(0.1),flags);
    pTag->SetParameter(DescID(PROTECTION_P_MAX_X),GeData(0.1),flags);
    pTag->SetParameter(DescID(PROTECTION_P_Y),GeData(true),flags);
    pTag->SetParameter(DescID(PROTECTION_P_MIN_Y),GeData(0.1),flags);
    pTag->SetParameter(DescID(PROTECTION_P_MAX_Y),GeData(0.1),flags);
    pTag->SetParameter(DescID(PROTECTION_P_Z),GeData(true),flags);
    pTag->SetParameter(DescID(PROTECTION_P_MIN_Z),GeData(0.1),flags);
    pTag->SetParameter(DescID(PROTECTION_P_MAX_Z),GeData(0.1),flags);
    pTag->SetParameter(DescID(PROTECTION_S),GeData(PROTECTION_NONE),flags);
    pTag->SetParameter(DescID(PROTECTION_S_X),GeData(true),flags);
    pTag->SetParameter(DescID(PROTECTION_S_MIN_X),GeData(0.1),flags);
    pTag->SetParameter(DescID(PROTECTION_S_MAX_X),GeData(0.1),flags);
    pTag->SetParameter(DescID(PROTECTION_S_Y),GeData(true),flags);
    pTag->SetParameter(DescID(PROTECTION_S_MIN_Y),GeData(0.1),flags);
    pTag->SetParameter(DescID(PROTECTION_S_MAX_Y),GeData(0.1),flags);
    pTag->SetParameter(DescID(PROTECTION_S_Z),GeData(true),flags);
    pTag->SetParameter(DescID(PROTECTION_S_MIN_Z),GeData(0.1),flags);
    pTag->SetParameter(DescID(PROTECTION_S_MAX_Z),GeData(0.1),flags);
    pTag->SetParameter(DescID(PROTECTION_R),GeData(PROTECTION_NONE),flags);
    pTag->SetParameter(DescID(PROTECTION_R_X),GeData(true),flags);
    pTag->SetParameter(DescID(PROTECTION_R_MIN_X),GeData(0.1),flags);
    pTag->SetParameter(DescID(PROTECTION_R_MAX_X),GeData(0.1),flags);
    pTag->SetParameter(DescID(PROTECTION_R_Y),GeData(true),flags);
    pTag->SetParameter(DescID(PROTECTION_R_MIN_Y),GeData(0.1),flags);
    pTag->SetParameter(DescID(PROTECTION_R_MAX_Y),GeData(0.1),flags);
    pTag->SetParameter(DescID(PROTECTION_R_Z),GeData(true),flags);
    pTag->SetParameter(DescID(PROTECTION_R_MIN_Z),GeData(0.1),flags);
    pTag->SetParameter(DescID(PROTECTION_R_MAX_Z),GeData(0.1),flags);
    pTag->SetParameter(DescID(PROTECTION_ALLOW_EXPRESSIONS),GeData(true),flags);
    pTag->SetParameter(DescID(PROTECTION_ALLOW_DUPLICATION),GeData(true),flags);
    pTag->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pTag->GetDataInstance();
    bc->SetInt32(PROTECTION_P,PROTECTION_NONE);
    bc->SetBool(PROTECTION_P_X,true);
    bc->SetFloat(PROTECTION_P_MIN_X,0.1);
    bc->SetFloat(PROTECTION_P_MAX_X,0.1);
    bc->SetBool(PROTECTION_P_Y,true);
    bc->SetFloat(PROTECTION_P_MIN_Y,0.1);
    bc->SetFloat(PROTECTION_P_MAX_Y,0.1);
    bc->SetBool(PROTECTION_P_Z,true);
    bc->SetFloat(PROTECTION_P_MIN_Z,0.1);
    bc->SetFloat(PROTECTION_P_MAX_Z,0.1);
    bc->SetInt32(PROTECTION_S,PROTECTION_NONE);
    bc->SetBool(PROTECTION_S_X,true);
    bc->SetFloat(PROTECTION_S_MIN_X,0.1);
    bc->SetFloat(PROTECTION_S_MAX_X,0.1);
    bc->SetBool(PROTECTION_S_Y,true);
    bc->SetFloat(PROTECTION_S_MIN_Y,0.1);
    bc->SetFloat(PROTECTION_S_MAX_Y,0.1);
    bc->SetBool(PROTECTION_S_Z,true);
    bc->SetFloat(PROTECTION_S_MIN_Z,0.1);
    bc->SetFloat(PROTECTION_S_MAX_Z,0.1);
    bc->SetInt32(PROTECTION_R,PROTECTION_NONE);
    bc->SetBool(PROTECTION_R_X,true);
    bc->SetFloat(PROTECTION_R_MIN_X,0.1);
    bc->SetFloat(PROTECTION_R_MAX_X,0.1);
    bc->SetBool(PROTECTION_R_Y,true);
    bc->SetFloat(PROTECTION_R_MIN_Y,0.1);
    bc->SetFloat(PROTECTION_R_MAX_Y,0.1);
    bc->SetBool(PROTECTION_R_Z,true);
    bc->SetFloat(PROTECTION_R_MIN_Z,0.1);
    bc->SetFloat(PROTECTION_R_MAX_Z,0.1);
    bc->SetBool(PROTECTION_ALLOW_EXPRESSIONS,true);
    bc->SetBool(PROTECTION_ALLOW_DUPLICATION,true);
    pTag->Message(MSG_UPDATE);                                                      
}