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 Oxref

Oxref

Attributes

  • ENGLISH NAME : XRef
  • NAME : Oxref
  • INCLUDE : Obase
  • PATH : ca/description/oxref.res
  • PLUGIN : ca
  • MAXON online help (may not exist): OXREF

Elements

ID UI Name Type Parameters Cycle
ID_CA_XREF_SHOWOBJECTS ShowObjects BOOL ANIM
ID_CA_XREF_LOADED Loaded BOOL ANIM
ID_CA_XREF_GENERATOR Generator BOOL ANIM
ID_CA_XREF_FILE Reference FILENAME
NOSELECT
SCALE_H
ANIM OFF
ID_CA_XREF_FILE_SELECT ... BUTTON  
ID_CA_XREF_PROXY_FILE ProxyRef FILENAME
NOSELECT
SCALE_H
ANIM OFF
ID_CA_XREF_PROXY_FILE_SELECT ... BUTTON  
ID_CA_XREF_NAMESPACE Namespace STRING ANIM
ID_CA_XREF_ANIMATE Animation BOOL ANIM
ID_CA_XREF_TIME Frame BASETIME ANIM
ID_CA_XREF_OFFSET Offset BASETIME ANIM
ID_CA_XREF_SCALE Scale REAL
ANIM OFF
STEP 0.1
ID_CA_XREF_PIVOT_POS Position VECTOR
UNIT METER
CUSTOMGUI SUBDESCRIPTION
ANIM OFF
ID_CA_XREF_PIVOT_SCL Scale VECTOR
STEP 0.01
CUSTOMGUI SUBDESCRIPTION
ANIM OFF
ID_CA_XREF_PIVOT_ROT Rotation VECTOR
UNIT DEGREE
CUSTOMGUI SUBDESCRIPTION
ANIM OFF
ID_CA_XREF_SWAP Swap BUTTON SCALE_H
ID_CA_XREF_REFRESH Reload BUTTON SCALE_H
ID_CA_XREF_EDIT OpenforEdit BUTTON SCALE_H
ID_CA_XREF_OPTIONS Options... 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.Oxref)
    doc.InsertObject(obj)
    c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
    
    #You can set parameters two different ways. 
    #First way              
    obj[c4d.ID_CA_XREF_SHOWOBJECTS] = True
    obj[c4d.ID_CA_XREF_LOADED] = True
    obj[c4d.ID_CA_XREF_GENERATOR] = True
    obj[c4d.ID_CA_XREF_FILE] = "c:\\SomeFile.txt"
    obj[c4d.ID_CA_XREF_PROXY_FILE] = "c:\\SomeFile.txt"
    obj[c4d.ID_CA_XREF_NAMESPACE] = "Hello World"
    obj[c4d.ID_CA_XREF_ANIMATE] = True
    obj[c4d.ID_CA_XREF_SCALE] = 0.1
    obj[c4d.ID_CA_XREF_PIVOT_POS] = c4d.Vector(1.0,1.0,1.0)
    obj[c4d.ID_CA_XREF_PIVOT_SCL] = c4d.Vector(1.0,1.0,1.0)
    obj[c4d.ID_CA_XREF_PIVOT_ROT] = c4d.Vector(1.0,1.0,1.0)
    
    #Second way, using the base container.
    bc = obj.GetDataInstance()
    bc.SetBool(c4d.ID_CA_XREF_SHOWOBJECTS,True)
    bc.SetBool(c4d.ID_CA_XREF_LOADED,True)
    bc.SetBool(c4d.ID_CA_XREF_GENERATOR,True)
    bc.SetFileName(c4d.ID_CA_XREF_FILE,"c:\\SomeFile.txt")
    bc.SetFileName(c4d.ID_CA_XREF_PROXY_FILE,"c:\\SomeFile.txt")
    bc.SetString(c4d.ID_CA_XREF_NAMESPACE,"Hello World")
    bc.SetBool(c4d.ID_CA_XREF_ANIMATE,True)
    bc.SetFloat(c4d.ID_CA_XREF_SCALE,0.1)
    bc.SetVector(c4d.ID_CA_XREF_PIVOT_POS, c4d.Vector(1.0,1.0,1.0)
    bc.SetVector(c4d.ID_CA_XREF_PIVOT_SCL, c4d.Vector(1.0,1.0,1.0)
    bc.SetVector(c4d.ID_CA_XREF_PIVOT_ROT, c4d.Vector(1.0,1.0,1.0)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../ca/description/oxref.h"
void SampleFunction()
{
    BaseDocument *pDoc = GetActiveDocument();
    BaseObject *pObject = BaseObject::Alloc(Oxref);
    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(ID_CA_XREF_SHOWOBJECTS),GeData(true),flags);
    pObject->SetParameter(DescID(ID_CA_XREF_LOADED),GeData(true),flags);
    pObject->SetParameter(DescID(ID_CA_XREF_GENERATOR),GeData(true),flags);
    pObject->SetParameter(DescID(ID_CA_XREF_FILE),GeData(Filename("c:\\SomeFile.txt"),flags);
    pObject->SetParameter(DescID(ID_CA_XREF_PROXY_FILE),GeData(Filename("c:\\SomeFile.txt"),flags);
    pObject->SetParameter(DescID(ID_CA_XREF_NAMESPACE),GeData("Hello World"),flags);
    pObject->SetParameter(DescID(ID_CA_XREF_ANIMATE),GeData(true),flags);
    pObject->SetParameter(DescID(ID_CA_XREF_SCALE),GeData(0.1),flags);
    pObject->SetParameter(DescID(ID_CA_XREF_PIVOT_POS),GeData(Vector(1.0,1.0,1.0)),flags);
    pObject->SetParameter(DescID(ID_CA_XREF_PIVOT_SCL),GeData(Vector(1.0,1.0,1.0)),flags);
    pObject->SetParameter(DescID(ID_CA_XREF_PIVOT_ROT),GeData(Vector(1.0,1.0,1.0)),flags);
    pObject->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pObject->GetDataInstance();
    bc->SetBool(ID_CA_XREF_SHOWOBJECTS,true);
    bc->SetBool(ID_CA_XREF_LOADED,true);
    bc->SetBool(ID_CA_XREF_GENERATOR,true);
    bc->SetFileName(ID_CA_XREF_FILE,"c:\\SomeFile.txt");
    bc->SetFileName(ID_CA_XREF_PROXY_FILE,"c:\\SomeFile.txt");
    bc->SetString(ID_CA_XREF_NAMESPACE,"Hello World");
    bc->SetBool(ID_CA_XREF_ANIMATE,true);
    bc->SetFloat(ID_CA_XREF_SCALE,0.1);
    bc->SetVector(ID_CA_XREF_PIVOT_POS, c4d.Vector(1.0,1.0,1.0);
    bc->SetVector(ID_CA_XREF_PIVOT_SCL, c4d.Vector(1.0,1.0,1.0);
    bc->SetVector(ID_CA_XREF_PIVOT_ROT, c4d.Vector(1.0,1.0,1.0);
    pObject->Message(MSG_UPDATE);                                                      
}
             

Buttons

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

Python

c4d.CallButton(obj,c4d.ID_CA_XREF_FILE_SELECT)
c4d.CallButton(obj,c4d.ID_CA_XREF_PROXY_FILE_SELECT)
c4d.CallButton(obj,c4d.ID_CA_XREF_SWAP)
c4d.CallButton(obj,c4d.ID_CA_XREF_REFRESH)
c4d.CallButton(obj,c4d.ID_CA_XREF_EDIT)
c4d.CallButton(obj,c4d.ID_CA_XREF_OPTIONS)

C++

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

DescriptionCommand dc; dc.id = DescID(ID_CA_XREF_PROXY_FILE_SELECT); pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc; dc.id = DescID(ID_CA_XREF_SWAP); pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc; dc.id = DescID(ID_CA_XREF_REFRESH); pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc; dc.id = DescID(ID_CA_XREF_EDIT); pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc; dc.id = DescID(ID_CA_XREF_OPTIONS); pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);