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 DynSpringObject

DynSpringObject

Attributes

  • ENGLISH NAME : Spring
  • NAME : name
  • INCLUDE : DynBinForce
  • PATH : dynamics/description/dynspringobject.res
  • PLUGIN : dynamics
  • MAXON online help (may not exist): DYNSPRINGOBJECT

Elements

ID UI Name Type Parameters Cycle
SPRING_LINEAR_REST_LENGTH RestLength REAL
MIN 0.0
UNIT METER
SPRING_LINEAR_SET_REST_LENGTH SetRestLength BUTTON  
SPRING_LINEAR_STIFFNESS Stiffness REAL MIN
SPRING_LINEAR_DAMPING Damping REAL
MIN 0.0
UNIT PERCENT
STEP 1.0
SPRING_LINEAR_USE_ELASTIC_STRETCH_LIMIT ElasticStretchLimit BOOL  
SPRING_LINEAR_ELASTIC_STRETCH_LIMIT Value REAL
MIN 0.0
UNIT METER
SPRING_LINEAR_USE_ELASTIC_COMPRESSION_LIMIT ElasticCompressionLimit BOOL  
SPRING_LINEAR_ELASTIC_COMPRESSION_LIMIT Value REAL
MIN 0.0
UNIT METER
SPRING_LINEAR_USE_BREAK_STRETCH BreakingStretch BOOL  
SPRING_LINEAR_BREAK_STRETCH Value REAL
MIN 0.0
UNIT METER
SPRING_LINEAR_USE_BREAK_COMPRESSION BreakingCompression BOOL  
SPRING_LINEAR_BREAK_COMPRESSION Value REAL
MIN 0.0
UNIT METER
SPRING_ANGULAR_REST_LENGTH RestAngle REAL UNIT
SPRING_ANGULAR_SET_REST_LENGTH SetRestAngle BUTTON  
SPRING_ANGULAR_STIFFNESS Stiffness REAL MIN
SPRING_ANGULAR_DAMPING Damping REAL
MIN 0.0
UNIT PERCENT
STEP 1.0
SPRING_ANGULAR_USE_ELASTIC_STRETCH_LIMIT ElasticStretchLimit BOOL  
SPRING_ANGULAR_ELASTIC_STRETCH_LIMIT Value REAL
MIN 0.0
UNIT DEGREE
SPRING_ANGULAR_USE_ELASTIC_COMPRESSION_LIMIT ElasticCompressionLimit BOOL  
SPRING_ANGULAR_ELASTIC_COMPRESSION_LIMIT Value REAL
MIN 0.0
UNIT DEGREE
SPRING_ANGULAR_USE_BREAK_STRETCH BreakingStretch BOOL  
SPRING_ANGULAR_BREAK_STRETCH Value REAL
MIN 0.0
UNIT DEGREE
SPRING_ANGULAR_USE_BREAK_COMPRESSION BreakingCompression BOOL  
SPRING_ANGULAR_BREAK_COMPRESSION Value REAL
MIN 0.0
UNIT DEGREE

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.DynSpringObject)
    doc.InsertObject(obj)
    c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
    
    #You can set parameters two different ways. 
    #First way              
    obj[c4d.SPRING_LINEAR_REST_LENGTH] = 0.1
    obj[c4d.SPRING_LINEAR_STIFFNESS] = 0.1
    obj[c4d.SPRING_LINEAR_DAMPING] = 0.1
    obj[c4d.SPRING_LINEAR_USE_ELASTIC_STRETCH_LIMIT] = True
    obj[c4d.SPRING_LINEAR_ELASTIC_STRETCH_LIMIT] = 0.1
    obj[c4d.SPRING_LINEAR_USE_ELASTIC_COMPRESSION_LIMIT] = True
    obj[c4d.SPRING_LINEAR_ELASTIC_COMPRESSION_LIMIT] = 0.1
    obj[c4d.SPRING_LINEAR_USE_BREAK_STRETCH] = True
    obj[c4d.SPRING_LINEAR_BREAK_STRETCH] = 0.1
    obj[c4d.SPRING_LINEAR_USE_BREAK_COMPRESSION] = True
    obj[c4d.SPRING_LINEAR_BREAK_COMPRESSION] = 0.1
    obj[c4d.SPRING_ANGULAR_REST_LENGTH] = 0.1
    obj[c4d.SPRING_ANGULAR_STIFFNESS] = 0.1
    obj[c4d.SPRING_ANGULAR_DAMPING] = 0.1
    obj[c4d.SPRING_ANGULAR_USE_ELASTIC_STRETCH_LIMIT] = True
    obj[c4d.SPRING_ANGULAR_ELASTIC_STRETCH_LIMIT] = 0.1
    obj[c4d.SPRING_ANGULAR_USE_ELASTIC_COMPRESSION_LIMIT] = True
    obj[c4d.SPRING_ANGULAR_ELASTIC_COMPRESSION_LIMIT] = 0.1
    obj[c4d.SPRING_ANGULAR_USE_BREAK_STRETCH] = True
    obj[c4d.SPRING_ANGULAR_BREAK_STRETCH] = 0.1
    obj[c4d.SPRING_ANGULAR_USE_BREAK_COMPRESSION] = True
    obj[c4d.SPRING_ANGULAR_BREAK_COMPRESSION] = 0.1
    
    #Second way, using the base container.
    bc = obj.GetDataInstance()
    bc.SetFloat(c4d.SPRING_LINEAR_REST_LENGTH,0.1)
    bc.SetFloat(c4d.SPRING_LINEAR_STIFFNESS,0.1)
    bc.SetFloat(c4d.SPRING_LINEAR_DAMPING,0.1)
    bc.SetBool(c4d.SPRING_LINEAR_USE_ELASTIC_STRETCH_LIMIT,True)
    bc.SetFloat(c4d.SPRING_LINEAR_ELASTIC_STRETCH_LIMIT,0.1)
    bc.SetBool(c4d.SPRING_LINEAR_USE_ELASTIC_COMPRESSION_LIMIT,True)
    bc.SetFloat(c4d.SPRING_LINEAR_ELASTIC_COMPRESSION_LIMIT,0.1)
    bc.SetBool(c4d.SPRING_LINEAR_USE_BREAK_STRETCH,True)
    bc.SetFloat(c4d.SPRING_LINEAR_BREAK_STRETCH,0.1)
    bc.SetBool(c4d.SPRING_LINEAR_USE_BREAK_COMPRESSION,True)
    bc.SetFloat(c4d.SPRING_LINEAR_BREAK_COMPRESSION,0.1)
    bc.SetFloat(c4d.SPRING_ANGULAR_REST_LENGTH,0.1)
    bc.SetFloat(c4d.SPRING_ANGULAR_STIFFNESS,0.1)
    bc.SetFloat(c4d.SPRING_ANGULAR_DAMPING,0.1)
    bc.SetBool(c4d.SPRING_ANGULAR_USE_ELASTIC_STRETCH_LIMIT,True)
    bc.SetFloat(c4d.SPRING_ANGULAR_ELASTIC_STRETCH_LIMIT,0.1)
    bc.SetBool(c4d.SPRING_ANGULAR_USE_ELASTIC_COMPRESSION_LIMIT,True)
    bc.SetFloat(c4d.SPRING_ANGULAR_ELASTIC_COMPRESSION_LIMIT,0.1)
    bc.SetBool(c4d.SPRING_ANGULAR_USE_BREAK_STRETCH,True)
    bc.SetFloat(c4d.SPRING_ANGULAR_BREAK_STRETCH,0.1)
    bc.SetBool(c4d.SPRING_ANGULAR_USE_BREAK_COMPRESSION,True)
    bc.SetFloat(c4d.SPRING_ANGULAR_BREAK_COMPRESSION,0.1)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../dynamics/description/dynspringobject.h"
