Ocajoint
Attributes
-
ENGLISH NAME : Joint
-
NAME : Ocajoint
-
INCLUDE : Obase
-
INCLUDE : Ofalloff_panel
-
PATH : ca/description/ocajoint.res
-
PLUGIN : ca
-
MAXON online help (may not exist): OCAJOINT
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.Ocajoint)
doc.InsertObject(obj)
c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
#You can set parameters two different ways.
#First way
obj[c4d.ID_CA_JOINT_OBJECT_BONE_ALIGN] = c4d.ID_CA_JOINT_OBJECT_BONE_ALIGN_NULL
obj[c4d.ID_CA_JOINT_OBJECT_BONE_AXIS] = c4d.ID_CA_JOINT_OBJECT_BONE_AXIS_X
obj[c4d.ID_CA_JOINT_OBJECT_LENGTH] = 0.1
obj[c4d.ID_CA_JOINT_OBJECT_BONE_DISPLAY] = c4d.ID_CA_JOINT_OBJECT_BONE_DISPLAY_NONE
obj[c4d.ID_CA_JOINT_OBJECT_BONE_SIZE_MODE] = c4d.ID_CA_JOINT_OBJECT_BONE_SIZE_MODE_CUSTOM
obj[c4d.ID_CA_JOINT_OBJECT_BONE_SIZE] = 0.1
obj[c4d.ID_CA_JOINT_OBJECT_JOINT_DISPLAY] = c4d.ID_CA_JOINT_OBJECT_JOINT_DISPLAY_NONE
obj[c4d.ID_CA_JOINT_OBJECT_JOINT_SIZE_MODE] = c4d.ID_CA_JOINT_OBJECT_JOINT_SIZE_MODE_CUSTOM
obj[c4d.ID_CA_JOINT_OBJECT_JOINT_SIZE] = 0.1
obj[c4d.ID_CA_JOINT_OBJECT_JOINT_IK_WEIGHT] = 0.1
obj[c4d.ID_CA_JOINT_OBJECT_JOINT_IK_STRETCH] = 0.1
obj[c4d.ID_CA_JOINT_OBJECT_JOINT_IK_PREFERRED_ROT_LINK] = True
obj[c4d.ID_CA_JOINT_OBJECT_JOINT_IK_PREFERRED_ROT_WEIGHT] = 0.1
obj[c4d.ID_CA_JOINT_OBJECT_JOINT_IK_PREFERRED_ROT] = c4d.Vector(1.0,1.0,1.0)
obj[c4d.ID_CA_JOINT_OBJECT_JOINT_IK_LIMITROT_STRENGTH] = 0.1
obj[c4d.ID_CA_JOINT_OBJECT_JOINT_IK_USE_ROT_H] = True
obj[c4d.ID_CA_JOINT_OBJECT_JOINT_IK_USE_ROT_P] = True
obj[c4d.ID_CA_JOINT_OBJECT_JOINT_IK_USE_ROT_B] = True
obj[c4d.ID_CA_JOINT_OBJECT_JOINT_IK_MIN_ROT] = c4d.Vector(1.0,1.0,1.0)
obj[c4d.ID_CA_JOINT_OBJECT_JOINT_IK_MAX_ROT] = c4d.Vector(1.0,1.0,1.0)
obj[c4d.ID_CA_JOINT_OBJECT_MIRROR_ENABLE] = True
obj[c4d.ID_CA_JOINT_OBJECT_BONE_HUB] = True
obj[c4d.ID_CA_JOINT_OBJECT_MIRROR_ORIGIN] = c4d.ID_CA_JOINT_OBJECT_MIRROR_ORIGIN_WORLD
obj[c4d.ID_CA_JOINT_OBJECT_MIRROR_PLANE] = c4d.ID_CA_JOINT_OBJECT_MIRROR_WORLD_XY
obj[c4d.ID_CA_JOINT_OBJECT_MIRROR_COLOR_MIX] = 0.1
#Second way, using the base container.
bc = obj.GetDataInstance()
bc.SetInt32(c4d.ID_CA_JOINT_OBJECT_BONE_ALIGN,c4d.ID_CA_JOINT_OBJECT_BONE_ALIGN_NULL)
bc.SetInt32(c4d.ID_CA_JOINT_OBJECT_BONE_AXIS,c4d.ID_CA_JOINT_OBJECT_BONE_AXIS_X)
bc.SetFloat(c4d.ID_CA_JOINT_OBJECT_LENGTH,0.1)
bc.SetInt32(c4d.ID_CA_JOINT_OBJECT_BONE_DISPLAY,c4d.ID_CA_JOINT_OBJECT_BONE_DISPLAY_NONE)
bc.SetInt32(c4d.ID_CA_JOINT_OBJECT_BONE_SIZE_MODE,c4d.ID_CA_JOINT_OBJECT_BONE_SIZE_MODE_CUSTOM)
bc.SetFloat(c4d.ID_CA_JOINT_OBJECT_BONE_SIZE,0.1)
bc.SetInt32(c4d.ID_CA_JOINT_OBJECT_JOINT_DISPLAY,c4d.ID_CA_JOINT_OBJECT_JOINT_DISPLAY_NONE)
bc.SetInt32(c4d.ID_CA_JOINT_OBJECT_JOINT_SIZE_MODE,c4d.ID_CA_JOINT_OBJECT_JOINT_SIZE_MODE_CUSTOM)
bc.SetFloat(c4d.ID_CA_JOINT_OBJECT_JOINT_SIZE,0.1)
bc.SetFloat(c4d.ID_CA_JOINT_OBJECT_JOINT_IK_WEIGHT,0.1)
bc.SetFloat(c4d.ID_CA_JOINT_OBJECT_JOINT_IK_STRETCH,0.1)
bc.SetBool(c4d.ID_CA_JOINT_OBJECT_JOINT_IK_PREFERRED_ROT_LINK,True)
bc.SetFloat(c4d.ID_CA_JOINT_OBJECT_JOINT_IK_PREFERRED_ROT_WEIGHT,0.1)
bc.SetVector(c4d.ID_CA_JOINT_OBJECT_JOINT_IK_PREFERRED_ROT, c4d.Vector(1.0,1.0,1.0)
bc.SetFloat(c4d.ID_CA_JOINT_OBJECT_JOINT_IK_LIMITROT_STRENGTH,0.1)
bc.SetBool(c4d.ID_CA_JOINT_OBJECT_JOINT_IK_USE_ROT_H,True)
bc.SetBool(c4d.ID_CA_JOINT_OBJECT_JOINT_IK_USE_ROT_P,True)
bc.SetBool(c4d.ID_CA_JOINT_OBJECT_JOINT_IK_USE_ROT_B,True)
bc.SetVector(c4d.ID_CA_JOINT_OBJECT_JOINT_IK_MIN_ROT, c4d.Vector(1.0,1.0,1.0)
bc.SetVector(c4d.ID_CA_JOINT_OBJECT_JOINT_IK_MAX_ROT, c4d.Vector(1.0,1.0,1.0)
bc.SetBool(c4d.ID_CA_JOINT_OBJECT_MIRROR_ENABLE,True)
bc.SetBool(c4d.ID_CA_JOINT_OBJECT_BONE_HUB,True)
bc.SetInt32(c4d.ID_CA_JOINT_OBJECT_MIRROR_ORIGIN,c4d.ID_CA_JOINT_OBJECT_MIRROR_ORIGIN_WORLD)
bc.SetInt32(c4d.ID_CA_JOINT_OBJECT_MIRROR_PLANE,c4d.ID_CA_JOINT_OBJECT_MIRROR_WORLD_XY)
bc.SetFloat(c4d.ID_CA_JOINT_OBJECT_MIRROR_COLOR_MIX,0.1)
if __name__=='__main__':
main()
C++
#include "c4d.h"
#include "../ca/description/ocajoint.h"
void SampleFunction()
{
BaseDocument *pDoc = GetActiveDocument();
BaseObject *pObject = BaseObject::Alloc(Ocajoint);
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(ID_CA_JOINT_OBJECT_BONE_ALIGN),GeData(ID_CA_JOINT_OBJECT_BONE_ALIGN_NULL),flags);
pObject->SetParameter(DescID(ID_CA_JOINT_OBJECT_BONE_AXIS),GeData(ID_CA_JOINT_OBJECT_BONE_AXIS_X),flags);
pObject->SetParameter(DescID(ID_CA_JOINT_OBJECT_LENGTH),GeData(0.1),flags);
pObject->SetParameter(DescID(ID_CA_JOINT_OBJECT_BONE_DISPLAY),GeData(ID_CA_JOINT_OBJECT_BONE_DISPLAY_NONE),flags);
pObject->SetParameter(DescID(ID_CA_JOINT_OBJECT_BONE_SIZE_MODE),GeData(ID_CA_JOINT_OBJECT_BONE_SIZE_MODE_CUSTOM),flags);
pObject->SetParameter(DescID(ID_CA_JOINT_OBJECT_BONE_SIZE),GeData(0.1),flags);
pObject->SetParameter(DescID(ID_CA_JOINT_OBJECT_JOINT_DISPLAY),GeData(ID_CA_JOINT_OBJECT_JOINT_DISPLAY_NONE),flags);
pObject->SetParameter(DescID(ID_CA_JOINT_OBJECT_JOINT_SIZE_MODE),GeData(ID_CA_JOINT_OBJECT_JOINT_SIZE_MODE_CUSTOM),flags);
pObject->SetParameter(DescID(ID_CA_JOINT_OBJECT_JOINT_SIZE),GeData(0.1),flags);
pObject->SetParameter(DescID(ID_CA_JOINT_OBJECT_JOINT_IK_WEIGHT),GeData(0.1),flags);
pObject->SetParameter(DescID(ID_CA_JOINT_OBJECT_JOINT_IK_STRETCH),GeData(0.1),flags);
pObject->SetParameter(DescID(ID_CA_JOINT_OBJECT_JOINT_IK_PREFERRED_ROT_LINK),GeData(true),flags);
pObject->SetParameter(DescID(ID_CA_JOINT_OBJECT_JOINT_IK_PREFERRED_ROT_WEIGHT),GeData(0.1),flags);
pObject->SetParameter(DescID(ID_CA_JOINT_OBJECT_JOINT_IK_PREFERRED_ROT),GeData(Vector(1.0,1.0,1.0)),flags);
pObject->SetParameter(DescID(ID_CA_JOINT_OBJECT_JOINT_IK_LIMITROT_STRENGTH),GeData(0.1),flags);
pObject->SetParameter(DescID(ID_CA_JOINT_OBJECT_JOINT_IK_USE_ROT_H),GeData(true),flags);
pObject->SetParameter(DescID(ID_CA_JOINT_OBJECT_JOINT_IK_USE_ROT_P),GeData(true),flags);
pObject->SetParameter(DescID(ID_CA_JOINT_OBJECT_JOINT_IK_USE_ROT_B),GeData(true),flags);
pObject->SetParameter(DescID(ID_CA_JOINT_OBJECT_JOINT_IK_MIN_ROT),GeData(Vector(1.0,1.0,1.0)),flags);
pObject->SetParameter(DescID(ID_CA_JOINT_OBJECT_JOINT_IK_MAX_ROT),GeData(Vector(1.0,1.0,1.0)),flags);
pObject->SetParameter(DescID(ID_CA_JOINT_OBJECT_MIRROR_ENABLE),GeData(true),flags);
pObject->SetParameter(DescID(ID_CA_JOINT_OBJECT_BONE_HUB),GeData(true),flags);
pObject->SetParameter(DescID(ID_CA_JOINT_OBJECT_MIRROR_ORIGIN),GeData(ID_CA_JOINT_OBJECT_MIRROR_ORIGIN_WORLD),flags);
pObject->SetParameter(DescID(ID_CA_JOINT_OBJECT_MIRROR_PLANE),GeData(ID_CA_JOINT_OBJECT_MIRROR_WORLD_XY),flags);
pObject->SetParameter(DescID(ID_CA_JOINT_OBJECT_MIRROR_COLOR_MIX),GeData(0.1),flags);
pObject->Message(MSG_UPDATE);
//Second way, using the base container.
BaseContainer *bc = pObject->GetDataInstance();
bc->SetInt32(ID_CA_JOINT_OBJECT_BONE_ALIGN,ID_CA_JOINT_OBJECT_BONE_ALIGN_NULL);
bc->SetInt32(ID_CA_JOINT_OBJECT_BONE_AXIS,ID_CA_JOINT_OBJECT_BONE_AXIS_X);
bc->SetFloat(ID_CA_JOINT_OBJECT_LENGTH,0.1);
bc->SetInt32(ID_CA_JOINT_OBJECT_BONE_DISPLAY,ID_CA_JOINT_OBJECT_BONE_DISPLAY_NONE);
bc->SetInt32(ID_CA_JOINT_OBJECT_BONE_SIZE_MODE,ID_CA_JOINT_OBJECT_BONE_SIZE_MODE_CUSTOM);
bc->SetFloat(ID_CA_JOINT_OBJECT_BONE_SIZE,0.1);
bc->SetInt32(ID_CA_JOINT_OBJECT_JOINT_DISPLAY,ID_CA_JOINT_OBJECT_JOINT_DISPLAY_NONE);
bc->SetInt32(ID_CA_JOINT_OBJECT_JOINT_SIZE_MODE,ID_CA_JOINT_OBJECT_JOINT_SIZE_MODE_CUSTOM);
bc->SetFloat(ID_CA_JOINT_OBJECT_JOINT_SIZE,0.1);
bc->SetFloat(ID_CA_JOINT_OBJECT_JOINT_IK_WEIGHT,0.1);
bc->SetFloat(ID_CA_JOINT_OBJECT_JOINT_IK_STRETCH,0.1);
bc->SetBool(ID_CA_JOINT_OBJECT_JOINT_IK_PREFERRED_ROT_LINK,true);
bc->SetFloat(ID_CA_JOINT_OBJECT_JOINT_IK_PREFERRED_ROT_WEIGHT,0.1);
bc->SetVector(ID_CA_JOINT_OBJECT_JOINT_IK_PREFERRED_ROT, c4d.Vector(1.0,1.0,1.0);
bc->SetFloat(ID_CA_JOINT_OBJECT_JOINT_IK_LIMITROT_STRENGTH,0.1);
bc->SetBool(ID_CA_JOINT_OBJECT_JOINT_IK_USE_ROT_H,true);
bc->SetBool(ID_CA_JOINT_OBJECT_JOINT_IK_USE_ROT_P,true);
bc->SetBool(ID_CA_JOINT_OBJECT_JOINT_IK_USE_ROT_B,true);
bc->SetVector(ID_CA_JOINT_OBJECT_JOINT_IK_MIN_ROT, c4d.Vector(1.0,1.0,1.0);
bc->SetVector(ID_CA_JOINT_OBJECT_JOINT_IK_MAX_ROT, c4d.Vector(1.0,1.0,1.0);
bc->SetBool(ID_CA_JOINT_OBJECT_MIRROR_ENABLE,true);
bc->SetBool(ID_CA_JOINT_OBJECT_BONE_HUB,true);
bc->SetInt32(ID_CA_JOINT_OBJECT_MIRROR_ORIGIN,ID_CA_JOINT_OBJECT_MIRROR_ORIGIN_WORLD);
bc->SetInt32(ID_CA_JOINT_OBJECT_MIRROR_PLANE,ID_CA_JOINT_OBJECT_MIRROR_WORLD_XY);
bc->SetFloat(ID_CA_JOINT_OBJECT_MIRROR_COLOR_MIX,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.ID_CA_JOINT_OBJECT_ALIGN_AXIS)
c4d.CallButton(obj,c4d.ID_CA_JOINT_OBJECT_JOINT_IK_PREFERRED_SET)
C++
DescriptionCommand dc;
dc.id = DescID(ID_CA_JOINT_OBJECT_ALIGN_AXIS);
pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(ID_CA_JOINT_OBJECT_JOINT_IK_PREFERRED_SET);
pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);