DynRigidBodyTag
Attributes
-
ENGLISH NAME : DynamicsBodyTag
-
NAME : name
-
INCLUDE : Tbase
-
PATH : dynamics/description/dynrigidbodytag.res
-
PLUGIN : dynamics
-
MAXON online help (may not exist): DYNRIGIDBODYTAG
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.Osphere)
tag = obj.MakeTag(c4d.DynRigidBodyTag)
doc.InsertObject(obj)
c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
#You can set parameters two different ways.
#First way
tag[c4d.RIGID_BODY_ENABLED] = True
tag[c4d.RIGID_BODY_DYNAMIC] = c4d.RIGID_BODY_DYNAMIC_OFF
tag[c4d.RIGID_BODY_SHOW] = True
tag[c4d.RIGID_BODY_TRIGGER] = c4d.RIGID_BODY_TRIGGER_IMMEDIATELY
tag[c4d.RIGID_BODY_TRIGGER_ON_COLLISION_VELOCITY] = 0.1
tag[c4d.RIGID_BODY_USE_INITIAL_VELOCITY] = True
tag[c4d.RIGID_BODY_INITIAL_LINEAR_VELOCITY] = c4d.Vector(1.0,1.0,1.0)
tag[c4d.RIGID_BODY_INITIAL_ANGULAR_VELOCITY] = c4d.Vector(1.0,1.0,1.0)
tag[c4d.RIGID_BODY_LOCAL_INITIAL_VELOCITY] = True
tag[c4d.RIGID_BODY_DYNAMIC_TRANSITION] = True
tag[c4d.RIGID_BODY_SLEEPING_LINEAR_VELOCITY] = 0.1
tag[c4d.RIGID_BODY_SLEEPING_ANGULAR_VELOCITY] = 0.1
tag[c4d.RIGID_BODY_HIERARCHY] = c4d.RIGID_BODY_HIERARCHY_NONE
tag[c4d.RIGID_BODY_SPLIT_CACHE] = c4d.RIGID_BODY_SPLIT_CACHE_OFF
tag[c4d.RIGID_BODY_SELF_COLLISIONS] = True
tag[c4d.RIGID_BODY_SHAPE_DEFORMEDSTATE] = True
tag[c4d.RIGID_BODY_SHAPE] = c4d.RIGID_BODY_SHAPE_DEFAULT
tag[c4d.RIGID_BODY_SHAPE_SIZE_INCREMENT] = 0.1
tag[c4d.RIGID_BODY_SPECIFIC_MARGIN] = True
tag[c4d.RIGID_BODY_MARGIN] = 0.1
tag[c4d.RIGID_BODY_SB_KEEP_SHAPE] = True
tag[c4d.RIGID_BODY_RESTITUTION] = 0.1
tag[c4d.RIGID_BODY_FRICTION] = 0.1
tag[c4d.RIGID_BODY_COLLISION_NOISE] = 0.1
tag[c4d.RIGID_BODY_MASS_SWITCH] = c4d.RIGID_BODY_MASS_SWITCH_DEFAULT
tag[c4d.RIGID_BODY_DENSITY] = 0.1
tag[c4d.RIGID_BODY_MASS] = 0.1
tag[c4d.RIGID_BODY_INERTIA_FACTOR] = 0.1
tag[c4d.RIGID_BODY_USE_CENTER_OF_MASS] = True
tag[c4d.RIGID_BODY_CENTER_OF_MASS] = c4d.Vector(1.0,1.0,1.0)
tag[c4d.RIGID_BODY_LINEAR_FOLLOW_STRENGTH] = 0.1
tag[c4d.RIGID_BODY_ANGULAR_FOLLOW_STRENGTH] = 0.1
tag[c4d.RIGID_BODY_LINEAR_DAMPING] = 0.1
tag[c4d.RIGID_BODY_ANGULAR_DAMPING] = 0.1
tag[c4d.RIGID_BODY_FORCE_MODE] = c4d.RIGID_BODY_FORCE_MODE_INCLUDE
tag[c4d.RIGID_BODY_AERODYNAMICS_DRAG] = 0.1
tag[c4d.RIGID_BODY_AERODYNAMICS_LIFT] = 0.1
tag[c4d.RIGID_BODY_AERODYNAMICS_TWO_SIDED] = True
tag[c4d.RIGID_BODY_SOFT] = c4d.RIGID_BODY_SOFT_OFF
tag[c4d.RIGID_BODY_SB_ACCURATE_SOLVER] = True
tag[c4d.RIGID_BODY_SB_STRUCTURAL] = 0.1
tag[c4d.RIGID_BODY_SB_STRUCTURAL_DAMPING] = 0.1
tag[c4d.RIGID_BODY_SB_ELASTIC_LIMIT] = 0.1
tag[c4d.RIGID_BODY_SB_SHEAR] = 0.1
tag[c4d.RIGID_BODY_SB_SHEAR_DAMPING] = 0.1
tag[c4d.RIGID_BODY_SB_FLEXION] = 0.1
tag[c4d.RIGID_BODY_SB_FLEXION_DAMPING] = 0.1
tag[c4d.RIGID_BODY_SB_FLEXION_ELASTIC_LIMIT] = 0.1
tag[c4d.RIGID_BODY_SB_REST_LENGTH] = 0.1
tag[c4d.RIGID_BODY_SB_TEAR_OUT_LENGTH] = 0.1
tag[c4d.RIGID_BODY_SB_CLONE_ROTATION] = 0.1
tag[c4d.RIGID_BODY_SB_CLONE_ROTATION_DAMPING] = 0.1
tag[c4d.RIGID_BODY_SB_SHAPE_CONSERVATION] = 0.1
tag[c4d.RIGID_BODY_SB_SHAPE_VOLUME_CONSERVATION] = 0.1
tag[c4d.RIGID_BODY_SB_SHAPE_CONSERVATION_DAMPING] = 0.1
tag[c4d.RIGID_BODY_SB_SHAPE_CONSERVATION_ELASTIC_LIMIT] = 0.1
tag[c4d.RIGID_BODY_SB_PRESSURE] = 0.1
tag[c4d.RIGID_BODY_SB_VOLUME_CONSERVATION] = 0.1
tag[c4d.RIGID_BODY_SB_PRESSURE_DAMPING] = 0.1
tag[c4d.RIGID_BODY_CACHE_LOCAL] = True
tag[c4d.RIGID_BODY_CACHE_INCLUDE_COLLISIONS] = True
tag[c4d.RIGID_BODY_CACHE_USE] = True
#Second way, using the base container.
bc = tag.GetDataInstance()
bc.SetBool(c4d.RIGID_BODY_ENABLED,True)
bc.SetInt32(c4d.RIGID_BODY_DYNAMIC,c4d.RIGID_BODY_DYNAMIC_OFF)
bc.SetBool(c4d.RIGID_BODY_SHOW,True)
bc.SetInt32(c4d.RIGID_BODY_TRIGGER,c4d.RIGID_BODY_TRIGGER_IMMEDIATELY)
bc.SetFloat(c4d.RIGID_BODY_TRIGGER_ON_COLLISION_VELOCITY,0.1)
bc.SetBool(c4d.RIGID_BODY_USE_INITIAL_VELOCITY,True)
bc.SetVector(c4d.RIGID_BODY_INITIAL_LINEAR_VELOCITY, c4d.Vector(1.0,1.0,1.0)
bc.SetVector(c4d.RIGID_BODY_INITIAL_ANGULAR_VELOCITY, c4d.Vector(1.0,1.0,1.0)
bc.SetBool(c4d.RIGID_BODY_LOCAL_INITIAL_VELOCITY,True)
bc.SetBool(c4d.RIGID_BODY_DYNAMIC_TRANSITION,True)
bc.SetFloat(c4d.RIGID_BODY_SLEEPING_LINEAR_VELOCITY,0.1)
bc.SetFloat(c4d.RIGID_BODY_SLEEPING_ANGULAR_VELOCITY,0.1)
bc.SetInt32(c4d.RIGID_BODY_HIERARCHY,c4d.RIGID_BODY_HIERARCHY_NONE)
bc.SetInt32(c4d.RIGID_BODY_SPLIT_CACHE,c4d.RIGID_BODY_SPLIT_CACHE_OFF)
bc.SetBool(c4d.RIGID_BODY_SELF_COLLISIONS,True)
bc.SetBool(c4d.RIGID_BODY_SHAPE_DEFORMEDSTATE,True)
bc.SetInt32(c4d.RIGID_BODY_SHAPE,c4d.RIGID_BODY_SHAPE_DEFAULT)
bc.SetFloat(c4d.RIGID_BODY_SHAPE_SIZE_INCREMENT,0.1)
bc.SetBool(c4d.RIGID_BODY_SPECIFIC_MARGIN,True)
bc.SetFloat(c4d.RIGID_BODY_MARGIN,0.1)
bc.SetBool(c4d.RIGID_BODY_SB_KEEP_SHAPE,True)
bc.SetFloat(c4d.RIGID_BODY_RESTITUTION,0.1)
bc.SetFloat(c4d.RIGID_BODY_FRICTION,0.1)
bc.SetFloat(c4d.RIGID_BODY_COLLISION_NOISE,0.1)
bc.SetInt32(c4d.RIGID_BODY_MASS_SWITCH,c4d.RIGID_BODY_MASS_SWITCH_DEFAULT)
bc.SetFloat(c4d.RIGID_BODY_DENSITY,0.1)
bc.SetFloat(c4d.RIGID_BODY_MASS,0.1)
bc.SetFloat(c4d.RIGID_BODY_INERTIA_FACTOR,0.1)
bc.SetBool(c4d.RIGID_BODY_USE_CENTER_OF_MASS,True)
bc.SetVector(c4d.RIGID_BODY_CENTER_OF_MASS, c4d.Vector(1.0,1.0,1.0)
bc.SetFloat(c4d.RIGID_BODY_LINEAR_FOLLOW_STRENGTH,0.1)
bc.SetFloat(c4d.RIGID_BODY_ANGULAR_FOLLOW_STRENGTH,0.1)
bc.SetFloat(c4d.RIGID_BODY_LINEAR_DAMPING,0.1)
bc.SetFloat(c4d.RIGID_BODY_ANGULAR_DAMPING,0.1)
bc.SetInt32(c4d.RIGID_BODY_FORCE_MODE,c4d.RIGID_BODY_FORCE_MODE_INCLUDE)
bc.SetFloat(c4d.RIGID_BODY_AERODYNAMICS_DRAG,0.1)
bc.SetFloat(c4d.RIGID_BODY_AERODYNAMICS_LIFT,0.1)
bc.SetBool(c4d.RIGID_BODY_AERODYNAMICS_TWO_SIDED,True)
bc.SetInt32(c4d.RIGID_BODY_SOFT,c4d.RIGID_BODY_SOFT_OFF)
bc.SetBool(c4d.RIGID_BODY_SB_ACCURATE_SOLVER,True)
bc.SetFloat(c4d.RIGID_BODY_SB_STRUCTURAL,0.1)
bc.SetFloat(c4d.RIGID_BODY_SB_STRUCTURAL_DAMPING,0.1)
bc.SetFloat(c4d.RIGID_BODY_SB_ELASTIC_LIMIT,0.1)
bc.SetFloat(c4d.RIGID_BODY_SB_SHEAR,0.1)
bc.SetFloat(c4d.RIGID_BODY_SB_SHEAR_DAMPING,0.1)
bc.SetFloat(c4d.RIGID_BODY_SB_FLEXION,0.1)
bc.SetFloat(c4d.RIGID_BODY_SB_FLEXION_DAMPING,0.1)
bc.SetFloat(c4d.RIGID_BODY_SB_FLEXION_ELASTIC_LIMIT,0.1)
bc.SetFloat(c4d.RIGID_BODY_SB_REST_LENGTH,0.1)
bc.SetFloat(c4d.RIGID_BODY_SB_TEAR_OUT_LENGTH,0.1)
bc.SetFloat(c4d.RIGID_BODY_SB_CLONE_ROTATION,0.1)
bc.SetFloat(c4d.RIGID_BODY_SB_CLONE_ROTATION_DAMPING,0.1)
bc.SetFloat(c4d.RIGID_BODY_SB_SHAPE_CONSERVATION,0.1)
bc.SetFloat(c4d.RIGID_BODY_SB_SHAPE_VOLUME_CONSERVATION,0.1)
bc.SetFloat(c4d.RIGID_BODY_SB_SHAPE_CONSERVATION_DAMPING,0.1)
bc.SetFloat(c4d.RIGID_BODY_SB_SHAPE_CONSERVATION_ELASTIC_LIMIT,0.1)
bc.SetFloat(c4d.RIGID_BODY_SB_PRESSURE,0.1)
bc.SetFloat(c4d.RIGID_BODY_SB_VOLUME_CONSERVATION,0.1)
bc.SetFloat(c4d.RIGID_BODY_SB_PRESSURE_DAMPING,0.1)
bc.SetBool(c4d.RIGID_BODY_CACHE_LOCAL,True)
bc.SetBool(c4d.RIGID_BODY_CACHE_INCLUDE_COLLISIONS,True)
bc.SetBool(c4d.RIGID_BODY_CACHE_USE,True)
if __name__=='__main__':
main()
C++
#include "c4d.h"
#include "../dynamics/description/dynrigidbodytag.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(DynRigidBodyTag);
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(RIGID_BODY_ENABLED),GeData(true),flags);
pTag->SetParameter(DescID(RIGID_BODY_DYNAMIC),GeData(RIGID_BODY_DYNAMIC_OFF),flags);
pTag->SetParameter(DescID(RIGID_BODY_SHOW),GeData(true),flags);
pTag->SetParameter(DescID(RIGID_BODY_TRIGGER),GeData(RIGID_BODY_TRIGGER_IMMEDIATELY),flags);
pTag->SetParameter(DescID(RIGID_BODY_TRIGGER_ON_COLLISION_VELOCITY),GeData(0.1),flags);
pTag->SetParameter(DescID(RIGID_BODY_USE_INITIAL_VELOCITY),GeData(true),flags);
pTag->SetParameter(DescID(RIGID_BODY_INITIAL_LINEAR_VELOCITY),GeData(Vector(1.0,1.0,1.0)),flags);
pTag->SetParameter(DescID(RIGID_BODY_INITIAL_ANGULAR_VELOCITY),GeData(Vector(1.0,1.0,1.0)),flags);
pTag->SetParameter(DescID(RIGID_BODY_LOCAL_INITIAL_VELOCITY),GeData(true),flags);
pTag->SetParameter(DescID(RIGID_BODY_DYNAMIC_TRANSITION),GeData(true),flags);
pTag->SetParameter(DescID(RIGID_BODY_SLEEPING_LINEAR_VELOCITY),GeData(0.1),flags);
pTag->SetParameter(DescID(RIGID_BODY_SLEEPING_ANGULAR_VELOCITY),GeData(0.1),flags);
pTag->SetParameter(DescID(RIGID_BODY_HIERARCHY),GeData(RIGID_BODY_HIERARCHY_NONE),flags);
pTag->SetParameter(DescID(RIGID_BODY_SPLIT_CACHE),GeData(RIGID_BODY_SPLIT_CACHE_OFF),flags);
pTag->SetParameter(DescID(RIGID_BODY_SELF_COLLISIONS),GeData(true),flags);
pTag->SetParameter(DescID(RIGID_BODY_SHAPE_DEFORMEDSTATE),GeData(true),flags);
pTag->SetParameter(DescID(RIGID_BODY_SHAPE),GeData(RIGID_BODY_SHAPE_DEFAULT),flags);
pTag->SetParameter(DescID(RIGID_BODY_SHAPE_SIZE_INCREMENT),GeData(0.1),flags);
pTag->SetParameter(DescID(RIGID_BODY_SPECIFIC_MARGIN),GeData(true),flags);
pTag->SetParameter(DescID(RIGID_BODY_MARGIN),GeData(0.1),flags);
pTag->SetParameter(DescID(RIGID_BODY_SB_KEEP_SHAPE),GeData(true),flags);
pTag->SetParameter(DescID(RIGID_BODY_RESTITUTION),GeData(0.1),flags);
pTag->SetParameter(DescID(RIGID_BODY_FRICTION),GeData(0.1),flags);
pTag->SetParameter(DescID(RIGID_BODY_COLLISION_NOISE),GeData(0.1),flags);
pTag->SetParameter(DescID(RIGID_BODY_MASS_SWITCH),GeData(RIGID_BODY_MASS_SWITCH_DEFAULT),flags);
pTag->SetParameter(DescID(RIGID_BODY_DENSITY),GeData(0.1),flags);
pTag->SetParameter(DescID(RIGID_BODY_MASS),GeData(0.1),flags);
pTag->SetParameter(DescID(RIGID_BODY_INERTIA_FACTOR),GeData(0.1),flags);
pTag->SetParameter(DescID(RIGID_BODY_USE_CENTER_OF_MASS),GeData(true),flags);
pTag->SetParameter(DescID(RIGID_BODY_CENTER_OF_MASS),GeData(Vector(1.0,1.0,1.0)),flags);
pTag->SetParameter(DescID(RIGID_BODY_LINEAR_FOLLOW_STRENGTH),GeData(0.1),flags);
pTag->SetParameter(DescID(RIGID_BODY_ANGULAR_FOLLOW_STRENGTH),GeData(0.1),flags);
pTag->SetParameter(DescID(RIGID_BODY_LINEAR_DAMPING),GeData(0.1),flags);
pTag->SetParameter(DescID(RIGID_BODY_ANGULAR_DAMPING),GeData(0.1),flags);
pTag->SetParameter(DescID(RIGID_BODY_FORCE_MODE),GeData(RIGID_BODY_FORCE_MODE_INCLUDE),flags);
pTag->SetParameter(DescID(RIGID_BODY_AERODYNAMICS_DRAG),GeData(0.1),flags);
pTag->SetParameter(DescID(RIGID_BODY_AERODYNAMICS_LIFT),GeData(0.1),flags);
pTag->SetParameter(DescID(RIGID_BODY_AERODYNAMICS_TWO_SIDED),GeData(true),flags);
pTag->SetParameter(DescID(RIGID_BODY_SOFT),GeData(RIGID_BODY_SOFT_OFF),flags);
pTag->SetParameter(DescID(RIGID_BODY_SB_ACCURATE_SOLVER),GeData(true),flags);
pTag->SetParameter(DescID(RIGID_BODY_SB_STRUCTURAL),GeData(0.1),flags);
pTag->SetParameter(DescID(RIGID_BODY_SB_STRUCTURAL_DAMPING),GeData(0.1),flags);
pTag->SetParameter(DescID(RIGID_BODY_SB_ELASTIC_LIMIT),GeData(0.1),flags);
pTag->SetParameter(DescID(RIGID_BODY_SB_SHEAR),GeData(0.1),flags);
pTag->SetParameter(DescID(RIGID_BODY_SB_SHEAR_DAMPING),GeData(0.1),flags);
pTag->SetParameter(DescID(RIGID_BODY_SB_FLEXION),GeData(0.1),flags);
pTag->SetParameter(DescID(RIGID_BODY_SB_FLEXION_DAMPING),GeData(0.1),flags);
pTag->SetParameter(DescID(RIGID_BODY_SB_FLEXION_ELASTIC_LIMIT),GeData(0.1),flags);
pTag->SetParameter(DescID(RIGID_BODY_SB_REST_LENGTH),GeData(0.1),flags);
pTag->SetParameter(DescID(RIGID_BODY_SB_TEAR_OUT_LENGTH),GeData(0.1),flags);
pTag->SetParameter(DescID(RIGID_BODY_SB_CLONE_ROTATION),GeData(0.1),flags);
pTag->SetParameter(DescID(RIGID_BODY_SB_CLONE_ROTATION_DAMPING),GeData(0.1),flags);
pTag->SetParameter(DescID(RIGID_BODY_SB_SHAPE_CONSERVATION),GeData(0.1),flags);
pTag->SetParameter(DescID(RIGID_BODY_SB_SHAPE_VOLUME_CONSERVATION),GeData(0.1),flags);
pTag->SetParameter(DescID(RIGID_BODY_SB_SHAPE_CONSERVATION_DAMPING),GeData(0.1),flags);
pTag->SetParameter(DescID(RIGID_BODY_SB_SHAPE_CONSERVATION_ELASTIC_LIMIT),GeData(0.1),flags);
pTag->SetParameter(DescID(RIGID_BODY_SB_PRESSURE),GeData(0.1),flags);
pTag->SetParameter(DescID(RIGID_BODY_SB_VOLUME_CONSERVATION),GeData(0.1),flags);
pTag->SetParameter(DescID(RIGID_BODY_SB_PRESSURE_DAMPING),GeData(0.1),flags);
pTag->SetParameter(DescID(RIGID_BODY_CACHE_LOCAL),GeData(true),flags);
pTag->SetParameter(DescID(RIGID_BODY_CACHE_INCLUDE_COLLISIONS),GeData(true),flags);
pTag->SetParameter(DescID(RIGID_BODY_CACHE_USE),GeData(true),flags);
pTag->Message(MSG_UPDATE);
//Second way, using the base container.
BaseContainer *bc = pTag->GetDataInstance();
bc->SetBool(RIGID_BODY_ENABLED,true);
bc->SetInt32(RIGID_BODY_DYNAMIC,RIGID_BODY_DYNAMIC_OFF);
bc->SetBool(RIGID_BODY_SHOW,true);
bc->SetInt32(RIGID_BODY_TRIGGER,RIGID_BODY_TRIGGER_IMMEDIATELY);
bc->SetFloat(RIGID_BODY_TRIGGER_ON_COLLISION_VELOCITY,0.1);
bc->SetBool(RIGID_BODY_USE_INITIAL_VELOCITY,true);
bc->SetVector(RIGID_BODY_INITIAL_LINEAR_VELOCITY, c4d.Vector(1.0,1.0,1.0);
bc->SetVector(RIGID_BODY_INITIAL_ANGULAR_VELOCITY, c4d.Vector(1.0,1.0,1.0);
bc->SetBool(RIGID_BODY_LOCAL_INITIAL_VELOCITY,true);
bc->SetBool(RIGID_BODY_DYNAMIC_TRANSITION,true);
bc->SetFloat(RIGID_BODY_SLEEPING_LINEAR_VELOCITY,0.1);
bc->SetFloat(RIGID_BODY_SLEEPING_ANGULAR_VELOCITY,0.1);
bc->SetInt32(RIGID_BODY_HIERARCHY,RIGID_BODY_HIERARCHY_NONE);
bc->SetInt32(RIGID_BODY_SPLIT_CACHE,RIGID_BODY_SPLIT_CACHE_OFF);
bc->SetBool(RIGID_BODY_SELF_COLLISIONS,true);
bc->SetBool(RIGID_BODY_SHAPE_DEFORMEDSTATE,true);
bc->SetInt32(RIGID_BODY_SHAPE,RIGID_BODY_SHAPE_DEFAULT);
bc->SetFloat(RIGID_BODY_SHAPE_SIZE_INCREMENT,0.1);
bc->SetBool(RIGID_BODY_SPECIFIC_MARGIN,true);
bc->SetFloat(RIGID_BODY_MARGIN,0.1);
bc->SetBool(RIGID_BODY_SB_KEEP_SHAPE,true);
bc->SetFloat(RIGID_BODY_RESTITUTION,0.1);
bc->SetFloat(RIGID_BODY_FRICTION,0.1);
bc->SetFloat(RIGID_BODY_COLLISION_NOISE,0.1);
bc->SetInt32(RIGID_BODY_MASS_SWITCH,RIGID_BODY_MASS_SWITCH_DEFAULT);
bc->SetFloat(RIGID_BODY_DENSITY,0.1);
bc->SetFloat(RIGID_BODY_MASS,0.1);
bc->SetFloat(RIGID_BODY_INERTIA_FACTOR,0.1);
bc->SetBool(RIGID_BODY_USE_CENTER_OF_MASS,true);
bc->SetVector(RIGID_BODY_CENTER_OF_MASS, c4d.Vector(1.0,1.0,1.0);
bc->SetFloat(RIGID_BODY_LINEAR_FOLLOW_STRENGTH,0.1);
bc->SetFloat(RIGID_BODY_ANGULAR_FOLLOW_STRENGTH,0.1);
bc->SetFloat(RIGID_BODY_LINEAR_DAMPING,0.1);
bc->SetFloat(RIGID_BODY_ANGULAR_DAMPING,0.1);
bc->SetInt32(RIGID_BODY_FORCE_MODE,RIGID_BODY_FORCE_MODE_INCLUDE);
bc->SetFloat(RIGID_BODY_AERODYNAMICS_DRAG,0.1);
bc->SetFloat(RIGID_BODY_AERODYNAMICS_LIFT,0.1);
bc->SetBool(RIGID_BODY_AERODYNAMICS_TWO_SIDED,true);
bc->SetInt32(RIGID_BODY_SOFT,RIGID_BODY_SOFT_OFF);
bc->SetBool(RIGID_BODY_SB_ACCURATE_SOLVER,true);
bc->SetFloat(RIGID_BODY_SB_STRUCTURAL,0.1);
bc->SetFloat(RIGID_BODY_SB_STRUCTURAL_DAMPING,0.1);
bc->SetFloat(RIGID_BODY_SB_ELASTIC_LIMIT,0.1);
bc->SetFloat(RIGID_BODY_SB_SHEAR,0.1);
bc->SetFloat(RIGID_BODY_SB_SHEAR_DAMPING,0.1);
bc->SetFloat(RIGID_BODY_SB_FLEXION,0.1);
bc->SetFloat(RIGID_BODY_SB_FLEXION_DAMPING,0.1);
bc->SetFloat(RIGID_BODY_SB_FLEXION_ELASTIC_LIMIT,0.1);
bc->SetFloat(RIGID_BODY_SB_REST_LENGTH,0.1);
bc->SetFloat(RIGID_BODY_SB_TEAR_OUT_LENGTH,0.1);
bc->SetFloat(RIGID_BODY_SB_CLONE_ROTATION,0.1);
bc->SetFloat(RIGID_BODY_SB_CLONE_ROTATION_DAMPING,0.1);
bc->SetFloat(RIGID_BODY_SB_SHAPE_CONSERVATION,0.1);
bc->SetFloat(RIGID_BODY_SB_SHAPE_VOLUME_CONSERVATION,0.1);
bc->SetFloat(RIGID_BODY_SB_SHAPE_CONSERVATION_DAMPING,0.1);
bc->SetFloat(RIGID_BODY_SB_SHAPE_CONSERVATION_ELASTIC_LIMIT,0.1);
bc->SetFloat(RIGID_BODY_SB_PRESSURE,0.1);
bc->SetFloat(RIGID_BODY_SB_VOLUME_CONSERVATION,0.1);
bc->SetFloat(RIGID_BODY_SB_PRESSURE_DAMPING,0.1);
bc->SetBool(RIGID_BODY_CACHE_LOCAL,true);
bc->SetBool(RIGID_BODY_CACHE_INCLUDE_COLLISIONS,true);
bc->SetBool(RIGID_BODY_CACHE_USE,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.RIGID_BODY_SET_INITIAL_STATE)
c4d.CallButton(tag,c4d.RIGID_BODY_CLEAR_INITIAL_STATE)
c4d.CallButton(tag,c4d.RIGID_BODY_CACHE_BAKE)
c4d.CallButton(tag,c4d.RIGID_BODY_CACHE_BAKE_ALL)
c4d.CallButton(tag,c4d.RIGID_BODY_CACHE_CLEAR)
c4d.CallButton(tag,c4d.RIGID_BODY_CACHE_CLEAR_ALL)
C++
DescriptionCommand dc;
dc.id = DescID(RIGID_BODY_SET_INITIAL_STATE);
pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(RIGID_BODY_CLEAR_INITIAL_STATE);
pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(RIGID_BODY_CACHE_BAKE);
pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(RIGID_BODY_CACHE_BAKE_ALL);
pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(RIGID_BODY_CACHE_CLEAR);
pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(RIGID_BODY_CACHE_CLEAR_ALL);
pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);