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 DynConstraintObject

DynConstraintObject

Attributes

Elements

ID UI Name Type Parameters Cycle
FORCE_TYPE LONG  
CONSTRAINT_JOINT_TYPE_HINGE Hinge
180000011
CONSTRAINT_JOINT_TYPE_CARDAN Cardan
180000161
CONSTRAINT_JOINT_TYPE_BALLSOCKET BallandSocket
180000162
CONSTRAINT_JOINT_TYPE_RAGDOLL Ragdoll
180000163
CONSTRAINT_JOINT_TYPE_SLIDER Slider
180000164
CONSTRAINT_JOINT_TYPE_ROT_SLIDER TwistSlider
180000165
CONSTRAINT_JOINT_TYPE_PLANAR Planar
180000166
CONSTRAINT_JOINT_TYPE_BOX Box
180000167
CONSTRAINT_JOINT_TYPE_WHEEL WheelSuspension
180000168
CONSTRAINT_JOINT_TYPE_FIXED Fixed
180000169
CONSTRAINT_IGNORE_COLLISIONS IgnoreCollisions BOOL  
CONSTRAINT_CONE_LIMIT_RADIUS ConeRadius REAL
UNIT DEGREE
MIN 0.1
MAX 89.9
CONSTRAINT_CONE_LIMIT_ELLIPTICAL Ellipse BOOL  
CONSTRAINT_CONE_LIMIT_RADIUS2 ConeRadiusY REAL
UNIT DEGREE
MIN 0.1
MAX 89.9
CONSTRAINT_WHEEL_ANGLE SteeringAngle REAL UNIT
CONSTRAINT_WHEEL_REST_POSITION SuspensionRestPosition REAL UNIT
CONSTRAINT_WHEEL_STIFFNESS SuspensionStiffness REAL MIN
CONSTRAINT_WHEEL_DAMPING SuspensionDamping REAL
MIN 0.0
UNIT PERCENT
STEP 1.0
CONSTRAINT_LIMIT_RESTITUTION Bounce REAL
MIN 0.0
UNIT PERCENT
CONSTRAINT_TRANS2_LIMIT_USE_MIN LowerLimitX BOOL  
CONSTRAINT_TRANS2_LIMIT_MIN From REAL UNIT
CONSTRAINT_TRANS2_LIMIT_USE_MAX UpperLimitX BOOL  
CONSTRAINT_TRANS2_LIMIT_MAX To REAL UNIT
CONSTRAINT_TRANS3_LIMIT_USE_MIN LowerLimitY BOOL  
CONSTRAINT_TRANS3_LIMIT_MIN From REAL UNIT
CONSTRAINT_TRANS3_LIMIT_USE_MAX UpperLimitY BOOL  
CONSTRAINT_TRANS3_LIMIT_MAX To REAL UNIT
CONSTRAINT_TRANS1_LIMIT_USE_MIN LowerLimitZ BOOL  
CONSTRAINT_TRANS1_LIMIT_MIN From REAL UNIT
CONSTRAINT_TRANS1_LIMIT_USE_MAX UpperLimitZ BOOL  
CONSTRAINT_TRANS1_LIMIT_MAX To REAL UNIT
CONSTRAINT_TRANS1_USE_BREAKING_FORCE BreakingForce BOOL  
CONSTRAINT_TRANS1_BREAKING_FORCE Force REAL
MIN 0.0
UNIT METER
CONSTRAINT_ROT1_LIMIT AngularLimit BOOL  
CONSTRAINT_ROT1_LIMIT_MIN From REAL UNIT
CONSTRAINT_ROT1_LIMIT_MAX To REAL UNIT
CONSTRAINT_ROT1_USE_BREAKING_TORQUE BreakingTorque BOOL  
CONSTRAINT_ROT1_BREAKING_TORQUE Torque REAL MIN
CONSTRAINT_ROT2_LIMIT AngularLimit2 BOOL  
CONSTRAINT_ROT2_LIMIT_MIN From REAL UNIT
CONSTRAINT_ROT2_LIMIT_MAX To REAL UNIT
CONSTRAINT_CACHE_LOCAL LocalCoordinates BOOL  
CONSTRAINT_CACHE_CLEAR ClearCache BUTTON  
CONSTRAINT_CACHE_USE UseCachedData 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.DynConstraintObject)
    doc.InsertObject(obj)
    c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
    
    #You can set parameters two different ways. 
    #First way              
    obj[c4d.FORCE_TYPE] = c4d.CONSTRAINT_JOINT_TYPE_HINGE
    obj[c4d.CONSTRAINT_IGNORE_COLLISIONS] = True
    obj[c4d.CONSTRAINT_CONE_LIMIT_RADIUS] = 0.1
    obj[c4d.CONSTRAINT_CONE_LIMIT_ELLIPTICAL] = True
    obj[c4d.CONSTRAINT_CONE_LIMIT_RADIUS2] = 0.1
    obj[c4d.CONSTRAINT_WHEEL_ANGLE] = 0.1
    obj[c4d.CONSTRAINT_WHEEL_REST_POSITION] = 0.1
    obj[c4d.CONSTRAINT_WHEEL_STIFFNESS] = 0.1
    obj[c4d.CONSTRAINT_WHEEL_DAMPING] = 0.1
    obj[c4d.CONSTRAINT_LIMIT_RESTITUTION] = 0.1
    obj[c4d.CONSTRAINT_TRANS2_LIMIT_USE_MIN] = True
    obj[c4d.CONSTRAINT_TRANS2_LIMIT_MIN] = 0.1
    obj[c4d.CONSTRAINT_TRANS2_LIMIT_USE_MAX] = True
    obj[c4d.CONSTRAINT_TRANS2_LIMIT_MAX] = 0.1
    obj[c4d.CONSTRAINT_TRANS3_LIMIT_USE_MIN] = True
    obj[c4d.CONSTRAINT_TRANS3_LIMIT_MIN] = 0.1
    obj[c4d.CONSTRAINT_TRANS3_LIMIT_USE_MAX] = True
    obj[c4d.CONSTRAINT_TRANS3_LIMIT_MAX] = 0.1
    obj[c4d.CONSTRAINT_TRANS1_LIMIT_USE_MIN] = True
    obj[c4d.CONSTRAINT_TRANS1_LIMIT_MIN] = 0.1
    obj[c4d.CONSTRAINT_TRANS1_LIMIT_USE_MAX] = True
    obj[c4d.CONSTRAINT_TRANS1_LIMIT_MAX] = 0.1
    obj[c4d.CONSTRAINT_TRANS1_USE_BREAKING_FORCE] = True
    obj[c4d.CONSTRAINT_TRANS1_BREAKING_FORCE] = 0.1
    obj[c4d.CONSTRAINT_ROT1_LIMIT] = True
    obj[c4d.CONSTRAINT_ROT1_LIMIT_MIN] = 0.1
    obj[c4d.CONSTRAINT_ROT1_LIMIT_MAX] = 0.1
    obj[c4d.CONSTRAINT_ROT1_USE_BREAKING_TORQUE] = True
    obj[c4d.CONSTRAINT_ROT1_BREAKING_TORQUE] = 0.1
    obj[c4d.CONSTRAINT_ROT2_LIMIT] = True
    obj[c4d.CONSTRAINT_ROT2_LIMIT_MIN] = 0.1
    obj[c4d.CONSTRAINT_ROT2_LIMIT_MAX] = 0.1
    obj[c4d.CONSTRAINT_CACHE_LOCAL] = True
    obj[c4d.CONSTRAINT_CACHE_USE] = True
    
    #Second way, using the base container.
    bc = obj.GetDataInstance()
    bc.SetInt32(c4d.FORCE_TYPE,c4d.CONSTRAINT_JOINT_TYPE_HINGE)
    bc.SetBool(c4d.CONSTRAINT_IGNORE_COLLISIONS,True)
    bc.SetFloat(c4d.CONSTRAINT_CONE_LIMIT_RADIUS,0.1)
    bc.SetBool(c4d.CONSTRAINT_CONE_LIMIT_ELLIPTICAL,True)
    bc.SetFloat(c4d.CONSTRAINT_CONE_LIMIT_RADIUS2,0.1)
    bc.SetFloat(c4d.CONSTRAINT_WHEEL_ANGLE,0.1)
    bc.SetFloat(c4d.CONSTRAINT_WHEEL_REST_POSITION,0.1)
    bc.SetFloat(c4d.CONSTRAINT_WHEEL_STIFFNESS,0.1)
    bc.SetFloat(c4d.CONSTRAINT_WHEEL_DAMPING,0.1)
    bc.SetFloat(c4d.CONSTRAINT_LIMIT_RESTITUTION,0.1)
    bc.SetBool(c4d.CONSTRAINT_TRANS2_LIMIT_USE_MIN,True)
    bc.SetFloat(c4d.CONSTRAINT_TRANS2_LIMIT_MIN,0.1)
    bc.SetBool(c4d.CONSTRAINT_TRANS2_LIMIT_USE_MAX,True)
    bc.SetFloat(c4d.CONSTRAINT_TRANS2_LIMIT_MAX,0.1)
    bc.SetBool(c4d.CONSTRAINT_TRANS3_LIMIT_USE_MIN,True)
    bc.SetFloat(c4d.CONSTRAINT_TRANS3_LIMIT_MIN,0.1)
    bc.SetBool(c4d.CONSTRAINT_TRANS3_LIMIT_USE_MAX,True)
    bc.SetFloat(c4d.CONSTRAINT_TRANS3_LIMIT_MAX,0.1)
    bc.SetBool(c4d.CONSTRAINT_TRANS1_LIMIT_USE_MIN,True)
    bc.SetFloat(c4d.CONSTRAINT_TRANS1_LIMIT_MIN,0.1)
    bc.SetBool(c4d.CONSTRAINT_TRANS1_LIMIT_USE_MAX,True)
    bc.SetFloat(c4d.CONSTRAINT_TRANS1_LIMIT_MAX,0.1)
    bc.SetBool(c4d.CONSTRAINT_TRANS1_USE_BREAKING_FORCE,True)
    bc.SetFloat(c4d.CONSTRAINT_TRANS1_BREAKING_FORCE,0.1)
    bc.SetBool(c4d.CONSTRAINT_ROT1_LIMIT,True)
    bc.SetFloat(c4d.CONSTRAINT_ROT1_LIMIT_MIN,0.1)
    bc.SetFloat(c4d.CONSTRAINT_ROT1_LIMIT_MAX,0.1)
    bc.SetBool(c4d.CONSTRAINT_ROT1_USE_BREAKING_TORQUE,True)
    bc.SetFloat(c4d.CONSTRAINT_ROT1_BREAKING_TORQUE,0.1)
    bc.SetBool(c4d.CONSTRAINT_ROT2_LIMIT,True)
    bc.SetFloat(c4d.CONSTRAINT_ROT2_LIMIT_MIN,0.1)
    bc.SetFloat(c4d.CONSTRAINT_ROT2_LIMIT_MAX,0.1)
    bc.SetBool(c4d.CONSTRAINT_CACHE_LOCAL,True)
    bc.SetBool(c4d.CONSTRAINT_CACHE_USE,True)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../dynamics/description/dynconstraintobject.h"
