Osplinecogwheel
Attributes
Elements
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.Osplinecogwheel)
doc.InsertObject(obj)
c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
#You can set parameters two different ways.
#First way
obj[c4d.PRIM_COGWHEEL_TEETH] = 1
obj[c4d.PRIM_COGWHEEL_LEGACY_MODE] = True
obj[c4d.PRIM_COGWHEEL_SHOW_GUIDES] = True
obj[c4d.PRIM_COGWHEEL_IRAD] = 0.1
obj[c4d.PRIM_COGWHEEL_MRAD] = 0.1
obj[c4d.PRIM_COGWHEEL_ORAD] = 0.1
obj[c4d.PRIM_COGWHEEL_BEVEL] = 0.1
obj[c4d.PRIM_COGWHEEL_TOOTH_TYPE] = c4d.PRIM_COGWHEEL_TOOTH_TYPE_NONE
obj[c4d.PRIM_COGWHEEL_TEETH2] = 1
obj[c4d.PRIM_COGWHEEL_LOCK_RADIUS_FOR_TEETH] = True
obj[c4d.PRIM_COGWHEEL_TEETH_ORIENTATION] = 0.1
obj[c4d.PRIM_COGWHEEL_UNDERCUT] = True
obj[c4d.PRIM_COGWHEEL_ROOT_RADIUS] = 0.1
obj[c4d.PRIM_COGWHEEL_ADDENDUM_RADIUS] = 0.1
obj[c4d.PRIM_COGWHEEL_PITCH_RADIUS] = 0.1
obj[c4d.PRIM_COGWHEEL_MODULE] = 0.1
obj[c4d.PRIM_COGWHEEL_DIAMETRAL_PITCH] = 0.1
obj[c4d.PRIM_COGWHEEL_DEDENDUM] = 0.1
obj[c4d.PRIM_COGWHEEL_PRESSURE_ANGLE] = 0.1
obj[c4d.PRIM_COGWHEEL_RADIAL_RATIO] = 0.1
obj[c4d.PRIM_COGWHEEL_WITNESS_RATIO] = 0.1
obj[c4d.PRIM_COGWHEEL_UNDERCUT_RATIO] = 0.1
obj[c4d.PRIM_COGWHEEL_INLAY_TYPE] = c4d.PRIM_COGWHEEL_INLAY_TYPE_NONE
obj[c4d.PRIM_COGWHEEL_INLAY_ORIENTATION] = 0.1
obj[c4d.PRIM_COGWHEEL_INLAY_INVERT] = True
obj[c4d.PRIM_COGWHEEL_HOLES_COUNT] = 1
obj[c4d.PRIM_COGWHEEL_HOLES_RADIUS] = 0.1
obj[c4d.PRIM_COGWHEEL_HOLES_DISTANCE] = 0.1
obj[c4d.PRIM_COGWHEEL_HOLES_ARC] = 0.1
obj[c4d.PRIM_COGWHEEL_SPOKES_COUNT] = 1
obj[c4d.PRIM_COGWHEEL_SPOKES_OUTER_RADIUS] = 0.1
obj[c4d.PRIM_COGWHEEL_SPOKES_INNER_RADIUS] = 0.1
obj[c4d.PRIM_COGWHEEL_SPOKES_OUTER_WIDTH] = 0.1
obj[c4d.PRIM_COGWHEEL_SPOKES_INNER_WIDTH] = 0.1
obj[c4d.PRIM_COGWHEEL_SPOKES_BEVEL] = 0.1
obj[c4d.PRIM_COGWHEEL_ARCHES_COUNT] = 1
obj[c4d.PRIM_COGWHEEL_ARCHES_OUTER_RADIUS] = 0.1
obj[c4d.PRIM_COGWHEEL_ARCHES_INNER_RADIUS] = 0.1
obj[c4d.PRIM_COGWHEEL_ARCHES_ARC_FRACTION] = 0.1
obj[c4d.PRIM_COGWHEEL_ARCHES_STRETCH] = 0.1
obj[c4d.PRIM_COGWHEEL_WAVES_COUNT] = 1
obj[c4d.PRIM_COGWHEEL_WAVES_OUTER_RADIUS] = 0.1
obj[c4d.PRIM_COGWHEEL_WAVES_INNER_RADIUS] = 0.1
obj[c4d.PRIM_COGWHEEL_WAVES_FREQUENCY] = 0.1
obj[c4d.PRIM_COGWHEEL_WAVES_AMPLITUDE] = 0.1
obj[c4d.PRIM_COGWHEEL_WAVES_PHASE] = 0.1
obj[c4d.PRIM_COGWHEEL_WAVES_WIDTH] = 0.1
obj[c4d.PRIM_COGWHEEL_CENTER_HOLE] = True
obj[c4d.PRIM_COGWHEEL_CENTER_HOLE_RADIUS] = 0.1
obj[c4d.PRIM_COGWHEEL_CUTOUT] = True
obj[c4d.PRIM_COGWHEEL_CUTOUT_DEPTH] = 0.1
obj[c4d.PRIM_COGWHEEL_CUTOUT_WIDTH] = 0.1
obj[c4d.PRIM_COGWHEEL_CUTOUT_ORIENTATION] = 0.1
#Second way, using the base container.
bc = obj.GetDataInstance()
bc.SetInt32(c4d.PRIM_COGWHEEL_TEETH,1)
bc.SetBool(c4d.PRIM_COGWHEEL_LEGACY_MODE,True)
bc.SetBool(c4d.PRIM_COGWHEEL_SHOW_GUIDES,True)
bc.SetFloat(c4d.PRIM_COGWHEEL_IRAD,0.1)
bc.SetFloat(c4d.PRIM_COGWHEEL_MRAD,0.1)
bc.SetFloat(c4d.PRIM_COGWHEEL_ORAD,0.1)
bc.SetFloat(c4d.PRIM_COGWHEEL_BEVEL,0.1)
bc.SetInt32(c4d.PRIM_COGWHEEL_TOOTH_TYPE,c4d.PRIM_COGWHEEL_TOOTH_TYPE_NONE)
bc.SetInt32(c4d.PRIM_COGWHEEL_TEETH2,1)
bc.SetBool(c4d.PRIM_COGWHEEL_LOCK_RADIUS_FOR_TEETH,True)
bc.SetFloat(c4d.PRIM_COGWHEEL_TEETH_ORIENTATION,0.1)
bc.SetBool(c4d.PRIM_COGWHEEL_UNDERCUT,True)
bc.SetFloat(c4d.PRIM_COGWHEEL_ROOT_RADIUS,0.1)
bc.SetFloat(c4d.PRIM_COGWHEEL_ADDENDUM_RADIUS,0.1)
bc.SetFloat(c4d.PRIM_COGWHEEL_PITCH_RADIUS,0.1)
bc.SetFloat(c4d.PRIM_COGWHEEL_MODULE,0.1)
bc.SetFloat(c4d.PRIM_COGWHEEL_DIAMETRAL_PITCH,0.1)
bc.SetFloat(c4d.PRIM_COGWHEEL_DEDENDUM,0.1)
bc.SetFloat(c4d.PRIM_COGWHEEL_PRESSURE_ANGLE,0.1)
bc.SetFloat(c4d.PRIM_COGWHEEL_RADIAL_RATIO,0.1)
bc.SetFloat(c4d.PRIM_COGWHEEL_WITNESS_RATIO,0.1)
bc.SetFloat(c4d.PRIM_COGWHEEL_UNDERCUT_RATIO,0.1)
bc.SetInt32(c4d.PRIM_COGWHEEL_INLAY_TYPE,c4d.PRIM_COGWHEEL_INLAY_TYPE_NONE)
bc.SetFloat(c4d.PRIM_COGWHEEL_INLAY_ORIENTATION,0.1)
bc.SetBool(c4d.PRIM_COGWHEEL_INLAY_INVERT,True)
bc.SetInt32(c4d.PRIM_COGWHEEL_HOLES_COUNT,1)
bc.SetFloat(c4d.PRIM_COGWHEEL_HOLES_RADIUS,0.1)
bc.SetFloat(c4d.PRIM_COGWHEEL_HOLES_DISTANCE,0.1)
bc.SetFloat(c4d.PRIM_COGWHEEL_HOLES_ARC,0.1)
bc.SetInt32(c4d.PRIM_COGWHEEL_SPOKES_COUNT,1)
bc.SetFloat(c4d.PRIM_COGWHEEL_SPOKES_OUTER_RADIUS,0.1)
bc.SetFloat(c4d.PRIM_COGWHEEL_SPOKES_INNER_RADIUS,0.1)
bc.SetFloat(c4d.PRIM_COGWHEEL_SPOKES_OUTER_WIDTH,0.1)
bc.SetFloat(c4d.PRIM_COGWHEEL_SPOKES_INNER_WIDTH,0.1)
bc.SetFloat(c4d.PRIM_COGWHEEL_SPOKES_BEVEL,0.1)
bc.SetInt32(c4d.PRIM_COGWHEEL_ARCHES_COUNT,1)
bc.SetFloat(c4d.PRIM_COGWHEEL_ARCHES_OUTER_RADIUS,0.1)
bc.SetFloat(c4d.PRIM_COGWHEEL_ARCHES_INNER_RADIUS,0.1)
bc.SetFloat(c4d.PRIM_COGWHEEL_ARCHES_ARC_FRACTION,0.1)
bc.SetFloat(c4d.PRIM_COGWHEEL_ARCHES_STRETCH,0.1)
bc.SetInt32(c4d.PRIM_COGWHEEL_WAVES_COUNT,1)
bc.SetFloat(c4d.PRIM_COGWHEEL_WAVES_OUTER_RADIUS,0.1)
bc.SetFloat(c4d.PRIM_COGWHEEL_WAVES_INNER_RADIUS,0.1)
bc.SetFloat(c4d.PRIM_COGWHEEL_WAVES_FREQUENCY,0.1)
bc.SetFloat(c4d.PRIM_COGWHEEL_WAVES_AMPLITUDE,0.1)
bc.SetFloat(c4d.PRIM_COGWHEEL_WAVES_PHASE,0.1)
bc.SetFloat(c4d.PRIM_COGWHEEL_WAVES_WIDTH,0.1)
bc.SetBool(c4d.PRIM_COGWHEEL_CENTER_HOLE,True)
bc.SetFloat(c4d.PRIM_COGWHEEL_CENTER_HOLE_RADIUS,0.1)
bc.SetBool(c4d.PRIM_COGWHEEL_CUTOUT,True)
bc.SetFloat(c4d.PRIM_COGWHEEL_CUTOUT_DEPTH,0.1)
bc.SetFloat(c4d.PRIM_COGWHEEL_CUTOUT_WIDTH,0.1)
bc.SetFloat(c4d.PRIM_COGWHEEL_CUTOUT_ORIENTATION,0.1)
if __name__=='__main__':
main()
C++
#include "c4d.h"
#include "../objects/description/osplinecogwheel.h"
void SampleFunction()
{
BaseDocument *pDoc = GetActiveDocument();
BaseObject *pObject = BaseObject::Alloc(Osplinecogwheel);
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(PRIM_COGWHEEL_TEETH),GeData(1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_LEGACY_MODE),GeData(true),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_SHOW_GUIDES),GeData(true),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_IRAD),GeData(0.1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_MRAD),GeData(0.1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_ORAD),GeData(0.1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_BEVEL),GeData(0.1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_TOOTH_TYPE),GeData(PRIM_COGWHEEL_TOOTH_TYPE_NONE),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_TEETH2),GeData(1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_LOCK_RADIUS_FOR_TEETH),GeData(true),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_TEETH_ORIENTATION),GeData(0.1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_UNDERCUT),GeData(true),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_ROOT_RADIUS),GeData(0.1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_ADDENDUM_RADIUS),GeData(0.1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_PITCH_RADIUS),GeData(0.1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_MODULE),GeData(0.1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_DIAMETRAL_PITCH),GeData(0.1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_DEDENDUM),GeData(0.1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_PRESSURE_ANGLE),GeData(0.1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_RADIAL_RATIO),GeData(0.1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_WITNESS_RATIO),GeData(0.1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_UNDERCUT_RATIO),GeData(0.1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_INLAY_TYPE),GeData(PRIM_COGWHEEL_INLAY_TYPE_NONE),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_INLAY_ORIENTATION),GeData(0.1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_INLAY_INVERT),GeData(true),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_HOLES_COUNT),GeData(1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_HOLES_RADIUS),GeData(0.1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_HOLES_DISTANCE),GeData(0.1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_HOLES_ARC),GeData(0.1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_SPOKES_COUNT),GeData(1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_SPOKES_OUTER_RADIUS),GeData(0.1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_SPOKES_INNER_RADIUS),GeData(0.1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_SPOKES_OUTER_WIDTH),GeData(0.1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_SPOKES_INNER_WIDTH),GeData(0.1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_SPOKES_BEVEL),GeData(0.1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_ARCHES_COUNT),GeData(1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_ARCHES_OUTER_RADIUS),GeData(0.1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_ARCHES_INNER_RADIUS),GeData(0.1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_ARCHES_ARC_FRACTION),GeData(0.1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_ARCHES_STRETCH),GeData(0.1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_WAVES_COUNT),GeData(1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_WAVES_OUTER_RADIUS),GeData(0.1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_WAVES_INNER_RADIUS),GeData(0.1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_WAVES_FREQUENCY),GeData(0.1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_WAVES_AMPLITUDE),GeData(0.1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_WAVES_PHASE),GeData(0.1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_WAVES_WIDTH),GeData(0.1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_CENTER_HOLE),GeData(true),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_CENTER_HOLE_RADIUS),GeData(0.1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_CUTOUT),GeData(true),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_CUTOUT_DEPTH),GeData(0.1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_CUTOUT_WIDTH),GeData(0.1),flags);
pObject->SetParameter(DescID(PRIM_COGWHEEL_CUTOUT_ORIENTATION),GeData(0.1),flags);
pObject->Message(MSG_UPDATE);
//Second way, using the base container.
BaseContainer *bc = pObject->GetDataInstance();
bc->SetInt32(PRIM_COGWHEEL_TEETH,1);
bc->SetBool(PRIM_COGWHEEL_LEGACY_MODE,true);
bc->SetBool(PRIM_COGWHEEL_SHOW_GUIDES,true);
bc->SetFloat(PRIM_COGWHEEL_IRAD,0.1);
bc->SetFloat(PRIM_COGWHEEL_MRAD,0.1);
bc->SetFloat(PRIM_COGWHEEL_ORAD,0.1);
bc->SetFloat(PRIM_COGWHEEL_BEVEL,0.1);
bc->SetInt32(PRIM_COGWHEEL_TOOTH_TYPE,PRIM_COGWHEEL_TOOTH_TYPE_NONE);
bc->SetInt32(PRIM_COGWHEEL_TEETH2,1);
bc->SetBool(PRIM_COGWHEEL_LOCK_RADIUS_FOR_TEETH,true);
bc->SetFloat(PRIM_COGWHEEL_TEETH_ORIENTATION,0.1);
bc->SetBool(PRIM_COGWHEEL_UNDERCUT,true);
bc->SetFloat(PRIM_COGWHEEL_ROOT_RADIUS,0.1);
bc->SetFloat(PRIM_COGWHEEL_ADDENDUM_RADIUS,0.1);
bc->SetFloat(PRIM_COGWHEEL_PITCH_RADIUS,0.1);
bc->SetFloat(PRIM_COGWHEEL_MODULE,0.1);
bc->SetFloat(PRIM_COGWHEEL_DIAMETRAL_PITCH,0.1);
bc->SetFloat(PRIM_COGWHEEL_DEDENDUM,0.1);
bc->SetFloat(PRIM_COGWHEEL_PRESSURE_ANGLE,0.1);
bc->SetFloat(PRIM_COGWHEEL_RADIAL_RATIO,0.1);
bc->SetFloat(PRIM_COGWHEEL_WITNESS_RATIO,0.1);
bc->SetFloat(PRIM_COGWHEEL_UNDERCUT_RATIO,0.1);
bc->SetInt32(PRIM_COGWHEEL_INLAY_TYPE,PRIM_COGWHEEL_INLAY_TYPE_NONE);
bc->SetFloat(PRIM_COGWHEEL_INLAY_ORIENTATION,0.1);
bc->SetBool(PRIM_COGWHEEL_INLAY_INVERT,true);
bc->SetInt32(PRIM_COGWHEEL_HOLES_COUNT,1);
bc->SetFloat(PRIM_COGWHEEL_HOLES_RADIUS,0.1);
bc->SetFloat(PRIM_COGWHEEL_HOLES_DISTANCE,0.1);
bc->SetFloat(PRIM_COGWHEEL_HOLES_ARC,0.1);
bc->SetInt32(PRIM_COGWHEEL_SPOKES_COUNT,1);
bc->SetFloat(PRIM_COGWHEEL_SPOKES_OUTER_RADIUS,0.1);
bc->SetFloat(PRIM_COGWHEEL_SPOKES_INNER_RADIUS,0.1);
bc->SetFloat(PRIM_COGWHEEL_SPOKES_OUTER_WIDTH,0.1);
bc->SetFloat(PRIM_COGWHEEL_SPOKES_INNER_WIDTH,0.1);
bc->SetFloat(PRIM_COGWHEEL_SPOKES_BEVEL,0.1);
bc->SetInt32(PRIM_COGWHEEL_ARCHES_COUNT,1);
bc->SetFloat(PRIM_COGWHEEL_ARCHES_OUTER_RADIUS,0.1);
bc->SetFloat(PRIM_COGWHEEL_ARCHES_INNER_RADIUS,0.1);
bc->SetFloat(PRIM_COGWHEEL_ARCHES_ARC_FRACTION,0.1);
bc->SetFloat(PRIM_COGWHEEL_ARCHES_STRETCH,0.1);
bc->SetInt32(PRIM_COGWHEEL_WAVES_COUNT,1);
bc->SetFloat(PRIM_COGWHEEL_WAVES_OUTER_RADIUS,0.1);
bc->SetFloat(PRIM_COGWHEEL_WAVES_INNER_RADIUS,0.1);
bc->SetFloat(PRIM_COGWHEEL_WAVES_FREQUENCY,0.1);
bc->SetFloat(PRIM_COGWHEEL_WAVES_AMPLITUDE,0.1);
bc->SetFloat(PRIM_COGWHEEL_WAVES_PHASE,0.1);
bc->SetFloat(PRIM_COGWHEEL_WAVES_WIDTH,0.1);
bc->SetBool(PRIM_COGWHEEL_CENTER_HOLE,true);
bc->SetFloat(PRIM_COGWHEEL_CENTER_HOLE_RADIUS,0.1);
bc->SetBool(PRIM_COGWHEEL_CUTOUT,true);
bc->SetFloat(PRIM_COGWHEEL_CUTOUT_DEPTH,0.1);
bc->SetFloat(PRIM_COGWHEEL_CUTOUT_WIDTH,0.1);
bc->SetFloat(PRIM_COGWHEEL_CUTOUT_ORIENTATION,0.1);
pObject->Message(MSG_UPDATE);
}