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 Osceneinstance

Osceneinstance

Attributes

  • ENGLISH NAME : XReflegacy
  • NAME : Osceneinstance
  • INCLUDE : Obase
  • PATH : objects/description/osceneinstance.res
  • PLUGIN : objects
  • MAXON online help (may not exist): OSCENEINSTANCE

Elements

ID UI Name Type Parameters Cycle
SCENEINSTANCE_FILENAME Filename FILENAME  
SCENEINSTANCE_STARTTIME ProjectTime BASETIME  
SCENEINSTANCE_EDITSCENE EditProject BUTTON FIT_H
SCENEINSTANCE_RELOADSCENE ReloadProject BUTTON FIT_H
SCENEINSTANCE_ANIMATE TakeAnimation BUTTON FIT_H
SCENEINSTANCE_RELOADALLSCENES ReloadAll BUTTON FIT_H
SCENEINSTANCE_OBJECTS_PIVOT_POS PivotPos VECTOR
UNIT METER
CUSTOMGUI SUBDESCRIPTION
SCENEINSTANCE_OBJECTS_PIVOT_SCL PivotScale VECTOR
STEP 0.01
CUSTOMGUI SUBDESCRIPTION
SCENEINSTANCE_OBJECTS_PIVOT_ROT PivotRotation VECTOR
UNIT DEGREE
CUSTOMGUI SUBDESCRIPTION
SCENEINSTANCE_OBJECTS_PIVOT PivotMatrix MATRIX HIDDEN
SCENEINSTANCE_OBJECTS_MODE ByDefault LONG  
SCENEINSTANCE_OBJECTS_MODE_INCLUDE Include
SCENEINSTANCE_OBJECTS_MODE_EXCLUDE Exclude
SCENEINSTANCE_OBJECTS XRefObjects LISTHEAD SCALE_V
SCENEINSTANCE_MATERIALS XRefMaterials LISTHEAD SCALE_V

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.Osceneinstance)
    doc.InsertObject(obj)
    c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
    
    #You can set parameters two different ways. 
    #First way              
    obj[c4d.SCENEINSTANCE_FILENAME] = "c:\\SomeFile.txt"
    obj[c4d.SCENEINSTANCE_OBJECTS_PIVOT_POS] = c4d.Vector(1.0,1.0,1.0)
    obj[c4d.SCENEINSTANCE_OBJECTS_PIVOT_SCL] = c4d.Vector(1.0,1.0,1.0)
    obj[c4d.SCENEINSTANCE_OBJECTS_PIVOT_ROT] = c4d.Vector(1.0,1.0,1.0)
    obj[c4d.SCENEINSTANCE_OBJECTS_MODE] = c4d.SCENEINSTANCE_OBJECTS_MODE_INCLUDE
    
    #Second way, using the base container.
    bc = obj.GetDataInstance()
    bc.SetFileName(c4d.SCENEINSTANCE_FILENAME,"c:\\SomeFile.txt")
    bc.SetVector(c4d.SCENEINSTANCE_OBJECTS_PIVOT_POS, c4d.Vector(1.0,1.0,1.0)
    bc.SetVector(c4d.SCENEINSTANCE_OBJECTS_PIVOT_SCL, c4d.Vector(1.0,1.0,1.0)
    bc.SetVector(c4d.SCENEINSTANCE_OBJECTS_PIVOT_ROT, c4d.Vector(1.0,1.0,1.0)
    bc.SetInt32(c4d.SCENEINSTANCE_OBJECTS_MODE,c4d.SCENEINSTANCE_OBJECTS_MODE_INCLUDE)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../objects/description/osceneinstance.h"
void SampleFunction()
{
    BaseDocument *pDoc = GetActiveDocument();
    BaseObject *pObject = BaseObject::Alloc(Osceneinstance);
    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(SCENEINSTANCE_FILENAME),GeData(Filename("c:\\SomeFile.txt"),flags);
    pObject->SetParameter(DescID(SCENEINSTANCE_OBJECTS_PIVOT_POS),GeData(Vector(1.0,1.0,1.0)),flags);
    pObject->SetParameter(DescID(SCENEINSTANCE_OBJECTS_PIVOT_SCL),GeData(Vector(1.0,1.0,1.0)),flags);
    pObject->SetParameter(DescID(SCENEINSTANCE_OBJECTS_PIVOT_ROT),GeData(Vector(1.0,1.0,1.0)),flags);
    pObject->SetParameter(DescID(SCENEINSTANCE_OBJECTS_MODE),GeData(SCENEINSTANCE_OBJECTS_MODE_INCLUDE),flags);
    pObject->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pObject->GetDataInstance();
    bc->SetFileName(SCENEINSTANCE_FILENAME,"c:\\SomeFile.txt");
    bc->SetVector(SCENEINSTANCE_OBJECTS_PIVOT_POS, c4d.Vector(1.0,1.0,1.0);
    bc->SetVector(SCENEINSTANCE_OBJECTS_PIVOT_SCL, c4d.Vector(1.0,1.0,1.0);
    bc->SetVector(SCENEINSTANCE_OBJECTS_PIVOT_ROT, c4d.Vector(1.0,1.0,1.0);
    bc->SetInt32(SCENEINSTANCE_OBJECTS_MODE,SCENEINSTANCE_OBJECTS_MODE_INCLUDE);
    pObject->Message(MSG_UPDATE);                                                      
}
             

Buttons

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

Python

c4d.CallButton(obj,c4d.SCENEINSTANCE_EDITSCENE)
c4d.CallButton(obj,c4d.SCENEINSTANCE_RELOADSCENE)
c4d.CallButton(obj,c4d.SCENEINSTANCE_ANIMATE)
c4d.CallButton(obj,c4d.SCENEINSTANCE_RELOADALLSCENES)

C++

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

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