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 Thairsplinedynamics

Thairsplinedynamics

Attributes

  • ENGLISH NAME : SplineDynamics
  • NAME : Thairsplinedynamics
  • INCLUDE : Texpression
  • PATH : hair/description/thairsplinedynamics.res
  • PLUGIN : hair
  • MAXON online help (may not exist): THAIRSPLINEDYNAMICS

Elements

ID UI Name Type Parameters Cycle
HAIR_SDYNAMICS_TAG_COLLISIONS Collisions BOOL  
HAIR_SDYNAMICS_TAG_EXTRA_STIFF Rigid BOOL  
HAIR_SDYNAMICS_TAG_SET_STATE SetInitial BUTTON  
HAIR_SDYNAMICS_TAG_DRAG Drag REAL
UNIT PERCENT
MIN 0.0
MAX 100.0
HAIR_SDYNAMICS_TAG_RADIUS Radius REAL MIN
HAIR_SDYNAMICS_TAG_STIFFNESS Stiffness REAL
UNIT PERCENT
MIN 0.0
MAX 100.0
HAIR_SDYNAMICS_TAG_RUBBER Rubber REAL
UNIT PERCENT
MIN 0.0
MAX 100.0
HAIR_SDYNAMICS_REST_MIX RestMix REAL
UNIT PERCENT
MIN 0.0
MAX 100.0
HAIR_SDYNAMICS_REST_HOLD RestHold REAL
UNIT PERCENT
MIN 0.0
MAX 100.0
HAIR_SDYNAMICS_ELASTIC_LIMIT ElasticLimit REAL
UNIT PERCENT
MIN 0.0
HAIR_SDYNAMICS_ELASTIC_DEFORM Deform REAL
UNIT PERCENT
MIN 0.0
MAX 100.0
HAIR_SDYNAMICS_TAG_DRAW_FIXED DisplayAnchors BOOL  
HAIR_SDYNAMICS_TAG_MASS Mass REAL  
HAIR_SDYNAMICS_TAG_SETMASS Set BUTTON  
HAIR_SDYNAMICS_TAG_SET_FIXED Set BUTTON  
HAIR_SDYNAMICS_TAG_RELEASE_FIXED Release BUTTON  
HAIR_SDYNAMICS_TAG_CLEAR_FIXED Clear BUTTON  
HAIR_SDYNAMICS_TAG_GRAVITY Gravity REAL STEP
HAIR_SDYNAMICS_TAG_FORCES_INCEXC Mode LONG  
HAIR_SDYNAMICS_TAG_INCEXC_INCLUDE Include
HAIR_SDYNAMICS_TAG_INCEXC_EXCLUDE Exclude
HAIR_SDYNAMICS_TAG_FORCES_INCLUDE Forces IN_EXCLUDE
NUM_FLAGS 0
INIT_STATE 0
SEND_SELCHNGMSG 1
SCALE_V
HAIR_SDYNAMICS_CACHE_ENABLE DynamicsCache BOOL  
HAIR_SDYNAMICS_CACHE_CALCULATE Calculate BUTTON FIT_H
HAIR_SDYNAMICS_CACHE_COMPRESSED Compress BOOL ANIM
HAIR_SDYNAMICS_CACHE_DELETE EmptyCache BUTTON FIT_H
HAIR_SDYNAMICS_CACHE_CACHE_FRAME UpdateFrame BUTTON FIT_H
HAIR_SDYNAMICS_CACHE_CACHE_LOAD Load... BUTTON FIT_H
HAIR_SDYNAMICS_CACHE_CACHE_SAVE Save... BUTTON FIT_H
HAIR_SDYNAMICS_CACHE_CACHE_LIMIT Cache LONG
MIN 1
MAX 1000
ANIM OFF
HAIR_SDYNAMICS_TAG_SUBDIV Steps LONG
MIN 1
MAX 100
HAIR_SDYNAMICS_TAG_ITERATIONS Iterations LONG MIN
HAIR_SDYNAMICS_TAG_AUTOTIME Auto BOOL ANIM
HAIR_SDYNAMICS_TAG_START Start BASETIME ANIM
HAIR_SDYNAMICS_TAG_STOP End BASETIME ANIM

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.Osphere)
    tag = obj.MakeTag(c4d.Thairsplinedynamics)
    doc.InsertObject(obj)
    c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
    
    #You can set parameters two different ways. 
    #First way              
    tag[c4d.HAIR_SDYNAMICS_TAG_COLLISIONS] = True
    tag[c4d.HAIR_SDYNAMICS_TAG_EXTRA_STIFF] = True
    tag[c4d.HAIR_SDYNAMICS_TAG_DRAG] = 0.1
    tag[c4d.HAIR_SDYNAMICS_TAG_RADIUS] = 0.1
    tag[c4d.HAIR_SDYNAMICS_TAG_STIFFNESS] = 0.1
    tag[c4d.HAIR_SDYNAMICS_TAG_RUBBER] = 0.1
    tag[c4d.HAIR_SDYNAMICS_REST_MIX] = 0.1
    tag[c4d.HAIR_SDYNAMICS_REST_HOLD] = 0.1
    tag[c4d.HAIR_SDYNAMICS_ELASTIC_LIMIT] = 0.1
    tag[c4d.HAIR_SDYNAMICS_ELASTIC_DEFORM] = 0.1
    tag[c4d.HAIR_SDYNAMICS_TAG_DRAW_FIXED] = True
    tag[c4d.HAIR_SDYNAMICS_TAG_MASS] = 0.1
    tag[c4d.HAIR_SDYNAMICS_TAG_GRAVITY] = 0.1
    tag[c4d.HAIR_SDYNAMICS_TAG_FORCES_INCEXC] = c4d.HAIR_SDYNAMICS_TAG_INCEXC_INCLUDE
    tag[c4d.HAIR_SDYNAMICS_CACHE_ENABLE] = True
    tag[c4d.HAIR_SDYNAMICS_CACHE_COMPRESSED] = True
    tag[c4d.HAIR_SDYNAMICS_CACHE_CACHE_LIMIT] = 1
    tag[c4d.HAIR_SDYNAMICS_TAG_SUBDIV] = 1
    tag[c4d.HAIR_SDYNAMICS_TAG_ITERATIONS] = 1
    tag[c4d.HAIR_SDYNAMICS_TAG_AUTOTIME] = True
    
    #Second way, using the base container.
    bc = tag.GetDataInstance()
    bc.SetBool(c4d.HAIR_SDYNAMICS_TAG_COLLISIONS,True)
    bc.SetBool(c4d.HAIR_SDYNAMICS_TAG_EXTRA_STIFF,True)
    bc.SetFloat(c4d.HAIR_SDYNAMICS_TAG_DRAG,0.1)
    bc.SetFloat(c4d.HAIR_SDYNAMICS_TAG_RADIUS,0.1)
    bc.SetFloat(c4d.HAIR_SDYNAMICS_TAG_STIFFNESS,0.1)
    bc.SetFloat(c4d.HAIR_SDYNAMICS_TAG_RUBBER,0.1)
    bc.SetFloat(c4d.HAIR_SDYNAMICS_REST_MIX,0.1)
    bc.SetFloat(c4d.HAIR_SDYNAMICS_REST_HOLD,0.1)
    bc.SetFloat(c4d.HAIR_SDYNAMICS_ELASTIC_LIMIT,0.1)
    bc.SetFloat(c4d.HAIR_SDYNAMICS_ELASTIC_DEFORM,0.1)
    bc.SetBool(c4d.HAIR_SDYNAMICS_TAG_DRAW_FIXED,True)
    bc.SetFloat(c4d.HAIR_SDYNAMICS_TAG_MASS,0.1)
    bc.SetFloat(c4d.HAIR_SDYNAMICS_TAG_GRAVITY,0.1)
    bc.SetInt32(c4d.HAIR_SDYNAMICS_TAG_FORCES_INCEXC,c4d.HAIR_SDYNAMICS_TAG_INCEXC_INCLUDE)
    bc.SetBool(c4d.HAIR_SDYNAMICS_CACHE_ENABLE,True)
    bc.SetBool(c4d.HAIR_SDYNAMICS_CACHE_COMPRESSED,True)
    bc.SetInt32(c4d.HAIR_SDYNAMICS_CACHE_CACHE_LIMIT,1)
    bc.SetInt32(c4d.HAIR_SDYNAMICS_TAG_SUBDIV,1)
    bc.SetInt32(c4d.HAIR_SDYNAMICS_TAG_ITERATIONS,1)
    bc.SetBool(c4d.HAIR_SDYNAMICS_TAG_AUTOTIME,True)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../hair/description/thairsplinedynamics.h"
