Tcaconstraint
Attributes
-
ENGLISH NAME : Constraint
-
NAME : Tcaconstraint
-
INCLUDE : Texpression
-
PATH : ca/description/tcaconstraint.res
-
PLUGIN : ca
-
MAXON online help (may not exist): TCACONSTRAINT
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.Tcaconstraint)
doc.InsertObject(obj)
c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
#You can set parameters two different ways.
#First way
tag[c4d.ID_CA_CONSTRAINT_TAG_PSR] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_PARENT] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_UP] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_AIM] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_CLAMP] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_SPRING] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_MIRROR] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_COLLISION] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_FRAMEUPDATE] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_USE_INITIAL_STATE] = True
tag[c4d.ID_CA_CONSTRAINT_INITIAL_STATE_VECTOR_P] = c4d.Vector(1.0,1.0,1.0)
tag[c4d.ID_CA_CONSTRAINT_INITIAL_STATE_VECTOR_R] = c4d.Vector(1.0,1.0,1.0)
tag[c4d.ID_CA_CONSTRAINT_INITIAL_STATE_VECTOR_S] = c4d.Vector(1.0,1.0,1.0)
tag[c4d.ID_CA_CONSTRAINT_TAG_PARENT_TWEIGHT] = 0.1
tag[c4d.ID_CA_CONSTRAINT_TAG_PARENT_FROZEN] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_PARENT_RESET] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_PARENT_INTERACTIVEOFFSET] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_PARENT_MAINTAIN] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_PARENT_P_OFFSET] = c4d.Vector(1.0,1.0,1.0)
tag[c4d.ID_CA_CONSTRAINT_TAG_PARENT_R_OFFSET] = c4d.Vector(1.0,1.0,1.0)
tag[c4d.ID_CA_CONSTRAINT_TAG_PARENT_S_OFFSET] = c4d.Vector(1.0,1.0,1.0)
tag[c4d.ID_CA_CONSTRAINT_TAG_PARENT_WEIGHT] = 0.1
tag[c4d.ID_CA_CONSTRAINT_TAG_PARENT_P] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_PARENT_R] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_PARENT_S] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_PARENT_P_LOCALTRANFORM] = c4d.Vector(1.0,1.0,1.0)
tag[c4d.ID_CA_CONSTRAINT_TAG_PARENT_R_LOCALTRANFORM] = c4d.Vector(1.0,1.0,1.0)
tag[c4d.ID_CA_CONSTRAINT_TAG_PARENT_LOCALTRANFORM_ROTORDER] = c4d.ID_CA_CONSTRAINT_TAG_PARENT_LOCALTRANFORM_ROTORDER_HPB
tag[c4d.ID_CA_CONSTRAINT_TAG_PARENT_S_LOCALTRANFORM] = c4d.Vector(1.0,1.0,1.0)
tag[c4d.ID_CA_CONSTRAINT_TAG_PARENT_LOCALTRANFORM_UPDATEBUTTON] = c4d.ID_CA_CONSTRAINT_TAG_PARENT_LOCALTRANFORM_UPDATEALL
tag[c4d.ID_CA_CONSTRAINT_TAG_PARENT_LOCALTRANFORM_RECORDBUTTON] = c4d.ID_CA_CONSTRAINT_TAG_PARENT_LOCALTRANFORM_RECORDOPTIMIZED
tag[c4d.ID_CA_CONSTRAINT_TAG_PSR_TWEIGHT] = 0.1
tag[c4d.ID_CA_CONSTRAINT_TAG_PSR_MAINTAIN] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_PSR_P_OFFSET] = c4d.Vector(1.0,1.0,1.0)
tag[c4d.ID_CA_CONSTRAINT_TAG_PSR_R_OFFSET] = c4d.Vector(1.0,1.0,1.0)
tag[c4d.ID_CA_CONSTRAINT_TAG_PSR_S_OFFSET] = c4d.Vector(1.0,1.0,1.0)
tag[c4d.ID_CA_CONSTRAINT_TAG_PSR_CONSTRAIN_P_X] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_PSR_CONSTRAIN_R_X] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_PSR_CONSTRAIN_S_X] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_PSR_CONSTRAIN_P_Y] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_PSR_CONSTRAIN_R_Y] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_PSR_CONSTRAIN_S_Y] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_PSR_CONSTRAIN_P_Z] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_PSR_CONSTRAIN_R_Z] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_PSR_CONSTRAIN_S_Z] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_LOCAL_P] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_LOCAL_R] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_LOCAL_S] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_PSR_WEIGHT] = 0.1
tag[c4d.ID_CA_CONSTRAINT_TAG_PSR_P] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_PSR_R] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_PSR_S] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_MIRROR_TWEIGHT] = 0.1
tag[c4d.ID_CA_CONSTRAINT_TAG_MIRROR_P_OFFSET] = c4d.Vector(1.0,1.0,1.0)
tag[c4d.ID_CA_CONSTRAINT_TAG_MIRROR_R_OFFSET] = c4d.Vector(1.0,1.0,1.0)
tag[c4d.ID_CA_CONSTRAINT_TAG_MIRROR_WEIGHT] = 0.1
tag[c4d.ID_CA_CONSTRAINT_TAG_MIRROR_P] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_MIRROR_R] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_MIRROR_ORIGIN] = c4d.ID_CA_CONSTRAINT_TAG_MIRROR_ORIGIN_WORLD
tag[c4d.ID_CA_CONSTRAINT_TAG_MIRROR_PLANE] = c4d.ID_CA_CONSTRAINT_TAG_MIRROR_PLANE_XY
tag[c4d.ID_CA_CONSTRAINT_TAG_MIRROR_AXIS] = c4d.ID_CA_CONSTRAINT_TAG_MIRROR_AXIS_XY
tag[c4d.ID_CA_CONSTRAINT_TAG_CLAMP_TWEIGHT] = 0.1
tag[c4d.ID_CA_CONSTRAINT_TAG_CLAMP_SHOW] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_CLAMP_STICK] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_CLAMP_NORMALS] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_CLAMP_WEIGHT] = 0.1
tag[c4d.ID_CA_CONSTRAINT_TAG_CLAMP_DISTANCE] = 0.1
tag[c4d.ID_CA_CONSTRAINT_TAG_CLAMP_TO] = c4d.ID_CA_CONSTRAINT_TAG_CLAMP_TO_ORIGIN
tag[c4d.ID_CA_CONSTRAINT_TAG_CLAMP_MODE] = c4d.ID_CA_CONSTRAINT_TAG_CLAMP_MODE_MIN
tag[c4d.ID_CA_CONSTRAINT_TAG_CLAMP_ALIGN] = c4d.ID_CA_CONSTRAINT_TAG_AXIS_XP
tag[c4d.ID_CA_CONSTRAINT_TAG_CLAMP_ALIGN_TO] = c4d.ID_CA_CONSTRAINT_TAG_CLAMP_ALIGN_NONE
tag[c4d.ID_CA_CONSTRAINT_TAG_CLAMP_AXIS] = c4d.ID_CA_CONSTRAINT_TAG_AXIS_X
tag[c4d.ID_CA_CONSTRAINT_TAG_CLAMP_PLANE] = c4d.ID_CA_CONSTRAINT_TAG_PLANE_XY
tag[c4d.ID_CA_CONSTRAINT_TAG_SPRING_TWEIGHT] = 0.1
tag[c4d.ID_CA_CONSTRAINT_TAG_SPRING_DRAG] = 0.1
tag[c4d.ID_CA_CONSTRAINT_TAG_SPRING_GRAVITY] = 0.1
tag[c4d.ID_CA_CONSTRAINT_TAG_SPRING_P_OFFSET] = c4d.Vector(1.0,1.0,1.0)
tag[c4d.ID_CA_CONSTRAINT_TAG_SPRING_R_OFFSET] = c4d.Vector(1.0,1.0,1.0)
tag[c4d.ID_CA_CONSTRAINT_TAG_SPRING_S_OFFSET] = c4d.Vector(1.0,1.0,1.0)
tag[c4d.ID_CA_CONSTRAINT_TAG_SPRING_P] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_SPRING_R] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_SPRING_S] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_SPRING_WEIGHT] = 0.1
tag[c4d.ID_CA_CONSTRAINT_TAG_SPRING_LENGTH] = 0.1
tag[c4d.ID_CA_CONSTRAINT_TAG_SPRING_STIFFNESS] = 0.1
tag[c4d.ID_CA_CONSTRAINT_TAG_AIM_TWEIGHT] = 0.1
tag[c4d.ID_CA_CONSTRAINT_TAG_AIM_MAINTAIN] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_AIM_OFFSET] = c4d.Vector(1.0,1.0,1.0)
tag[c4d.ID_CA_CONSTRAINT_TAG_AIM_CONSTRAIN_X] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_AIM_CONSTRAIN_Y] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_AIM_CONSTRAIN_Z] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_AIM_WEIGHT] = 0.1
tag[c4d.ID_CA_CONSTRAINT_TAG_AIM_AXIS] = c4d.ID_CA_CONSTRAINT_TAG_AXIS_XP
tag[c4d.ID_CA_CONSTRAINT_TAG_UP_TWEIGHT] = 0.1
tag[c4d.ID_CA_CONSTRAINT_TAG_UP_MAINTAIN] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_UP_OFFSET] = c4d.Vector(1.0,1.0,1.0)
tag[c4d.ID_CA_CONSTRAINT_TAG_UP_CONSTRAIN_X] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_UP_CONSTRAIN_Y] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_UP_CONSTRAIN_Z] = True
tag[c4d.ID_CA_CONSTRAINT_TAG_UP_AXIS] = c4d.ID_CA_CONSTRAINT_TAG_AXIS_XP
tag[c4d.ID_CA_CONSTRAINT_TAG_UP_ROT_AXIS] = c4d.ID_CA_CONSTRAINT_TAG_AXIS_XP
tag[c4d.ID_CA_CONSTRAINT_TAG_UP_WEIGHT] = 0.1
tag[c4d.ID_CA_CONSTRAINT_TAG_COLLISION_TWEIGHT] = 0.1
#Second way, using the base container.
bc = tag.GetDataInstance()
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_PSR,True)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_PARENT,True)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_UP,True)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_AIM,True)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_CLAMP,True)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_SPRING,True)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_MIRROR,True)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_COLLISION,True)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_FRAMEUPDATE,True)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_USE_INITIAL_STATE,True)
bc.SetVector(c4d.ID_CA_CONSTRAINT_INITIAL_STATE_VECTOR_P, c4d.Vector(1.0,1.0,1.0)
bc.SetVector(c4d.ID_CA_CONSTRAINT_INITIAL_STATE_VECTOR_R, c4d.Vector(1.0,1.0,1.0)
bc.SetVector(c4d.ID_CA_CONSTRAINT_INITIAL_STATE_VECTOR_S, c4d.Vector(1.0,1.0,1.0)
bc.SetFloat(c4d.ID_CA_CONSTRAINT_TAG_PARENT_TWEIGHT,0.1)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_PARENT_FROZEN,True)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_PARENT_RESET,True)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_PARENT_INTERACTIVEOFFSET,True)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_PARENT_MAINTAIN,True)
bc.SetVector(c4d.ID_CA_CONSTRAINT_TAG_PARENT_P_OFFSET, c4d.Vector(1.0,1.0,1.0)
bc.SetVector(c4d.ID_CA_CONSTRAINT_TAG_PARENT_R_OFFSET, c4d.Vector(1.0,1.0,1.0)
bc.SetVector(c4d.ID_CA_CONSTRAINT_TAG_PARENT_S_OFFSET, c4d.Vector(1.0,1.0,1.0)
bc.SetFloat(c4d.ID_CA_CONSTRAINT_TAG_PARENT_WEIGHT,0.1)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_PARENT_P,True)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_PARENT_R,True)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_PARENT_S,True)
bc.SetVector(c4d.ID_CA_CONSTRAINT_TAG_PARENT_P_LOCALTRANFORM, c4d.Vector(1.0,1.0,1.0)
bc.SetVector(c4d.ID_CA_CONSTRAINT_TAG_PARENT_R_LOCALTRANFORM, c4d.Vector(1.0,1.0,1.0)
bc.SetInt32(c4d.ID_CA_CONSTRAINT_TAG_PARENT_LOCALTRANFORM_ROTORDER,c4d.ID_CA_CONSTRAINT_TAG_PARENT_LOCALTRANFORM_ROTORDER_HPB)
bc.SetVector(c4d.ID_CA_CONSTRAINT_TAG_PARENT_S_LOCALTRANFORM, c4d.Vector(1.0,1.0,1.0)
bc.SetInt32(c4d.ID_CA_CONSTRAINT_TAG_PARENT_LOCALTRANFORM_UPDATEBUTTON,c4d.ID_CA_CONSTRAINT_TAG_PARENT_LOCALTRANFORM_UPDATEALL)
bc.SetInt32(c4d.ID_CA_CONSTRAINT_TAG_PARENT_LOCALTRANFORM_RECORDBUTTON,c4d.ID_CA_CONSTRAINT_TAG_PARENT_LOCALTRANFORM_RECORDOPTIMIZED)
bc.SetFloat(c4d.ID_CA_CONSTRAINT_TAG_PSR_TWEIGHT,0.1)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_PSR_MAINTAIN,True)
bc.SetVector(c4d.ID_CA_CONSTRAINT_TAG_PSR_P_OFFSET, c4d.Vector(1.0,1.0,1.0)
bc.SetVector(c4d.ID_CA_CONSTRAINT_TAG_PSR_R_OFFSET, c4d.Vector(1.0,1.0,1.0)
bc.SetVector(c4d.ID_CA_CONSTRAINT_TAG_PSR_S_OFFSET, c4d.Vector(1.0,1.0,1.0)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_PSR_CONSTRAIN_P_X,True)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_PSR_CONSTRAIN_R_X,True)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_PSR_CONSTRAIN_S_X,True)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_PSR_CONSTRAIN_P_Y,True)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_PSR_CONSTRAIN_R_Y,True)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_PSR_CONSTRAIN_S_Y,True)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_PSR_CONSTRAIN_P_Z,True)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_PSR_CONSTRAIN_R_Z,True)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_PSR_CONSTRAIN_S_Z,True)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_LOCAL_P,True)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_LOCAL_R,True)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_LOCAL_S,True)
bc.SetFloat(c4d.ID_CA_CONSTRAINT_TAG_PSR_WEIGHT,0.1)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_PSR_P,True)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_PSR_R,True)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_PSR_S,True)
bc.SetFloat(c4d.ID_CA_CONSTRAINT_TAG_MIRROR_TWEIGHT,0.1)
bc.SetVector(c4d.ID_CA_CONSTRAINT_TAG_MIRROR_P_OFFSET, c4d.Vector(1.0,1.0,1.0)
bc.SetVector(c4d.ID_CA_CONSTRAINT_TAG_MIRROR_R_OFFSET, c4d.Vector(1.0,1.0,1.0)
bc.SetFloat(c4d.ID_CA_CONSTRAINT_TAG_MIRROR_WEIGHT,0.1)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_MIRROR_P,True)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_MIRROR_R,True)
bc.SetInt32(c4d.ID_CA_CONSTRAINT_TAG_MIRROR_ORIGIN,c4d.ID_CA_CONSTRAINT_TAG_MIRROR_ORIGIN_WORLD)
bc.SetInt32(c4d.ID_CA_CONSTRAINT_TAG_MIRROR_PLANE,c4d.ID_CA_CONSTRAINT_TAG_MIRROR_PLANE_XY)
bc.SetInt32(c4d.ID_CA_CONSTRAINT_TAG_MIRROR_AXIS,c4d.ID_CA_CONSTRAINT_TAG_MIRROR_AXIS_XY)
bc.SetFloat(c4d.ID_CA_CONSTRAINT_TAG_CLAMP_TWEIGHT,0.1)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_CLAMP_SHOW,True)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_CLAMP_STICK,True)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_CLAMP_NORMALS,True)
bc.SetFloat(c4d.ID_CA_CONSTRAINT_TAG_CLAMP_WEIGHT,0.1)
bc.SetFloat(c4d.ID_CA_CONSTRAINT_TAG_CLAMP_DISTANCE,0.1)
bc.SetInt32(c4d.ID_CA_CONSTRAINT_TAG_CLAMP_TO,c4d.ID_CA_CONSTRAINT_TAG_CLAMP_TO_ORIGIN)
bc.SetInt32(c4d.ID_CA_CONSTRAINT_TAG_CLAMP_MODE,c4d.ID_CA_CONSTRAINT_TAG_CLAMP_MODE_MIN)
bc.SetInt32(c4d.ID_CA_CONSTRAINT_TAG_CLAMP_ALIGN,c4d.ID_CA_CONSTRAINT_TAG_AXIS_XP)
bc.SetInt32(c4d.ID_CA_CONSTRAINT_TAG_CLAMP_ALIGN_TO,c4d.ID_CA_CONSTRAINT_TAG_CLAMP_ALIGN_NONE)
bc.SetInt32(c4d.ID_CA_CONSTRAINT_TAG_CLAMP_AXIS,c4d.ID_CA_CONSTRAINT_TAG_AXIS_X)
bc.SetInt32(c4d.ID_CA_CONSTRAINT_TAG_CLAMP_PLANE,c4d.ID_CA_CONSTRAINT_TAG_PLANE_XY)
bc.SetFloat(c4d.ID_CA_CONSTRAINT_TAG_SPRING_TWEIGHT,0.1)
bc.SetFloat(c4d.ID_CA_CONSTRAINT_TAG_SPRING_DRAG,0.1)
bc.SetFloat(c4d.ID_CA_CONSTRAINT_TAG_SPRING_GRAVITY,0.1)
bc.SetVector(c4d.ID_CA_CONSTRAINT_TAG_SPRING_P_OFFSET, c4d.Vector(1.0,1.0,1.0)
bc.SetVector(c4d.ID_CA_CONSTRAINT_TAG_SPRING_R_OFFSET, c4d.Vector(1.0,1.0,1.0)
bc.SetVector(c4d.ID_CA_CONSTRAINT_TAG_SPRING_S_OFFSET, c4d.Vector(1.0,1.0,1.0)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_SPRING_P,True)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_SPRING_R,True)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_SPRING_S,True)
bc.SetFloat(c4d.ID_CA_CONSTRAINT_TAG_SPRING_WEIGHT,0.1)
bc.SetFloat(c4d.ID_CA_CONSTRAINT_TAG_SPRING_LENGTH,0.1)
bc.SetFloat(c4d.ID_CA_CONSTRAINT_TAG_SPRING_STIFFNESS,0.1)
bc.SetFloat(c4d.ID_CA_CONSTRAINT_TAG_AIM_TWEIGHT,0.1)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_AIM_MAINTAIN,True)
bc.SetVector(c4d.ID_CA_CONSTRAINT_TAG_AIM_OFFSET, c4d.Vector(1.0,1.0,1.0)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_AIM_CONSTRAIN_X,True)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_AIM_CONSTRAIN_Y,True)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_AIM_CONSTRAIN_Z,True)
bc.SetFloat(c4d.ID_CA_CONSTRAINT_TAG_AIM_WEIGHT,0.1)
bc.SetInt32(c4d.ID_CA_CONSTRAINT_TAG_AIM_AXIS,c4d.ID_CA_CONSTRAINT_TAG_AXIS_XP)
bc.SetFloat(c4d.ID_CA_CONSTRAINT_TAG_UP_TWEIGHT,0.1)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_UP_MAINTAIN,True)
bc.SetVector(c4d.ID_CA_CONSTRAINT_TAG_UP_OFFSET, c4d.Vector(1.0,1.0,1.0)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_UP_CONSTRAIN_X,True)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_UP_CONSTRAIN_Y,True)
bc.SetBool(c4d.ID_CA_CONSTRAINT_TAG_UP_CONSTRAIN_Z,True)
bc.SetInt32(c4d.ID_CA_CONSTRAINT_TAG_UP_AXIS,c4d.ID_CA_CONSTRAINT_TAG_AXIS_XP)
bc.SetInt32(c4d.ID_CA_CONSTRAINT_TAG_UP_ROT_AXIS,c4d.ID_CA_CONSTRAINT_TAG_AXIS_XP)
bc.SetFloat(c4d.ID_CA_CONSTRAINT_TAG_UP_WEIGHT,0.1)
bc.SetFloat(c4d.ID_CA_CONSTRAINT_TAG_COLLISION_TWEIGHT,0.1)
if __name__=='__main__':
main()
C++
#include "c4d.h"
#include "../ca/description/tcaconstraint.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(Tcaconstraint);
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(ID_CA_CONSTRAINT_TAG_PSR),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PARENT),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_UP),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_AIM),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_CLAMP),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_SPRING),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_MIRROR),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_COLLISION),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_FRAMEUPDATE),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_USE_INITIAL_STATE),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_INITIAL_STATE_VECTOR_P),GeData(Vector(1.0,1.0,1.0)),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_INITIAL_STATE_VECTOR_R),GeData(Vector(1.0,1.0,1.0)),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_INITIAL_STATE_VECTOR_S),GeData(Vector(1.0,1.0,1.0)),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PARENT_TWEIGHT),GeData(0.1),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PARENT_FROZEN),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PARENT_RESET),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PARENT_INTERACTIVEOFFSET),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PARENT_MAINTAIN),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PARENT_P_OFFSET),GeData(Vector(1.0,1.0,1.0)),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PARENT_R_OFFSET),GeData(Vector(1.0,1.0,1.0)),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PARENT_S_OFFSET),GeData(Vector(1.0,1.0,1.0)),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PARENT_WEIGHT),GeData(0.1),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PARENT_P),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PARENT_R),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PARENT_S),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PARENT_P_LOCALTRANFORM),GeData(Vector(1.0,1.0,1.0)),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PARENT_R_LOCALTRANFORM),GeData(Vector(1.0,1.0,1.0)),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PARENT_LOCALTRANFORM_ROTORDER),GeData(ID_CA_CONSTRAINT_TAG_PARENT_LOCALTRANFORM_ROTORDER_HPB),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PARENT_S_LOCALTRANFORM),GeData(Vector(1.0,1.0,1.0)),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PARENT_LOCALTRANFORM_UPDATEBUTTON),GeData(ID_CA_CONSTRAINT_TAG_PARENT_LOCALTRANFORM_UPDATEALL),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PARENT_LOCALTRANFORM_RECORDBUTTON),GeData(ID_CA_CONSTRAINT_TAG_PARENT_LOCALTRANFORM_RECORDOPTIMIZED),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PSR_TWEIGHT),GeData(0.1),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PSR_MAINTAIN),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PSR_P_OFFSET),GeData(Vector(1.0,1.0,1.0)),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PSR_R_OFFSET),GeData(Vector(1.0,1.0,1.0)),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PSR_S_OFFSET),GeData(Vector(1.0,1.0,1.0)),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PSR_CONSTRAIN_P_X),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PSR_CONSTRAIN_R_X),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PSR_CONSTRAIN_S_X),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PSR_CONSTRAIN_P_Y),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PSR_CONSTRAIN_R_Y),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PSR_CONSTRAIN_S_Y),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PSR_CONSTRAIN_P_Z),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PSR_CONSTRAIN_R_Z),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PSR_CONSTRAIN_S_Z),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_LOCAL_P),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_LOCAL_R),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_LOCAL_S),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PSR_WEIGHT),GeData(0.1),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PSR_P),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PSR_R),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_PSR_S),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_MIRROR_TWEIGHT),GeData(0.1),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_MIRROR_P_OFFSET),GeData(Vector(1.0,1.0,1.0)),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_MIRROR_R_OFFSET),GeData(Vector(1.0,1.0,1.0)),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_MIRROR_WEIGHT),GeData(0.1),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_MIRROR_P),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_MIRROR_R),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_MIRROR_ORIGIN),GeData(ID_CA_CONSTRAINT_TAG_MIRROR_ORIGIN_WORLD),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_MIRROR_PLANE),GeData(ID_CA_CONSTRAINT_TAG_MIRROR_PLANE_XY),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_MIRROR_AXIS),GeData(ID_CA_CONSTRAINT_TAG_MIRROR_AXIS_XY),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_CLAMP_TWEIGHT),GeData(0.1),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_CLAMP_SHOW),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_CLAMP_STICK),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_CLAMP_NORMALS),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_CLAMP_WEIGHT),GeData(0.1),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_CLAMP_DISTANCE),GeData(0.1),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_CLAMP_TO),GeData(ID_CA_CONSTRAINT_TAG_CLAMP_TO_ORIGIN),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_CLAMP_MODE),GeData(ID_CA_CONSTRAINT_TAG_CLAMP_MODE_MIN),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_CLAMP_ALIGN),GeData(ID_CA_CONSTRAINT_TAG_AXIS_XP),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_CLAMP_ALIGN_TO),GeData(ID_CA_CONSTRAINT_TAG_CLAMP_ALIGN_NONE),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_CLAMP_AXIS),GeData(ID_CA_CONSTRAINT_TAG_AXIS_X),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_CLAMP_PLANE),GeData(ID_CA_CONSTRAINT_TAG_PLANE_XY),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_SPRING_TWEIGHT),GeData(0.1),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_SPRING_DRAG),GeData(0.1),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_SPRING_GRAVITY),GeData(0.1),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_SPRING_P_OFFSET),GeData(Vector(1.0,1.0,1.0)),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_SPRING_R_OFFSET),GeData(Vector(1.0,1.0,1.0)),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_SPRING_S_OFFSET),GeData(Vector(1.0,1.0,1.0)),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_SPRING_P),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_SPRING_R),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_SPRING_S),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_SPRING_WEIGHT),GeData(0.1),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_SPRING_LENGTH),GeData(0.1),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_SPRING_STIFFNESS),GeData(0.1),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_AIM_TWEIGHT),GeData(0.1),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_AIM_MAINTAIN),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_AIM_OFFSET),GeData(Vector(1.0,1.0,1.0)),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_AIM_CONSTRAIN_X),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_AIM_CONSTRAIN_Y),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_AIM_CONSTRAIN_Z),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_AIM_WEIGHT),GeData(0.1),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_AIM_AXIS),GeData(ID_CA_CONSTRAINT_TAG_AXIS_XP),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_UP_TWEIGHT),GeData(0.1),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_UP_MAINTAIN),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_UP_OFFSET),GeData(Vector(1.0,1.0,1.0)),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_UP_CONSTRAIN_X),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_UP_CONSTRAIN_Y),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_UP_CONSTRAIN_Z),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_UP_AXIS),GeData(ID_CA_CONSTRAINT_TAG_AXIS_XP),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_UP_ROT_AXIS),GeData(ID_CA_CONSTRAINT_TAG_AXIS_XP),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_UP_WEIGHT),GeData(0.1),flags);
pTag->SetParameter(DescID(ID_CA_CONSTRAINT_TAG_COLLISION_TWEIGHT),GeData(0.1),flags);
pTag->Message(MSG_UPDATE);
//Second way, using the base container.
BaseContainer *bc = pTag->GetDataInstance();
bc->SetBool(ID_CA_CONSTRAINT_TAG_PSR,true);
bc->SetBool(ID_CA_CONSTRAINT_TAG_PARENT,true);
bc->SetBool(ID_CA_CONSTRAINT_TAG_UP,true);
bc->SetBool(ID_CA_CONSTRAINT_TAG_AIM,true);
bc->SetBool(ID_CA_CONSTRAINT_TAG_CLAMP,true);
bc->SetBool(ID_CA_CONSTRAINT_TAG_SPRING,true);
bc->SetBool(ID_CA_CONSTRAINT_TAG_MIRROR,true);
bc->SetBool(ID_CA_CONSTRAINT_TAG_COLLISION,true);
bc->SetBool(ID_CA_CONSTRAINT_TAG_FRAMEUPDATE,true);
bc->SetBool(ID_CA_CONSTRAINT_TAG_USE_INITIAL_STATE,true);
bc->SetVector(ID_CA_CONSTRAINT_INITIAL_STATE_VECTOR_P, c4d.Vector(1.0,1.0,1.0);
bc->SetVector(ID_CA_CONSTRAINT_INITIAL_STATE_VECTOR_R, c4d.Vector(1.0,1.0,1.0);
bc->SetVector(ID_CA_CONSTRAINT_INITIAL_STATE_VECTOR_S, c4d.Vector(1.0,1.0,1.0);
bc->SetFloat(ID_CA_CONSTRAINT_TAG_PARENT_TWEIGHT,0.1);
bc->SetBool(ID_CA_CONSTRAINT_TAG_PARENT_FROZEN,true);
bc->SetBool(ID_CA_CONSTRAINT_TAG_PARENT_RESET,true);
bc->SetBool(ID_CA_CONSTRAINT_TAG_PARENT_INTERACTIVEOFFSET,true);
bc->SetBool(ID_CA_CONSTRAINT_TAG_PARENT_MAINTAIN,true);
bc->SetVector(ID_CA_CONSTRAINT_TAG_PARENT_P_OFFSET, c4d.Vector(1.0,1.0,1.0);
bc->SetVector(ID_CA_CONSTRAINT_TAG_PARENT_R_OFFSET, c4d.Vector(1.0,1.0,1.0);
bc->SetVector(ID_CA_CONSTRAINT_TAG_PARENT_S_OFFSET, c4d.Vector(1.0,1.0,1.0);
bc->SetFloat(ID_CA_CONSTRAINT_TAG_PARENT_WEIGHT,0.1);
bc->SetBool(ID_CA_CONSTRAINT_TAG_PARENT_P,true);
bc->SetBool(ID_CA_CONSTRAINT_TAG_PARENT_R,true);
bc->SetBool(ID_CA_CONSTRAINT_TAG_PARENT_S,true);
bc->SetVector(ID_CA_CONSTRAINT_TAG_PARENT_P_LOCALTRANFORM, c4d.Vector(1.0,1.0,1.0);
bc->SetVector(ID_CA_CONSTRAINT_TAG_PARENT_R_LOCALTRANFORM, c4d.Vector(1.0,1.0,1.0);
bc->SetInt32(ID_CA_CONSTRAINT_TAG_PARENT_LOCALTRANFORM_ROTORDER,ID_CA_CONSTRAINT_TAG_PARENT_LOCALTRANFORM_ROTORDER_HPB);
bc->SetVector(ID_CA_CONSTRAINT_TAG_PARENT_S_LOCALTRANFORM, c4d.Vector(1.0,1.0,1.0);
bc->SetInt32(ID_CA_CONSTRAINT_TAG_PARENT_LOCALTRANFORM_UPDATEBUTTON,ID_CA_CONSTRAINT_TAG_PARENT_LOCALTRANFORM_UPDATEALL);
bc->SetInt32(ID_CA_CONSTRAINT_TAG_PARENT_LOCALTRANFORM_RECORDBUTTON,ID_CA_CONSTRAINT_TAG_PARENT_LOCALTRANFORM_RECORDOPTIMIZED);
bc->SetFloat(ID_CA_CONSTRAINT_TAG_PSR_TWEIGHT,0.1);
bc->SetBool(ID_CA_CONSTRAINT_TAG_PSR_MAINTAIN,true);
bc->SetVector(ID_CA_CONSTRAINT_TAG_PSR_P_OFFSET, c4d.Vector(1.0,1.0,1.0);
bc->SetVector(ID_CA_CONSTRAINT_TAG_PSR_R_OFFSET, c4d.Vector(1.0,1.0,1.0);
bc->SetVector(ID_CA_CONSTRAINT_TAG_PSR_S_OFFSET, c4d.Vector(1.0,1.0,1.0);
bc->SetBool(ID_CA_CONSTRAINT_TAG_PSR_CONSTRAIN_P_X,true);
bc->SetBool(ID_CA_CONSTRAINT_TAG_PSR_CONSTRAIN_R_X,true);
bc->SetBool(ID_CA_CONSTRAINT_TAG_PSR_CONSTRAIN_S_X,true);
bc->SetBool(ID_CA_CONSTRAINT_TAG_PSR_CONSTRAIN_P_Y,true);
bc->SetBool(ID_CA_CONSTRAINT_TAG_PSR_CONSTRAIN_R_Y,true);
bc->SetBool(ID_CA_CONSTRAINT_TAG_PSR_CONSTRAIN_S_Y,true);
bc->SetBool(ID_CA_CONSTRAINT_TAG_PSR_CONSTRAIN_P_Z,true);
bc->SetBool(ID_CA_CONSTRAINT_TAG_PSR_CONSTRAIN_R_Z,true);
bc->SetBool(ID_CA_CONSTRAINT_TAG_PSR_CONSTRAIN_S_Z,true);
bc->SetBool(ID_CA_CONSTRAINT_TAG_LOCAL_P,true);
bc->SetBool(ID_CA_CONSTRAINT_TAG_LOCAL_R,true);
bc->SetBool(ID_CA_CONSTRAINT_TAG_LOCAL_S,true);
bc->SetFloat(ID_CA_CONSTRAINT_TAG_PSR_WEIGHT,0.1);
bc->SetBool(ID_CA_CONSTRAINT_TAG_PSR_P,true);
bc->SetBool(ID_CA_CONSTRAINT_TAG_PSR_R,true);
bc->SetBool(ID_CA_CONSTRAINT_TAG_PSR_S,true);
bc->SetFloat(ID_CA_CONSTRAINT_TAG_MIRROR_TWEIGHT,0.1);
bc->SetVector(ID_CA_CONSTRAINT_TAG_MIRROR_P_OFFSET, c4d.Vector(1.0,1.0,1.0);
bc->SetVector(ID_CA_CONSTRAINT_TAG_MIRROR_R_OFFSET, c4d.Vector(1.0,1.0,1.0);
bc->SetFloat(ID_CA_CONSTRAINT_TAG_MIRROR_WEIGHT,0.1);
bc->SetBool(ID_CA_CONSTRAINT_TAG_MIRROR_P,true);
bc->SetBool(ID_CA_CONSTRAINT_TAG_MIRROR_R,true);
bc->SetInt32(ID_CA_CONSTRAINT_TAG_MIRROR_ORIGIN,ID_CA_CONSTRAINT_TAG_MIRROR_ORIGIN_WORLD);
bc->SetInt32(ID_CA_CONSTRAINT_TAG_MIRROR_PLANE,ID_CA_CONSTRAINT_TAG_MIRROR_PLANE_XY);
bc->SetInt32(ID_CA_CONSTRAINT_TAG_MIRROR_AXIS,ID_CA_CONSTRAINT_TAG_MIRROR_AXIS_XY);
bc->SetFloat(ID_CA_CONSTRAINT_TAG_CLAMP_TWEIGHT,0.1);
bc->SetBool(ID_CA_CONSTRAINT_TAG_CLAMP_SHOW,true);
bc->SetBool(ID_CA_CONSTRAINT_TAG_CLAMP_STICK,true);
bc->SetBool(ID_CA_CONSTRAINT_TAG_CLAMP_NORMALS,true);
bc->SetFloat(ID_CA_CONSTRAINT_TAG_CLAMP_WEIGHT,0.1);
bc->SetFloat(ID_CA_CONSTRAINT_TAG_CLAMP_DISTANCE,0.1);
bc->SetInt32(ID_CA_CONSTRAINT_TAG_CLAMP_TO,ID_CA_CONSTRAINT_TAG_CLAMP_TO_ORIGIN);
bc->SetInt32(ID_CA_CONSTRAINT_TAG_CLAMP_MODE,ID_CA_CONSTRAINT_TAG_CLAMP_MODE_MIN);
bc->SetInt32(ID_CA_CONSTRAINT_TAG_CLAMP_ALIGN,ID_CA_CONSTRAINT_TAG_AXIS_XP);
bc->SetInt32(ID_CA_CONSTRAINT_TAG_CLAMP_ALIGN_TO,ID_CA_CONSTRAINT_TAG_CLAMP_ALIGN_NONE);
bc->SetInt32(ID_CA_CONSTRAINT_TAG_CLAMP_AXIS,ID_CA_CONSTRAINT_TAG_AXIS_X);
bc->SetInt32(ID_CA_CONSTRAINT_TAG_CLAMP_PLANE,ID_CA_CONSTRAINT_TAG_PLANE_XY);
bc->SetFloat(ID_CA_CONSTRAINT_TAG_SPRING_TWEIGHT,0.1);
bc->SetFloat(ID_CA_CONSTRAINT_TAG_SPRING_DRAG,0.1);
bc->SetFloat(ID_CA_CONSTRAINT_TAG_SPRING_GRAVITY,0.1);
bc->SetVector(ID_CA_CONSTRAINT_TAG_SPRING_P_OFFSET, c4d.Vector(1.0,1.0,1.0);
bc->SetVector(ID_CA_CONSTRAINT_TAG_SPRING_R_OFFSET, c4d.Vector(1.0,1.0,1.0);
bc->SetVector(ID_CA_CONSTRAINT_TAG_SPRING_S_OFFSET, c4d.Vector(1.0,1.0,1.0);
bc->SetBool(ID_CA_CONSTRAINT_TAG_SPRING_P,true);
bc->SetBool(ID_CA_CONSTRAINT_TAG_SPRING_R,true);
bc->SetBool(ID_CA_CONSTRAINT_TAG_SPRING_S,true);
bc->SetFloat(ID_CA_CONSTRAINT_TAG_SPRING_WEIGHT,0.1);
bc->SetFloat(ID_CA_CONSTRAINT_TAG_SPRING_LENGTH,0.1);
bc->SetFloat(ID_CA_CONSTRAINT_TAG_SPRING_STIFFNESS,0.1);
bc->SetFloat(ID_CA_CONSTRAINT_TAG_AIM_TWEIGHT,0.1);
bc->SetBool(ID_CA_CONSTRAINT_TAG_AIM_MAINTAIN,true);
bc->SetVector(ID_CA_CONSTRAINT_TAG_AIM_OFFSET, c4d.Vector(1.0,1.0,1.0);
bc->SetBool(ID_CA_CONSTRAINT_TAG_AIM_CONSTRAIN_X,true);
bc->SetBool(ID_CA_CONSTRAINT_TAG_AIM_CONSTRAIN_Y,true);
bc->SetBool(ID_CA_CONSTRAINT_TAG_AIM_CONSTRAIN_Z,true);
bc->SetFloat(ID_CA_CONSTRAINT_TAG_AIM_WEIGHT,0.1);
bc->SetInt32(ID_CA_CONSTRAINT_TAG_AIM_AXIS,ID_CA_CONSTRAINT_TAG_AXIS_XP);
bc->SetFloat(ID_CA_CONSTRAINT_TAG_UP_TWEIGHT,0.1);
bc->SetBool(ID_CA_CONSTRAINT_TAG_UP_MAINTAIN,true);
bc->SetVector(ID_CA_CONSTRAINT_TAG_UP_OFFSET, c4d.Vector(1.0,1.0,1.0);
bc->SetBool(ID_CA_CONSTRAINT_TAG_UP_CONSTRAIN_X,true);
bc->SetBool(ID_CA_CONSTRAINT_TAG_UP_CONSTRAIN_Y,true);
bc->SetBool(ID_CA_CONSTRAINT_TAG_UP_CONSTRAIN_Z,true);
bc->SetInt32(ID_CA_CONSTRAINT_TAG_UP_AXIS,ID_CA_CONSTRAINT_TAG_AXIS_XP);
bc->SetInt32(ID_CA_CONSTRAINT_TAG_UP_ROT_AXIS,ID_CA_CONSTRAINT_TAG_AXIS_XP);
bc->SetFloat(ID_CA_CONSTRAINT_TAG_UP_WEIGHT,0.1);
bc->SetFloat(ID_CA_CONSTRAINT_TAG_COLLISION_TWEIGHT,0.1);
pTag->Message(MSG_UPDATE);
}
Buttons
This node has buttons. Buttons can manually be executed by calling the following code
Python
c4d.CallButton(tag,c4d.ID_CA_CONSTRAINT_TAG_SET_INITIAL_STATE)
c4d.CallButton(tag,c4d.ID_CA_CONSTRAINT_TAG_PARENT_ADD)
c4d.CallButton(tag,c4d.ID_CA_CONSTRAINT_TAG_PARENT_REMOVE)
c4d.CallButton(tag,c4d.ID_CA_CONSTRAINT_TAG_PSR_ADD)
c4d.CallButton(tag,c4d.ID_CA_CONSTRAINT_TAG_PSR_REMOVE)
c4d.CallButton(tag,c4d.ID_CA_CONSTRAINT_TAG_MIRROR_ADD)
c4d.CallButton(tag,c4d.ID_CA_CONSTRAINT_TAG_MIRROR_REMOVE)
c4d.CallButton(tag,c4d.ID_CA_CONSTRAINT_TAG_CLAMP_ADD)
c4d.CallButton(tag,c4d.ID_CA_CONSTRAINT_TAG_CLAMP_REMOVE)
c4d.CallButton(tag,c4d.ID_CA_CONSTRAINT_TAG_SPRING_ADD)
c4d.CallButton(tag,c4d.ID_CA_CONSTRAINT_TAG_SPRING_REMOVE)
c4d.CallButton(tag,c4d.ID_CA_CONSTRAINT_TAG_AIM_ADD)
c4d.CallButton(tag,c4d.ID_CA_CONSTRAINT_TAG_AIM_REMOVE)
c4d.CallButton(tag,c4d.ID_CA_CONSTRAINT_TAG_UP_ADD)
c4d.CallButton(tag,c4d.ID_CA_CONSTRAINT_TAG_UP_REMOVE)
C++
DescriptionCommand dc;
dc.id = DescID(ID_CA_CONSTRAINT_TAG_SET_INITIAL_STATE);
pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(ID_CA_CONSTRAINT_TAG_PARENT_ADD);
pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(ID_CA_CONSTRAINT_TAG_PARENT_REMOVE);
pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(ID_CA_CONSTRAINT_TAG_PSR_ADD);
pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(ID_CA_CONSTRAINT_TAG_PSR_REMOVE);
pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(ID_CA_CONSTRAINT_TAG_MIRROR_ADD);
pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(ID_CA_CONSTRAINT_TAG_MIRROR_REMOVE);
pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(ID_CA_CONSTRAINT_TAG_CLAMP_ADD);
pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(ID_CA_CONSTRAINT_TAG_CLAMP_REMOVE);
pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(ID_CA_CONSTRAINT_TAG_SPRING_ADD);
pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(ID_CA_CONSTRAINT_TAG_SPRING_REMOVE);
pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(ID_CA_CONSTRAINT_TAG_AIM_ADD);
pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(ID_CA_CONSTRAINT_TAG_AIM_REMOVE);
pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(ID_CA_CONSTRAINT_TAG_UP_ADD);
pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(ID_CA_CONSTRAINT_TAG_UP_REMOVE);
pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);