void SampleFunction()
{
    BaseDocument *pDoc = GetActiveDocument();
    BaseObject *pObject = BaseObject::Alloc(DynSpringObject);
    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(SPRING_LINEAR_REST_LENGTH),GeData(0.1),flags);
    pObject->SetParameter(DescID(SPRING_LINEAR_STIFFNESS),GeData(0.1),flags);
    pObject->SetParameter(DescID(SPRING_LINEAR_DAMPING),GeData(0.1),flags);
    pObject->SetParameter(DescID(SPRING_LINEAR_USE_ELASTIC_STRETCH_LIMIT),GeData(true),flags);
    pObject->SetParameter(DescID(SPRING_LINEAR_ELASTIC_STRETCH_LIMIT),GeData(0.1),flags);
    pObject->SetParameter(DescID(SPRING_LINEAR_USE_ELASTIC_COMPRESSION_LIMIT),GeData(true),flags);
    pObject->SetParameter(DescID(SPRING_LINEAR_ELASTIC_COMPRESSION_LIMIT),GeData(0.1),flags);
    pObject->SetParameter(DescID(SPRING_LINEAR_USE_BREAK_STRETCH),GeData(true),flags);
    pObject->SetParameter(DescID(SPRING_LINEAR_BREAK_STRETCH),GeData(0.1),flags);
    pObject->SetParameter(DescID(SPRING_LINEAR_USE_BREAK_COMPRESSION),GeData(true),flags);
    pObject->SetParameter(DescID(SPRING_LINEAR_BREAK_COMPRESSION),GeData(0.1),flags);
    pObject->SetParameter(DescID(SPRING_ANGULAR_REST_LENGTH),GeData(0.1),flags);
    pObject->SetParameter(DescID(SPRING_ANGULAR_STIFFNESS),GeData(0.1),flags);
    pObject->SetParameter(DescID(SPRING_ANGULAR_DAMPING),GeData(0.1),flags);
    pObject->SetParameter(DescID(SPRING_ANGULAR_USE_ELASTIC_STRETCH_LIMIT),GeData(true),flags);
    pObject->SetParameter(DescID(SPRING_ANGULAR_ELASTIC_STRETCH_LIMIT),GeData(0.1),flags);
    pObject->SetParameter(DescID(SPRING_ANGULAR_USE_ELASTIC_COMPRESSION_LIMIT),GeData(true),flags);
    pObject->SetParameter(DescID(SPRING_ANGULAR_ELASTIC_COMPRESSION_LIMIT),GeData(0.1),flags);
    pObject->SetParameter(DescID(SPRING_ANGULAR_USE_BREAK_STRETCH),GeData(true),flags);
    pObject->SetParameter(DescID(SPRING_ANGULAR_BREAK_STRETCH),GeData(0.1),flags);
    pObject->SetParameter(DescID(SPRING_ANGULAR_USE_BREAK_COMPRESSION),GeData(true),flags);
    pObject->SetParameter(DescID(SPRING_ANGULAR_BREAK_COMPRESSION),GeData(0.1),flags);
    pObject->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pObject->GetDataInstance();
    bc->SetFloat(SPRING_LINEAR_REST_LENGTH,0.1);
    bc->SetFloat(SPRING_LINEAR_STIFFNESS,0.1);
    bc->SetFloat(SPRING_LINEAR_DAMPING,0.1);
    bc->SetBool(SPRING_LINEAR_USE_ELASTIC_STRETCH_LIMIT,true);
    bc->SetFloat(SPRING_LINEAR_ELASTIC_STRETCH_LIMIT,0.1);
    bc->SetBool(SPRING_LINEAR_USE_ELASTIC_COMPRESSION_LIMIT,true);
    bc->SetFloat(SPRING_LINEAR_ELASTIC_COMPRESSION_LIMIT,0.1);
    bc->SetBool(SPRING_LINEAR_USE_BREAK_STRETCH,true);
    bc->SetFloat(SPRING_LINEAR_BREAK_STRETCH,0.1);
    bc->SetBool(SPRING_LINEAR_USE_BREAK_COMPRESSION,true);
    bc->SetFloat(SPRING_LINEAR_BREAK_COMPRESSION,0.1);
    bc->SetFloat(SPRING_ANGULAR_REST_LENGTH,0.1);
    bc->SetFloat(SPRING_ANGULAR_STIFFNESS,0.1);
    bc->SetFloat(SPRING_ANGULAR_DAMPING,0.1);
    bc->SetBool(SPRING_ANGULAR_USE_ELASTIC_STRETCH_LIMIT,true);
    bc->SetFloat(SPRING_ANGULAR_ELASTIC_STRETCH_LIMIT,0.1);
    bc->SetBool(SPRING_ANGULAR_USE_ELASTIC_COMPRESSION_LIMIT,true);
    bc->SetFloat(SPRING_ANGULAR_ELASTIC_COMPRESSION_LIMIT,0.1);
    bc->SetBool(SPRING_ANGULAR_USE_BREAK_STRETCH,true);
    bc->SetFloat(SPRING_ANGULAR_BREAK_STRETCH,0.1);
    bc->SetBool(SPRING_ANGULAR_USE_BREAK_COMPRESSION,true);
    bc->SetFloat(SPRING_ANGULAR_BREAK_COMPRESSION,0.1);
    pObject->Message(MSG_UPDATE);                                                      
}
             

Buttons

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

Python

c4d.CallButton(obj,c4d.SPRING_LINEAR_SET_REST_LENGTH)
c4d.CallButton(obj,c4d.SPRING_ANGULAR_SET_REST_LENGTH)

C++

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

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