Tcaposemorph
Attributes
-
ENGLISH NAME : PoseMorph
-
NAME : Tcaposemorph
-
INCLUDE : Texpression
-
PATH : ca/description/tcaposemorph.res
-
PLUGIN : ca
-
MAXON online help (may not exist): TCAPOSEMORPH
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.Tcaposemorph)
doc.InsertObject(obj)
c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
#You can set parameters two different ways.
#First way
tag[c4d.ID_CA_POSE_P] = True
tag[c4d.ID_CA_POSE_PARAM] = True
tag[c4d.ID_CA_POSE_S] = True
tag[c4d.ID_CA_POSE_USERDATA] = True
tag[c4d.ID_CA_POSE_R] = True
tag[c4d.ID_CA_POSE_HIERARCHY] = True
tag[c4d.ID_CA_POSE_POINTS] = True
tag[c4d.ID_CA_POSE_MAPS] = True
tag[c4d.ID_CA_POSE_UV] = True
tag[c4d.ID_CA_POSE_OPTIONS_PSD_DRAWDRIVER] = True
tag[c4d.ID_CA_POSE_OPTIONS_PSD_POS_THRESHOLD] = 0.1
tag[c4d.ID_CA_POSE_OPTIONS_PSD_ORIENT_THRESHOLD] = 0.1
tag[c4d.ID_CA_POSE_OPTIONS_PSD_TWIST_THRESHOLD] = 0.1
tag[c4d.ID_CA_POSE_MODE] = c4d.ID_CA_POSE_MODE_EDIT
tag[c4d.ID_CA_POSE_EDIT_MODE] = c4d.ID_CA_POSE_EDIT_MODE_OFF
tag[c4d.ID_CA_POSE_MIXING] = c4d.ID_CA_POSE_MIXING_ABS
tag[c4d.ID_CA_POSE_MIXING_DEFORMED] = True
tag[c4d.ID_CA_POSE_USE_STRENGTH] = True
tag[c4d.ID_CA_POSE_STRENGTH] = 0.1
tag[c4d.ID_CA_POSE_ROTATION_POS] = c4d.Vector(1.0,1.0,1.0)
tag[c4d.ID_CA_POSE_ROTATION_AXIS] = c4d.Vector(1.0,1.0,1.0)
tag[c4d.ID_CA_POSE_PSD_INTERP_MODE_UI_ONLY] = c4d.ID_CA_POSE_PSD_INTERP_MODE_JOINT
tag[c4d.ID_CA_POSE_EXTERNAL] = "c:\\SomeFile.txt"
tag[c4d.ID_CA_POSE_TOTAL_STRENGTH] = 0.1
tag[c4d.ID_CA_POSE_TARGET_INCLUDE_MODE] = c4d.ID_CA_POSE_TARGET_INCLUDE_MODE_INCLUDE
tag[c4d.ID_CA_POSE_PSD_AUTOWEIGHT_INTERP_UI_ONLY] = True
tag[c4d.ID_CA_POSE_PSD_ORIENT_INTERP_UI_ONLY] = True
tag[c4d.ID_CA_POSE_PSD_TWIST_INTERP_UI_ONLY] = True
tag[c4d.ID_CA_POSE_PSD_POS_INTERP_UI_ONLY] = True
tag[c4d.ID_CA_POSE_PSD_ORIENT_INTERP_AVERAGEWEIGHT_UI_ONLY] = 0.1
tag[c4d.ID_CA_POSE_PSD_POS_INTERP_AVERAGEWEIGHT_UI_ONLY] = 0.1
tag[c4d.ID_CA_POSE_PSD_TWIST_INTERP_AVERAGEWEIGHT_UI_ONLY] = 0.1
tag[c4d.ID_CA_POSE_PSD_INTERP_AVERAGEWEIGHT_UI_ONLY] = 0.1
tag[c4d.ID_CA_POSE_PSD_INTERP_MODE] = True
tag[c4d.ID_CA_POSE_PSD_JOINT_X_WEIGHT] = 0.1
tag[c4d.ID_CA_POSE_PSD_JOINT_Y_WEIGHT] = 0.1
tag[c4d.ID_CA_POSE_PSD_JOINT_Z_WEIGHT] = 0.1
tag[c4d.ID_CA_POSE_PSD_JOINT_FORCE_IN_AUTOWEIGHT] = True
#Second way, using the base container.
bc = tag.GetDataInstance()
bc.SetBool(c4d.ID_CA_POSE_P,True)
bc.SetBool(c4d.ID_CA_POSE_PARAM,True)
bc.SetBool(c4d.ID_CA_POSE_S,True)
bc.SetBool(c4d.ID_CA_POSE_USERDATA,True)
bc.SetBool(c4d.ID_CA_POSE_R,True)
bc.SetBool(c4d.ID_CA_POSE_HIERARCHY,True)
bc.SetBool(c4d.ID_CA_POSE_POINTS,True)
bc.SetBool(c4d.ID_CA_POSE_MAPS,True)
bc.SetBool(c4d.ID_CA_POSE_UV,True)
bc.SetBool(c4d.ID_CA_POSE_OPTIONS_PSD_DRAWDRIVER,True)
bc.SetFloat(c4d.ID_CA_POSE_OPTIONS_PSD_POS_THRESHOLD,0.1)
bc.SetFloat(c4d.ID_CA_POSE_OPTIONS_PSD_ORIENT_THRESHOLD,0.1)
bc.SetFloat(c4d.ID_CA_POSE_OPTIONS_PSD_TWIST_THRESHOLD,0.1)
bc.SetInt32(c4d.ID_CA_POSE_MODE,c4d.ID_CA_POSE_MODE_EDIT)
bc.SetInt32(c4d.ID_CA_POSE_EDIT_MODE,c4d.ID_CA_POSE_EDIT_MODE_OFF)
bc.SetInt32(c4d.ID_CA_POSE_MIXING,c4d.ID_CA_POSE_MIXING_ABS)
bc.SetBool(c4d.ID_CA_POSE_MIXING_DEFORMED,True)
bc.SetBool(c4d.ID_CA_POSE_USE_STRENGTH,True)
bc.SetFloat(c4d.ID_CA_POSE_STRENGTH,0.1)
bc.SetVector(c4d.ID_CA_POSE_ROTATION_POS, c4d.Vector(1.0,1.0,1.0)
bc.SetVector(c4d.ID_CA_POSE_ROTATION_AXIS, c4d.Vector(1.0,1.0,1.0)
bc.SetInt32(c4d.ID_CA_POSE_PSD_INTERP_MODE_UI_ONLY,c4d.ID_CA_POSE_PSD_INTERP_MODE_JOINT)
bc.SetFileName(c4d.ID_CA_POSE_EXTERNAL,"c:\\SomeFile.txt")
bc.SetFloat(c4d.ID_CA_POSE_TOTAL_STRENGTH,0.1)
bc.SetInt32(c4d.ID_CA_POSE_TARGET_INCLUDE_MODE,c4d.ID_CA_POSE_TARGET_INCLUDE_MODE_INCLUDE)
bc.SetBool(c4d.ID_CA_POSE_PSD_AUTOWEIGHT_INTERP_UI_ONLY,True)
bc.SetBool(c4d.ID_CA_POSE_PSD_ORIENT_INTERP_UI_ONLY,True)
bc.SetBool(c4d.ID_CA_POSE_PSD_TWIST_INTERP_UI_ONLY,True)
bc.SetBool(c4d.ID_CA_POSE_PSD_POS_INTERP_UI_ONLY,True)
bc.SetFloat(c4d.ID_CA_POSE_PSD_ORIENT_INTERP_AVERAGEWEIGHT_UI_ONLY,0.1)
bc.SetFloat(c4d.ID_CA_POSE_PSD_POS_INTERP_AVERAGEWEIGHT_UI_ONLY,0.1)
bc.SetFloat(c4d.ID_CA_POSE_PSD_TWIST_INTERP_AVERAGEWEIGHT_UI_ONLY,0.1)
bc.SetFloat(c4d.ID_CA_POSE_PSD_INTERP_AVERAGEWEIGHT_UI_ONLY,0.1)
bc.SetBool(c4d.ID_CA_POSE_PSD_INTERP_MODE,True)
bc.SetFloat(c4d.ID_CA_POSE_PSD_JOINT_X_WEIGHT,0.1)
bc.SetFloat(c4d.ID_CA_POSE_PSD_JOINT_Y_WEIGHT,0.1)
bc.SetFloat(c4d.ID_CA_POSE_PSD_JOINT_Z_WEIGHT,0.1)
bc.SetBool(c4d.ID_CA_POSE_PSD_JOINT_FORCE_IN_AUTOWEIGHT,True)
if __name__=='__main__':
main()
C++
#include "c4d.h"
#include "../ca/description/tcaposemorph.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(Tcaposemorph);
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_POSE_P),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_POSE_PARAM),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_POSE_S),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_POSE_USERDATA),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_POSE_R),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_POSE_HIERARCHY),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_POSE_POINTS),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_POSE_MAPS),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_POSE_UV),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_POSE_OPTIONS_PSD_DRAWDRIVER),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_POSE_OPTIONS_PSD_POS_THRESHOLD),GeData(0.1),flags);
pTag->SetParameter(DescID(ID_CA_POSE_OPTIONS_PSD_ORIENT_THRESHOLD),GeData(0.1),flags);
pTag->SetParameter(DescID(ID_CA_POSE_OPTIONS_PSD_TWIST_THRESHOLD),GeData(0.1),flags);
pTag->SetParameter(DescID(ID_CA_POSE_MODE),GeData(ID_CA_POSE_MODE_EDIT),flags);
pTag->SetParameter(DescID(ID_CA_POSE_EDIT_MODE),GeData(ID_CA_POSE_EDIT_MODE_OFF),flags);
pTag->SetParameter(DescID(ID_CA_POSE_MIXING),GeData(ID_CA_POSE_MIXING_ABS),flags);
pTag->SetParameter(DescID(ID_CA_POSE_MIXING_DEFORMED),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_POSE_USE_STRENGTH),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_POSE_STRENGTH),GeData(0.1),flags);
pTag->SetParameter(DescID(ID_CA_POSE_ROTATION_POS),GeData(Vector(1.0,1.0,1.0)),flags);
pTag->SetParameter(DescID(ID_CA_POSE_ROTATION_AXIS),GeData(Vector(1.0,1.0,1.0)),flags);
pTag->SetParameter(DescID(ID_CA_POSE_PSD_INTERP_MODE_UI_ONLY),GeData(ID_CA_POSE_PSD_INTERP_MODE_JOINT),flags);
pTag->SetParameter(DescID(ID_CA_POSE_EXTERNAL),GeData(Filename("c:\\SomeFile.txt"),flags);
pTag->SetParameter(DescID(ID_CA_POSE_TOTAL_STRENGTH),GeData(0.1),flags);
pTag->SetParameter(DescID(ID_CA_POSE_TARGET_INCLUDE_MODE),GeData(ID_CA_POSE_TARGET_INCLUDE_MODE_INCLUDE),flags);
pTag->SetParameter(DescID(ID_CA_POSE_PSD_AUTOWEIGHT_INTERP_UI_ONLY),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_POSE_PSD_ORIENT_INTERP_UI_ONLY),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_POSE_PSD_TWIST_INTERP_UI_ONLY),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_POSE_PSD_POS_INTERP_UI_ONLY),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_POSE_PSD_ORIENT_INTERP_AVERAGEWEIGHT_UI_ONLY),GeData(0.1),flags);
pTag->SetParameter(DescID(ID_CA_POSE_PSD_POS_INTERP_AVERAGEWEIGHT_UI_ONLY),GeData(0.1),flags);
pTag->SetParameter(DescID(ID_CA_POSE_PSD_TWIST_INTERP_AVERAGEWEIGHT_UI_ONLY),GeData(0.1),flags);
pTag->SetParameter(DescID(ID_CA_POSE_PSD_INTERP_AVERAGEWEIGHT_UI_ONLY),GeData(0.1),flags);
pTag->SetParameter(DescID(ID_CA_POSE_PSD_INTERP_MODE),GeData(true),flags);
pTag->SetParameter(DescID(ID_CA_POSE_PSD_JOINT_X_WEIGHT),GeData(0.1),flags);
pTag->SetParameter(DescID(ID_CA_POSE_PSD_JOINT_Y_WEIGHT),GeData(0.1),flags);
pTag->SetParameter(DescID(ID_CA_POSE_PSD_JOINT_Z_WEIGHT),GeData(0.1),flags);
pTag->SetParameter(DescID(ID_CA_POSE_PSD_JOINT_FORCE_IN_AUTOWEIGHT),GeData(true),flags);
pTag->Message(MSG_UPDATE);
//Second way, using the base container.
BaseContainer *bc = pTag->GetDataInstance();
bc->SetBool(ID_CA_POSE_P,true);
bc->SetBool(ID_CA_POSE_PARAM,true);
bc->SetBool(ID_CA_POSE_S,true);
bc->SetBool(ID_CA_POSE_USERDATA,true);
bc->SetBool(ID_CA_POSE_R,true);
bc->SetBool(ID_CA_POSE_HIERARCHY,true);
bc->SetBool(ID_CA_POSE_POINTS,true);
bc->SetBool(ID_CA_POSE_MAPS,true);
bc->SetBool(ID_CA_POSE_UV,true);
bc->SetBool(ID_CA_POSE_OPTIONS_PSD_DRAWDRIVER,true);
bc->SetFloat(ID_CA_POSE_OPTIONS_PSD_POS_THRESHOLD,0.1);
bc->SetFloat(ID_CA_POSE_OPTIONS_PSD_ORIENT_THRESHOLD,0.1);
bc->SetFloat(ID_CA_POSE_OPTIONS_PSD_TWIST_THRESHOLD,0.1);
bc->SetInt32(ID_CA_POSE_MODE,ID_CA_POSE_MODE_EDIT);
bc->SetInt32(ID_CA_POSE_EDIT_MODE,ID_CA_POSE_EDIT_MODE_OFF);
bc->SetInt32(ID_CA_POSE_MIXING,ID_CA_POSE_MIXING_ABS);
bc->SetBool(ID_CA_POSE_MIXING_DEFORMED,true);
bc->SetBool(ID_CA_POSE_USE_STRENGTH,true);
bc->SetFloat(ID_CA_POSE_STRENGTH,0.1);
bc->SetVector(ID_CA_POSE_ROTATION_POS, c4d.Vector(1.0,1.0,1.0);
bc->SetVector(ID_CA_POSE_ROTATION_AXIS, c4d.Vector(1.0,1.0,1.0);
bc->SetInt32(ID_CA_POSE_PSD_INTERP_MODE_UI_ONLY,ID_CA_POSE_PSD_INTERP_MODE_JOINT);
bc->SetFileName(ID_CA_POSE_EXTERNAL,"c:\\SomeFile.txt");
bc->SetFloat(ID_CA_POSE_TOTAL_STRENGTH,0.1);
bc->SetInt32(ID_CA_POSE_TARGET_INCLUDE_MODE,ID_CA_POSE_TARGET_INCLUDE_MODE_INCLUDE);
bc->SetBool(ID_CA_POSE_PSD_AUTOWEIGHT_INTERP_UI_ONLY,true);
bc->SetBool(ID_CA_POSE_PSD_ORIENT_INTERP_UI_ONLY,true);
bc->SetBool(ID_CA_POSE_PSD_TWIST_INTERP_UI_ONLY,true);
bc->SetBool(ID_CA_POSE_PSD_POS_INTERP_UI_ONLY,true);
bc->SetFloat(ID_CA_POSE_PSD_ORIENT_INTERP_AVERAGEWEIGHT_UI_ONLY,0.1);
bc->SetFloat(ID_CA_POSE_PSD_POS_INTERP_AVERAGEWEIGHT_UI_ONLY,0.1);
bc->SetFloat(ID_CA_POSE_PSD_TWIST_INTERP_AVERAGEWEIGHT_UI_ONLY,0.1);
bc->SetFloat(ID_CA_POSE_PSD_INTERP_AVERAGEWEIGHT_UI_ONLY,0.1);
bc->SetBool(ID_CA_POSE_PSD_INTERP_MODE,true);
bc->SetFloat(ID_CA_POSE_PSD_JOINT_X_WEIGHT,0.1);
bc->SetFloat(ID_CA_POSE_PSD_JOINT_Y_WEIGHT,0.1);
bc->SetFloat(ID_CA_POSE_PSD_JOINT_Z_WEIGHT,0.1);
bc->SetBool(ID_CA_POSE_PSD_JOINT_FORCE_IN_AUTOWEIGHT,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.ID_CA_POSE_ADDMORPH)
c4d.CallButton(tag,c4d.ID_CA_POSE_ROTATION_FROMEDGE)
c4d.CallButton(tag,c4d.ID_CA_POSE_ROTATION_FROMPOINTS)
c4d.CallButton(tag,c4d.ID_CA_POSE_UPDATE_PSD_POSE)
c4d.CallButton(tag,c4d.ID_CA_POSE_RESTORE_PSD_POSE)
c4d.CallButton(tag,c4d.ID_CA_POSE_FORCE_AUTOWEIGHTDRIVER)
c4d.CallButton(tag,c4d.ID_CA_POSE_SHOW_AUTOWEIGHTDRIVER)
c4d.CallButton(tag,c4d.ID_CA_POSE_EXTERNAL_SAVE)
c4d.CallButton(tag,c4d.ID_CA_POSE_RECORD_SLIDER)
c4d.CallButton(tag,c4d.ID_CA_POSE_RESET_SLIDER)
C++
DescriptionCommand dc;
dc.id = DescID(ID_CA_POSE_ADDMORPH);
pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(ID_CA_POSE_ROTATION_FROMEDGE);
pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(ID_CA_POSE_ROTATION_FROMPOINTS);
pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(ID_CA_POSE_UPDATE_PSD_POSE);
pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(ID_CA_POSE_RESTORE_PSD_POSE);
pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(ID_CA_POSE_FORCE_AUTOWEIGHTDRIVER);
pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(ID_CA_POSE_SHOW_AUTOWEIGHTDRIVER);
pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(ID_CA_POSE_EXTERNAL_SAVE);
pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(ID_CA_POSE_RECORD_SLIDER);
pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(ID_CA_POSE_RESET_SLIDER);
pTag->Message(MSG_DESCRIPTION_COMMAND, &dc);