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 Oxsubbranch

Oxsubbranch

Attributes

  • ENGLISH NAME : X-ParticlesSub-BranchObject
  • NAME : Oxsubbranch
  • INCLUDE : Obase
  • PATH : res/description/oxsubbranch.res
  • PLUGIN : X-Particles
  • MAXON online help (may not exist): OXSUBBRANCH

Elements

ID UI Name Type Parameters Cycle
XSUBBRANCH_STEM_LENGTH_MODE LengthMethod LONG SCALE_H
SUB_STEM_LENGTH_MODE_FRAMES Time
SUB_STEM_LENGTH_MODE_ACTUAL DistanceUnits
XSUBBRANCH_STEM_MAXLENGTH_MAX Max.Length BASETIME SCALE_H
XSUBBRANCH_STEM_MAXLENGTH_MIN Min.Length BASETIME SCALE_H
XSUBBRANCH_STEM_MAXLENGTH_MAX_ACTUAL Max.Length REAL
SCALE_H
UNIT METER
MIN 0.0
MINSLIDER 0.0
MAXSLIDER 1000.0
CUSTOMGUI REALSLIDER
XSUBBRANCH_STEM_MAXLENGTH_MIN_ACTUAL Min.Length REAL
SCALE_H
UNIT METER
MIN 0.0
MINSLIDER 0.0
MAXSLIDER 1000.0
CUSTOMGUI REALSLIDER
XSUBBRANCH_STEM_BENDMODE BendingMode LONG SCALE_H
SUB_STEM_BENDMODE_NATURAL Natural
SUB_STEM_BENDMODE_ZIGZAG Zigzag
XSUBBRANCH_STEM_DEV_COUNTER BendIn BASETIME SCALE_H
XSUBBRANCH_STEM_DEV_COUNTER_VAR Variation BASETIME SCALE_H
XSUBBRANCH_STEM_BENDVECMAX Max.BendDeviation REAL
SCALE_H
UNIT DEGREE
MIN 0.0
MAX 90.0
STEP 1.0
MINSLIDER 0.0
MAXSLIDER 90.0
CUSTOMGUI REALSLIDER
XSUBBRANCH_STEM_BENDVECMIN Min.BendDeviation REAL
SCALE_H
UNIT DEGREE
MIN 0.0
MAX 90.0
STEP 1.0
MINSLIDER 0.0
MAXSLIDER 90.0
CUSTOMGUI REALSLIDER
XSUBBRANCH_BRANCH_XGROUP BranchGroup LINK  
XSUBBRANCH_BUTTON_ADD AddBranchObject BUTTON  
XSUBBRANCH_STEM_DOBRANCH EnableBranching BOOL  
XSUBBRANCH_STEM_BRANCH_COUNTER BranchIn BASETIME  
XSUBBRANCH_STEM_BRANCH_COUNTER_VAR Variation BASETIME  
XSUBBRANCH_STEM_FROMBASE BranchfromBase BOOL  
XSUBBRANCH_STEM_FROMTIP BranchfromTip BOOL  
XSUBBRANCH_STEM_NUMBRANCHES NumberofBranches LONG
MIN 0
MINSLIDER 0
MAXSLIDER 100
CUSTOMGUI LONGSLIDER
XSUBBRANCH_STEM_MAXSUBBRANCHES Max.Branches LONG
MIN 0
MINSLIDER 0
MAXSLIDER 1000
CUSTOMGUI LONGSLIDER
XSUBBRANCH_BRANCH_DEVIATION_MAX Max.BranchDeviation REAL
SCALE_H
UNIT DEGREE
MIN 0.0
MAX 90.0
MINSLIDER 0.0
MAXSLIDER 90.0
CUSTOMGUI REALSLIDER
XSUBBRANCH_BRANCH_DEVIATION_MIN Min.BranchDeviation REAL
SCALE_H
UNIT DEGREE
MIN 0.0
MAX 90.0
MINSLIDER 0.0
MAXSLIDER 90.0
CUSTOMGUI REALSLIDER
XSUBBRANCH_BRANCH_SPEEDMODE BranchSpeedMode LONG  
SUB_BRANCH_SPEEDMODE_ABS UseEmitterSpeed
SUB_BRANCH_SPEEDMODE_INHERIT SourceParticleSpeed
SUB_BRANCH_SPEEDMODE_SET SetSpeed
XSUBBRANCH_BRANCH_SPEED BranchSpeed REAL
UNIT METER
MIN 0.0
MINSLIDER 0.0
MAXSLIDER 1000.0
CUSTOMGUI REALSLIDER
XSUBBRANCH_BRANCH_DISTRIB Distribution SPLINE
Y_MIN 0.0
Y_MAX 1.0
X_MIN 0.0
X_MAX 1.0
X_STEPS 0.01
Y_STEPS 0.01
XSUBBRANCH_BRANCH_SCALE BranchLength SPLINE
Y_MIN 0.0
Y_MAX 1.0
X_MIN 0.0
X_MAX 1.0
X_STEPS 0.01
Y_STEPS 0.01
XSUBBRANCH_BRANCH_TWIST_TYPE RotationMode LONG  
SUB_TWIST_TYPE_RANDOM Random
SUB_TWIST_TYPE_SPLINE UseSpline
SUB_TWIST_TYPE_RANSPLINE RandomThenSpline
SUB_TWIST_TYPE_SET SetAngle
SUB_TWIST_TYPE_SETSPLINE SetAngleThenSpline
XSUBBRANCH_BRANCH_TWIST_ANGLE Angle REAL
UNIT DEGREE
MIN 0.0
MAX 360.0
MINSLIDER 0.0
MAXSLIDER 360.0
CUSTOMGUI REALSLIDER
XSUBBRANCH_BRANCH_TWIST_SPLINE Rotation SPLINE
Y_MIN 0
Y_MAX 360
X_MIN 0
X_MAX 1
X_STEPS 0.01
Y_STEPS 1
XSUBBRANCH_STEM_SPAWN EnableSpawning BOOL  
XSUBBRANCH_HELP_BUTTON BITMAPBUTTON  
XSUBBRANCH_BUTTON_RESET ResettoDefaults BUTTON  
XSUBBRANCH_BUTTON_SAVE_PRESET SavePreset... BUTTON  
XSUBBRANCH_BUTTON_LOAD_PRESET LoadPreset... BUTTON  

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.Oxsubbranch)
    doc.InsertObject(obj)
    c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
    
    #You can set parameters two different ways. 
    #First way              
    obj[c4d.XSUBBRANCH_STEM_LENGTH_MODE] = c4d.SUB_STEM_LENGTH_MODE_FRAMES
    obj[c4d.XSUBBRANCH_STEM_MAXLENGTH_MAX_ACTUAL] = 0.1
    obj[c4d.XSUBBRANCH_STEM_MAXLENGTH_MIN_ACTUAL] = 0.1
    obj[c4d.XSUBBRANCH_STEM_BENDMODE] = c4d.SUB_STEM_BENDMODE_NATURAL
    obj[c4d.XSUBBRANCH_STEM_BENDVECMAX] = 0.1
    obj[c4d.XSUBBRANCH_STEM_BENDVECMIN] = 0.1
    obj[c4d.XSUBBRANCH_STEM_DOBRANCH] = True
    obj[c4d.XSUBBRANCH_STEM_FROMBASE] = True
    obj[c4d.XSUBBRANCH_STEM_FROMTIP] = True
    obj[c4d.XSUBBRANCH_STEM_NUMBRANCHES] = 1
    obj[c4d.XSUBBRANCH_STEM_MAXSUBBRANCHES] = 1
    obj[c4d.XSUBBRANCH_BRANCH_DEVIATION_MAX] = 0.1
    obj[c4d.XSUBBRANCH_BRANCH_DEVIATION_MIN] = 0.1
    obj[c4d.XSUBBRANCH_BRANCH_SPEEDMODE] = c4d.SUB_BRANCH_SPEEDMODE_ABS
    obj[c4d.XSUBBRANCH_BRANCH_SPEED] = 0.1
    obj[c4d.XSUBBRANCH_BRANCH_TWIST_TYPE] = c4d.SUB_TWIST_TYPE_RANDOM
    obj[c4d.XSUBBRANCH_BRANCH_TWIST_ANGLE] = 0.1
    obj[c4d.XSUBBRANCH_STEM_SPAWN] = True
    
    #Second way, using the base container.
    bc = obj.GetDataInstance()
    bc.SetInt32(c4d.XSUBBRANCH_STEM_LENGTH_MODE,c4d.SUB_STEM_LENGTH_MODE_FRAMES)
    bc.SetFloat(c4d.XSUBBRANCH_STEM_MAXLENGTH_MAX_ACTUAL,0.1)
    bc.SetFloat(c4d.XSUBBRANCH_STEM_MAXLENGTH_MIN_ACTUAL,0.1)
    bc.SetInt32(c4d.XSUBBRANCH_STEM_BENDMODE,c4d.SUB_STEM_BENDMODE_NATURAL)
    bc.SetFloat(c4d.XSUBBRANCH_STEM_BENDVECMAX,0.1)
    bc.SetFloat(c4d.XSUBBRANCH_STEM_BENDVECMIN,0.1)
    bc.SetBool(c4d.XSUBBRANCH_STEM_DOBRANCH,True)
    bc.SetBool(c4d.XSUBBRANCH_STEM_FROMBASE,True)
    bc.SetBool(c4d.XSUBBRANCH_STEM_FROMTIP,True)
    bc.SetInt32(c4d.XSUBBRANCH_STEM_NUMBRANCHES,1)
    bc.SetInt32(c4d.XSUBBRANCH_STEM_MAXSUBBRANCHES,1)
    bc.SetFloat(c4d.XSUBBRANCH_BRANCH_DEVIATION_MAX,0.1)
    bc.SetFloat(c4d.XSUBBRANCH_BRANCH_DEVIATION_MIN,0.1)
    bc.SetInt32(c4d.XSUBBRANCH_BRANCH_SPEEDMODE,c4d.SUB_BRANCH_SPEEDMODE_ABS)
    bc.SetFloat(c4d.XSUBBRANCH_BRANCH_SPEED,0.1)
    bc.SetInt32(c4d.XSUBBRANCH_BRANCH_TWIST_TYPE,c4d.SUB_TWIST_TYPE_RANDOM)
    bc.SetFloat(c4d.XSUBBRANCH_BRANCH_TWIST_ANGLE,0.1)
    bc.SetBool(c4d.XSUBBRANCH_STEM_SPAWN,True)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../res/description/oxsubbranch.h"