void SampleFunction()
{
    BaseDocument *pDoc = GetActiveDocument();
    BaseObject *pObject = BaseObject::Alloc(Osphere);
    pDoc->InsertObject(pObject);
    pDoc->StartUndo();
    pDoc->AddUndo(UNDOTYPE_NEW,pObject);
    pDoc->EndUndo();
    pDoc->StartUndo();
    BaseTag *pTag = pObject->MakeTag(Thairsplinedynamics);
    pDoc->AddUndo(UNDOTYPE_NEW,pTag);
    pDoc->EndUndo();
    pObject->Message(MSG_UPDATE);
    
    //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;
    pTag->SetParameter(DescID(HAIR_SDYNAMICS_TAG_COLLISIONS),GeData(true),flags);
    pTag->SetParameter(DescID(HAIR_SDYNAMICS_TAG_EXTRA_STIFF),GeData(true),flags);
    pTag->SetParameter(DescID(HAIR_SDYNAMICS_TAG_DRAG),GeData(0.1),flags);
    pTag->SetParameter(DescID(HAIR_SDYNAMICS_TAG_RADIUS),GeData(0.1),flags);
    pTag->SetParameter(DescID(HAIR_SDYNAMICS_TAG_STIFFNESS),GeData(0.1),flags);
    pTag->SetParameter(DescID(HAIR_SDYNAMICS_TAG_RUBBER),GeData(0.1),flags);
    pTag->SetParameter(DescID(HAIR_SDYNAMICS_REST_MIX),GeData(0.1),flags);
    pTag->SetParameter(DescID(HAIR_SDYNAMICS_REST_HOLD),GeData(0.1),flags);
    pTag->SetParameter(DescID(HAIR_SDYNAMICS_ELASTIC_LIMIT),GeData(0.1),flags);
    pTag->SetParameter(DescID(HAIR_SDYNAMICS_ELASTIC_DEFORM),GeData(0.1),flags);
    pTag->SetParameter(DescID(HAIR_SDYNAMICS_TAG_DRAW_FIXED),GeData(true),flags);
    pTag->SetParameter(DescID(HAIR_SDYNAMICS_TAG_MASS),GeData(0.1),flags);
    pTag->SetParameter(DescID(HAIR_SDYNAMICS_TAG_GRAVITY),GeData(0.1),flags);
    pTag->SetParameter(DescID(HAIR_SDYNAMICS_TAG_FORCES_INCEXC),GeData(HAIR_SDYNAMICS_TAG_INCEXC_INCLUDE),flags);
    pTag->SetParameter(DescID(HAIR_SDYNAMICS_CACHE_ENABLE),GeData(true),flags);
    pTag->SetParameter(DescID(HAIR_SDYNAMICS_CACHE_COMPRESSED),GeData(true),flags);
    pTag->SetParameter(DescID(HAIR_SDYNAMICS_CACHE_CACHE_LIMIT),GeData(1),flags);
    pTag->SetParameter(DescID(HAIR_SDYNAMICS_TAG_SUBDIV),GeData(1),flags);
    pTag->SetParameter(DescID(HAIR_SDYNAMICS_TAG_ITERATIONS),GeData(1),flags);
    pTag->SetParameter(DescID(HAIR_SDYNAMICS_TAG_AUTOTIME),GeData(true),flags);
    pTag->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pTag->GetDataInstance();
    bc->SetBool(HAIR_SDYNAMICS_TAG_COLLISIONS,true);
    bc->SetBool(HAIR_SDYNAMICS_TAG_EXTRA_STIFF,true);
    bc->SetFloat(HAIR_SDYNAMICS_TAG_DRAG,0.1);
    bc->SetFloat(HAIR_SDYNAMICS_TAG_RADIUS,0.1);
    bc->SetFloat(HAIR_SDYNAMICS_TAG_STIFFNESS,0.1);
    bc->SetFloat(HAIR_SDYNAMICS_TAG_RUBBER,0.1);
    bc->SetFloat(HAIR_SDYNAMICS_REST_MIX,0.1);
    bc->SetFloat(HAIR_SDYNAMICS_REST_HOLD,0.1);
    bc->SetFloat(HAIR_SDYNAMICS_ELASTIC_LIMIT,0.1);
    bc->SetFloat(HAIR_SDYNAMICS_ELASTIC_DEFORM,0.1);
    bc->SetBool(HAIR_SDYNAMICS_TAG_DRAW_FIXED,true);
    bc->SetFloat(HAIR_SDYNAMICS_TAG_MASS,0.1);
    bc->SetFloat(HAIR_SDYNAMICS_TAG_GRAVITY,0.1);
    bc->SetInt32(HAIR_SDYNAMICS_TAG_FORCES_INCEXC,HAIR_SDYNAMICS_TAG_INCEXC_INCLUDE);
    bc->SetBool(HAIR_SDYNAMICS_CACHE_ENABLE,true);
    bc->SetBool(HAIR_SDYNAMICS_CACHE_COMPRESSED,true);
    bc->SetInt32(HAIR_SDYNAMICS_CACHE_CACHE_LIMIT,1);
    bc->SetInt32(HAIR_SDYNAMICS_TAG_SUBDIV,1);
    bc->SetInt32(HAIR_SDYNAMICS_TAG_ITERATIONS,1);
    bc->SetBool(HAIR_SDYNAMICS_TAG_AUTOTIME,true);
    pTag->Message(MSG_UPDATE);                                                      
}
             