void SampleFunction()
{
    BaseDocument *pDoc = GetActiveDocument();
    BaseObject *pObject = BaseObject::Alloc(DynConstraintObject);
    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(FORCE_TYPE),GeData(CONSTRAINT_JOINT_TYPE_HINGE),flags);
    pObject->SetParameter(DescID(CONSTRAINT_IGNORE_COLLISIONS),GeData(true),flags);
    pObject->SetParameter(DescID(CONSTRAINT_CONE_LIMIT_RADIUS),GeData(0.1),flags);
    pObject->SetParameter(DescID(CONSTRAINT_CONE_LIMIT_ELLIPTICAL),GeData(true),flags);
    pObject->SetParameter(DescID(CONSTRAINT_CONE_LIMIT_RADIUS2),GeData(0.1),flags);
    pObject->SetParameter(DescID(CONSTRAINT_WHEEL_ANGLE),GeData(0.1),flags);
    pObject->SetParameter(DescID(CONSTRAINT_WHEEL_REST_POSITION),GeData(0.1),flags);
    pObject->SetParameter(DescID(CONSTRAINT_WHEEL_STIFFNESS),GeData(0.1),flags);
    pObject->SetParameter(DescID(CONSTRAINT_WHEEL_DAMPING),GeData(0.1),flags);
    pObject->SetParameter(DescID(CONSTRAINT_LIMIT_RESTITUTION),GeData(0.1),flags);
    pObject->SetParameter(DescID(CONSTRAINT_TRANS2_LIMIT_USE_MIN),GeData(true),flags);
    pObject->SetParameter(DescID(CONSTRAINT_TRANS2_LIMIT_MIN),GeData(0.1),flags);
    pObject->SetParameter(DescID(CONSTRAINT_TRANS2_LIMIT_USE_MAX),GeData(true),flags);
    pObject->SetParameter(DescID(CONSTRAINT_TRANS2_LIMIT_MAX),GeData(0.1),flags);
    pObject->SetParameter(DescID(CONSTRAINT_TRANS3_LIMIT_USE_MIN),GeData(true),flags);
    pObject->SetParameter(DescID(CONSTRAINT_TRANS3_LIMIT_MIN),GeData(0.1),flags);
    pObject->SetParameter(DescID(CONSTRAINT_TRANS3_LIMIT_USE_MAX),GeData(true),flags);
    pObject->SetParameter(DescID(CONSTRAINT_TRANS3_LIMIT_MAX),GeData(0.1),flags);
    pObject->SetParameter(DescID(CONSTRAINT_TRANS1_LIMIT_USE_MIN),GeData(true),flags);
    pObject->SetParameter(DescID(CONSTRAINT_TRANS1_LIMIT_MIN),GeData(0.1),flags);
    pObject->SetParameter(DescID(CONSTRAINT_TRANS1_LIMIT_USE_MAX),GeData(true),flags);
    pObject->SetParameter(DescID(CONSTRAINT_TRANS1_LIMIT_MAX),GeData(0.1),flags);
    pObject->SetParameter(DescID(CONSTRAINT_TRANS1_USE_BREAKING_FORCE),GeData(true),flags);
    pObject->SetParameter(DescID(CONSTRAINT_TRANS1_BREAKING_FORCE),GeData(0.1),flags);
    pObject->SetParameter(DescID(CONSTRAINT_ROT1_LIMIT),GeData(true),flags);
    pObject->SetParameter(DescID(CONSTRAINT_ROT1_LIMIT_MIN),GeData(0.1),flags);
    pObject->SetParameter(DescID(CONSTRAINT_ROT1_LIMIT_MAX),GeData(0.1),flags);
    pObject->SetParameter(DescID(CONSTRAINT_ROT1_USE_BREAKING_TORQUE),GeData(true),flags);
    pObject->SetParameter(DescID(CONSTRAINT_ROT1_BREAKING_TORQUE),GeData(0.1),flags);
    pObject->SetParameter(DescID(CONSTRAINT_ROT2_LIMIT),GeData(true),flags);
    pObject->SetParameter(DescID(CONSTRAINT_ROT2_LIMIT_MIN),GeData(0.1),flags);
    pObject->SetParameter(DescID(CONSTRAINT_ROT2_LIMIT_MAX),GeData(0.1),flags);
    pObject->SetParameter(DescID(CONSTRAINT_CACHE_LOCAL),GeData(true),flags);
    pObject->SetParameter(DescID(CONSTRAINT_CACHE_USE),GeData(true),flags);
    pObject->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pObject->GetDataInstance();
    bc->SetInt32(FORCE_TYPE,CONSTRAINT_JOINT_TYPE_HINGE);
    bc->SetBool(CONSTRAINT_IGNORE_COLLISIONS,true);
    bc->SetFloat(CONSTRAINT_CONE_LIMIT_RADIUS,0.1);
    bc->SetBool(CONSTRAINT_CONE_LIMIT_ELLIPTICAL,true);
    bc->SetFloat(CONSTRAINT_CONE_LIMIT_RADIUS2,0.1);
    bc->SetFloat(CONSTRAINT_WHEEL_ANGLE,0.1);
    bc->SetFloat(CONSTRAINT_WHEEL_REST_POSITION,0.1);
    bc->SetFloat(CONSTRAINT_WHEEL_STIFFNESS,0.1);
    bc->SetFloat(CONSTRAINT_WHEEL_DAMPING,0.1);
    bc->SetFloat(CONSTRAINT_LIMIT_RESTITUTION,0.1);
    bc->SetBool(CONSTRAINT_TRANS2_LIMIT_USE_MIN,true);
    bc->SetFloat(CONSTRAINT_TRANS2_LIMIT_MIN,0.1);
    bc->SetBool(CONSTRAINT_TRANS2_LIMIT_USE_MAX,true);
    bc->SetFloat(CONSTRAINT_TRANS2_LIMIT_MAX,0.1);
    bc->SetBool(CONSTRAINT_TRANS3_LIMIT_USE_MIN,true);
    bc->SetFloat(CONSTRAINT_TRANS3_LIMIT_MIN,0.1);
    bc->SetBool(CONSTRAINT_TRANS3_LIMIT_USE_MAX,true);
    bc->SetFloat(CONSTRAINT_TRANS3_LIMIT_MAX,0.1);
    bc->SetBool(CONSTRAINT_TRANS1_LIMIT_USE_MIN,true);
    bc->SetFloat(CONSTRAINT_TRANS1_LIMIT_MIN,0.1);
    bc->SetBool(CONSTRAINT_TRANS1_LIMIT_USE_MAX,true);
    bc->SetFloat(CONSTRAINT_TRANS1_LIMIT_MAX,0.1);
    bc->SetBool(CONSTRAINT_TRANS1_USE_BREAKING_FORCE,true);
    bc->SetFloat(CONSTRAINT_TRANS1_BREAKING_FORCE,0.1);
    bc->SetBool(CONSTRAINT_ROT1_LIMIT,true);
    bc->SetFloat(CONSTRAINT_ROT1_LIMIT_MIN,0.1);
    bc->SetFloat(CONSTRAINT_ROT1_LIMIT_MAX,0.1);
    bc->SetBool(CONSTRAINT_ROT1_USE_BREAKING_TORQUE,true);
    bc->SetFloat(CONSTRAINT_ROT1_BREAKING_TORQUE,0.1);
    bc->SetBool(CONSTRAINT_ROT2_LIMIT,true);
    bc->SetFloat(CONSTRAINT_ROT2_LIMIT_MIN,0.1);
    bc->SetFloat(CONSTRAINT_ROT2_LIMIT_MAX,0.1);
    bc->SetBool(CONSTRAINT_CACHE_LOCAL,true);
    bc->SetBool(CONSTRAINT_CACHE_USE,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.CONSTRAINT_CACHE_CLEAR)

C++

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