void SampleFunction()
{
    BaseDocument *pDoc = GetActiveDocument();
    BaseObject *pObject = BaseObject::Alloc(Oxsubbranch);
    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(XSUBBRANCH_STEM_LENGTH_MODE),GeData(SUB_STEM_LENGTH_MODE_FRAMES),flags);
    pObject->SetParameter(DescID(XSUBBRANCH_STEM_MAXLENGTH_MAX_ACTUAL),GeData(0.1),flags);
    pObject->SetParameter(DescID(XSUBBRANCH_STEM_MAXLENGTH_MIN_ACTUAL),GeData(0.1),flags);
    pObject->SetParameter(DescID(XSUBBRANCH_STEM_BENDMODE),GeData(SUB_STEM_BENDMODE_NATURAL),flags);
    pObject->SetParameter(DescID(XSUBBRANCH_STEM_BENDVECMAX),GeData(0.1),flags);
    pObject->SetParameter(DescID(XSUBBRANCH_STEM_BENDVECMIN),GeData(0.1),flags);
    pObject->SetParameter(DescID(XSUBBRANCH_STEM_DOBRANCH),GeData(true),flags);
    pObject->SetParameter(DescID(XSUBBRANCH_STEM_FROMBASE),GeData(true),flags);
    pObject->SetParameter(DescID(XSUBBRANCH_STEM_FROMTIP),GeData(true),flags);
    pObject->SetParameter(DescID(XSUBBRANCH_STEM_NUMBRANCHES),GeData(1),flags);
    pObject->SetParameter(DescID(XSUBBRANCH_STEM_MAXSUBBRANCHES),GeData(1),flags);
    pObject->SetParameter(DescID(XSUBBRANCH_BRANCH_DEVIATION_MAX),GeData(0.1),flags);
    pObject->SetParameter(DescID(XSUBBRANCH_BRANCH_DEVIATION_MIN),GeData(0.1),flags);
    pObject->SetParameter(DescID(XSUBBRANCH_BRANCH_SPEEDMODE),GeData(SUB_BRANCH_SPEEDMODE_ABS),flags);
    pObject->SetParameter(DescID(XSUBBRANCH_BRANCH_SPEED),GeData(0.1),flags);
    pObject->SetParameter(DescID(XSUBBRANCH_BRANCH_TWIST_TYPE),GeData(SUB_TWIST_TYPE_RANDOM),flags);
    pObject->SetParameter(DescID(XSUBBRANCH_BRANCH_TWIST_ANGLE),GeData(0.1),flags);
    pObject->SetParameter(DescID(XSUBBRANCH_STEM_SPAWN),GeData(true),flags);
    pObject->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pObject->GetDataInstance();
    bc->SetInt32(XSUBBRANCH_STEM_LENGTH_MODE,SUB_STEM_LENGTH_MODE_FRAMES);
    bc->SetFloat(XSUBBRANCH_STEM_MAXLENGTH_MAX_ACTUAL,0.1);
    bc->SetFloat(XSUBBRANCH_STEM_MAXLENGTH_MIN_ACTUAL,0.1);
    bc->SetInt32(XSUBBRANCH_STEM_BENDMODE,SUB_STEM_BENDMODE_NATURAL);
    bc->SetFloat(XSUBBRANCH_STEM_BENDVECMAX,0.1);
    bc->SetFloat(XSUBBRANCH_STEM_BENDVECMIN,0.1);
    bc->SetBool(XSUBBRANCH_STEM_DOBRANCH,true);
    bc->SetBool(XSUBBRANCH_STEM_FROMBASE,true);
    bc->SetBool(XSUBBRANCH_STEM_FROMTIP,true);
    bc->SetInt32(XSUBBRANCH_STEM_NUMBRANCHES,1);
    bc->SetInt32(XSUBBRANCH_STEM_MAXSUBBRANCHES,1);
    bc->SetFloat(XSUBBRANCH_BRANCH_DEVIATION_MAX,0.1);
    bc->SetFloat(XSUBBRANCH_BRANCH_DEVIATION_MIN,0.1);
    bc->SetInt32(XSUBBRANCH_BRANCH_SPEEDMODE,SUB_BRANCH_SPEEDMODE_ABS);
    bc->SetFloat(XSUBBRANCH_BRANCH_SPEED,0.1);
    bc->SetInt32(XSUBBRANCH_BRANCH_TWIST_TYPE,SUB_TWIST_TYPE_RANDOM);
    bc->SetFloat(XSUBBRANCH_BRANCH_TWIST_ANGLE,0.1);
    bc->SetBool(XSUBBRANCH_STEM_SPAWN,true);
    pObject->Message(MSG_UPDATE);                                                      
}
             

Buttons

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

Python

c4d.CallButton(obj,c4d.XSUBBRANCH_BUTTON_ADD)
c4d.CallButton(obj,c4d.XSUBBRANCH_HELP_BUTTON)
c4d.CallButton(obj,c4d.XSUBBRANCH_BUTTON_RESET)
c4d.CallButton(obj,c4d.XSUBBRANCH_BUTTON_SAVE_PRESET)
c4d.CallButton(obj,c4d.XSUBBRANCH_BUTTON_LOAD_PRESET)

C++

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

DescriptionCommand dc; dc.id = DescID(XSUBBRANCH_HELP_BUTTON); pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc; dc.id = DescID(XSUBBRANCH_BUTTON_RESET); pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc; dc.id = DescID(XSUBBRANCH_BUTTON_SAVE_PRESET); pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc; dc.id = DescID(XSUBBRANCH_BUTTON_LOAD_PRESET); pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);