Buttons

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

Python

c4d.CallButton(tag,c4d.HAIR_SDYNAMICS_TAG_SET_STATE)
c4d.CallButton(tag,c4d.HAIR_SDYNAMICS_TAG_SETMASS)
c4d.CallButton(tag,c4d.HAIR_SDYNAMICS_TAG_SET_FIXED)
c4d.CallButton(tag,c4d.HAIR_SDYNAMICS_TAG_RELEASE_FIXED)
c4d.CallButton(tag,c4d.HAIR_SDYNAMICS_TAG_CLEAR_FIXED)
c4d.CallButton(tag,c4d.HAIR_SDYNAMICS_CACHE_CALCULATE)
c4d.CallButton(tag,c4d.HAIR_SDYNAMICS_CACHE_DELETE)
c4d.CallButton(tag,c4d.HAIR_SDYNAMICS_CACHE_CACHE_FRAME)
c4d.CallButton(tag,c4d.HAIR_SDYNAMICS_CACHE_CACHE_LOAD)
c4d.CallButton(tag,c4d.HAIR_SDYNAMICS_CACHE_CACHE_SAVE)

C++

DescriptionCommand dc;
dc.id = DescID(HAIR_SDYNAMICS_TAG_SET_STATE);             
pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);

DescriptionCommand dc; dc.id = DescID(HAIR_SDYNAMICS_TAG_SETMASS); pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc; dc.id = DescID(HAIR_SDYNAMICS_TAG_SET_FIXED); pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc; dc.id = DescID(HAIR_SDYNAMICS_TAG_RELEASE_FIXED); pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc; dc.id = DescID(HAIR_SDYNAMICS_TAG_CLEAR_FIXED); pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc; dc.id = DescID(HAIR_SDYNAMICS_CACHE_CALCULATE); pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc; dc.id = DescID(HAIR_SDYNAMICS_CACHE_DELETE); pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc; dc.id = DescID(HAIR_SDYNAMICS_CACHE_CACHE_FRAME); pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc; dc.id = DescID(HAIR_SDYNAMICS_CACHE_CACHE_LOAD); pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc; dc.id = DescID(HAIR_SDYNAMICS_CACHE_CACHE_SAVE); pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);