Blender V2.61 - r43446
Defines | Functions | Variables

object_constraint.c File Reference

#include <stdio.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_dynstr.h"
#include "BLI_utildefines.h"
#include "DNA_constraint_types.h"
#include "DNA_curve_types.h"
#include "DNA_scene_types.h"
#include "DNA_text_types.h"
#include "DNA_object_types.h"
#include "BKE_action.h"
#include "BKE_armature.h"
#include "BKE_constraint.h"
#include "BKE_context.h"
#include "BKE_depsgraph.h"
#include "BKE_global.h"
#include "BKE_main.h"
#include "BKE_object.h"
#include "BKE_report.h"
#include "BKE_tracking.h"
#include "BIK_api.h"
#include "WM_api.h"
#include "WM_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
#include "ED_object.h"
#include "ED_armature.h"
#include "ED_screen.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "object_intern.h"

Go to the source code of this file.

Defines

#define EDIT_CONSTRAINT_OWNER_OBJECT   0
#define EDIT_CONSTRAINT_OWNER_BONE   1

Functions

ListBaseget_active_constraints (Object *ob)
ListBaseget_constraint_lb (Object *ob, bConstraint *con, bPoseChannel **pchan_r)
bConstraintget_active_constraint (Object *ob)
static void validate_pyconstraint_cb (void *arg1, void *arg2)
static void set_constraint_nth_target (bConstraint *con, Object *target, const char subtarget[], int index)
static void test_constraints (Object *owner, bPoseChannel *pchan)
void object_test_constraints (Object *owner)
static int edit_constraint_poll_generic (bContext *C, StructRNA *rna_type)
static int edit_constraint_poll (bContext *C)
static void edit_constraint_properties (wmOperatorType *ot)
static int edit_constraint_invoke_properties (bContext *C, wmOperator *op)
static bConstraintedit_constraint_property_get (wmOperator *op, Object *ob, int type)
static int stretchto_reset_exec (bContext *C, wmOperator *op)
static int stretchto_reset_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED(event))
void CONSTRAINT_OT_stretchto_reset (wmOperatorType *ot)
static int limitdistance_reset_exec (bContext *C, wmOperator *op)
static int limitdistance_reset_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED(event))
void CONSTRAINT_OT_limitdistance_reset (wmOperatorType *ot)
static void child_get_inverse_matrix (Scene *scene, Object *ob, bConstraint *con, float invmat[4][4])
static int childof_set_inverse_exec (bContext *C, wmOperator *op)
static int childof_set_inverse_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED(event))
void CONSTRAINT_OT_childof_set_inverse (wmOperatorType *ot)
static int childof_clear_inverse_exec (bContext *C, wmOperator *op)
static int childof_clear_inverse_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED(event))
void CONSTRAINT_OT_childof_clear_inverse (wmOperatorType *ot)
static int objectsolver_set_inverse_exec (bContext *C, wmOperator *op)
static int objectsolver_set_inverse_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED(event))
void CONSTRAINT_OT_objectsolver_set_inverse (wmOperatorType *ot)
static int objectsolver_clear_inverse_exec (bContext *C, wmOperator *op)
static int objectsolver_clear_inverse_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED(event))
void CONSTRAINT_OT_objectsolver_clear_inverse (wmOperatorType *ot)
void ED_object_constraint_set_active (Object *ob, bConstraint *con)
void ED_object_constraint_update (Object *ob)
void ED_object_constraint_dependency_update (Main *bmain, Scene *scene, Object *ob)
static int constraint_poll (bContext *C)
static int constraint_delete_exec (bContext *C, wmOperator *UNUSED(op))
void CONSTRAINT_OT_delete (wmOperatorType *ot)
static int constraint_move_down_exec (bContext *C, wmOperator *op)
static int constraint_move_down_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED(event))
void CONSTRAINT_OT_move_down (wmOperatorType *ot)
static int constraint_move_up_exec (bContext *C, wmOperator *op)
static int constraint_move_up_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED(event))
void CONSTRAINT_OT_move_up (wmOperatorType *ot)
static int pose_constraints_clear_exec (bContext *C, wmOperator *UNUSED(op))
void POSE_OT_constraints_clear (wmOperatorType *ot)
static int object_constraints_clear_exec (bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_constraints_clear (wmOperatorType *ot)
static int pose_constraint_copy_exec (bContext *C, wmOperator *op)
void POSE_OT_constraints_copy (wmOperatorType *ot)
static int object_constraint_copy_exec (bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_constraints_copy (wmOperatorType *ot)
static short get_new_constraint_target (bContext *C, int con_type, Object **tar_ob, bPoseChannel **tar_pchan, short add)
static int constraint_add_exec (bContext *C, wmOperator *op, Object *ob, ListBase *list, int type, short setTarget)
static int object_constraint_add_exec (bContext *C, wmOperator *op)
static int pose_constraint_add_exec (bContext *C, wmOperator *op)
void OBJECT_OT_constraint_add (wmOperatorType *ot)
void OBJECT_OT_constraint_add_with_targets (wmOperatorType *ot)
void POSE_OT_constraint_add (wmOperatorType *ot)
void POSE_OT_constraint_add_with_targets (wmOperatorType *ot)
static int pose_ik_add_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED(evt))
static int pose_ik_add_exec (bContext *C, wmOperator *op)
void POSE_OT_ik_add (wmOperatorType *ot)
static int pose_ik_clear_exec (bContext *C, wmOperator *UNUSED(op))
void POSE_OT_ik_clear (wmOperatorType *ot)

Variables

static EnumPropertyItem constraint_owner_items []

Detailed Description

Definition in file object_constraint.c.


Define Documentation

#define EDIT_CONSTRAINT_OWNER_BONE   1
#define EDIT_CONSTRAINT_OWNER_OBJECT   0

Function Documentation

static void child_get_inverse_matrix ( Scene scene,
Object ob,
bConstraint con,
float  invmat[4][4] 
) [static]
static int childof_clear_inverse_exec ( bContext C,
wmOperator op 
) [static]
static int childof_clear_inverse_invoke ( bContext C,
wmOperator op,
wmEvent UNUSEDevent 
) [static]
static int childof_set_inverse_exec ( bContext C,
wmOperator op 
) [static]
static int childof_set_inverse_invoke ( bContext C,
wmOperator op,
wmEvent UNUSEDevent 
) [static]
static int constraint_add_exec ( bContext C,
wmOperator op,
Object ob,
ListBase list,
int  type,
short  setTarget 
) [static]
static int constraint_delete_exec ( bContext C,
wmOperator UNUSEDop 
) [static]
static int constraint_move_down_exec ( bContext C,
wmOperator op 
) [static]
static int constraint_move_down_invoke ( bContext C,
wmOperator op,
wmEvent UNUSEDevent 
) [static]
static int constraint_move_up_exec ( bContext C,
wmOperator op 
) [static]
static int constraint_move_up_invoke ( bContext C,
wmOperator op,
wmEvent UNUSEDevent 
) [static]
void CONSTRAINT_OT_childof_clear_inverse ( wmOperatorType ot)
void CONSTRAINT_OT_childof_set_inverse ( wmOperatorType ot)
void CONSTRAINT_OT_delete ( wmOperatorType ot)
void CONSTRAINT_OT_limitdistance_reset ( wmOperatorType ot)
void CONSTRAINT_OT_move_down ( wmOperatorType ot)
void CONSTRAINT_OT_move_up ( wmOperatorType ot)
void CONSTRAINT_OT_objectsolver_clear_inverse ( wmOperatorType ot)
void CONSTRAINT_OT_objectsolver_set_inverse ( wmOperatorType ot)
void CONSTRAINT_OT_stretchto_reset ( wmOperatorType ot)
static int constraint_poll ( bContext C) [static]
void ED_object_constraint_dependency_update ( Main bmain,
Scene scene,
Object ob 
)
void ED_object_constraint_set_active ( Object ob,
bConstraint con 
)
void ED_object_constraint_update ( Object ob)
static int edit_constraint_invoke_properties ( bContext C,
wmOperator op 
) [static]
static int edit_constraint_poll ( bContext C) [static]
static int edit_constraint_poll_generic ( bContext C,
StructRNA rna_type 
) [static]
static void edit_constraint_properties ( wmOperatorType ot) [static]
static bConstraint* edit_constraint_property_get ( wmOperator op,
Object ob,
int  type 
) [static]
bConstraint* get_active_constraint ( Object ob) [read]

Definition at line 139 of file object_constraint.c.

References constraints_get_active(), and get_active_constraints().

ListBase* get_active_constraints ( Object ob) [read]
ListBase* get_constraint_lb ( Object ob,
bConstraint con,
bPoseChannel **  pchan_r 
) [read]
static short get_new_constraint_target ( bContext C,
int  con_type,
Object **  tar_ob,
bPoseChannel **  tar_pchan,
short  add 
) [static]
static int limitdistance_reset_exec ( bContext C,
wmOperator op 
) [static]
static int limitdistance_reset_invoke ( bContext C,
wmOperator op,
wmEvent UNUSEDevent 
) [static]
static int object_constraint_add_exec ( bContext C,
wmOperator op 
) [static]
static int object_constraint_copy_exec ( bContext C,
wmOperator UNUSEDop 
) [static]
static int object_constraints_clear_exec ( bContext C,
wmOperator UNUSEDop 
) [static]
void OBJECT_OT_constraint_add ( wmOperatorType ot)
void OBJECT_OT_constraint_add_with_targets ( wmOperatorType ot)
void OBJECT_OT_constraints_clear ( wmOperatorType ot)
void OBJECT_OT_constraints_copy ( wmOperatorType ot)
void object_test_constraints ( Object owner)
static int objectsolver_clear_inverse_exec ( bContext C,
wmOperator op 
) [static]
static int objectsolver_clear_inverse_invoke ( bContext C,
wmOperator op,
wmEvent UNUSEDevent 
) [static]
static int objectsolver_set_inverse_exec ( bContext C,
wmOperator op 
) [static]
static int objectsolver_set_inverse_invoke ( bContext C,
wmOperator op,
wmEvent UNUSEDevent 
) [static]
static int pose_constraint_add_exec ( bContext C,
wmOperator op 
) [static]
static int pose_constraint_copy_exec ( bContext C,
wmOperator op 
) [static]
static int pose_constraints_clear_exec ( bContext C,
wmOperator UNUSEDop 
) [static]
static int pose_ik_add_exec ( bContext C,
wmOperator op 
) [static]
static int pose_ik_add_invoke ( bContext C,
wmOperator op,
wmEvent UNUSEDevt 
) [static]
static int pose_ik_clear_exec ( bContext C,
wmOperator UNUSEDop 
) [static]
void POSE_OT_constraint_add ( wmOperatorType ot)
void POSE_OT_constraint_add_with_targets ( wmOperatorType ot)
void POSE_OT_constraints_clear ( wmOperatorType ot)
void POSE_OT_constraints_copy ( wmOperatorType ot)
void POSE_OT_ik_add ( wmOperatorType ot)
void POSE_OT_ik_clear ( wmOperatorType ot)
static void set_constraint_nth_target ( bConstraint con,
Object target,
const char  subtarget[],
int  index 
) [static]
static int stretchto_reset_exec ( bContext C,
wmOperator op 
) [static]
static int stretchto_reset_invoke ( bContext C,
wmOperator op,
wmEvent UNUSEDevent 
) [static]
static void test_constraints ( Object owner,
bPoseChannel pchan 
) [static]

Definition at line 262 of file object_constraint.c.

References bActionConstraint::act, BIK_test_constraint(), BKE_tracking_get_camera_object(), BKE_tracking_named_object(), BKE_tracking_named_track(), CAMERASOLVER_ACTIVECLIP, bSplineIKConstraint::chainlen, bObjectSolverConstraint::clip, bCameraSolverConstraint::clip, bFollowTrackConstraint::clip, CONSTRAINT_DISABLE, constraint_get_typeinfo(), CONSTRAINT_OBTYPE_BONE, CONSTRAINT_OBTYPE_OBJECT, CONSTRAINT_SPLINEIK_BOUND, CONSTRAINT_TYPE_ACTION, CONSTRAINT_TYPE_CAMERASOLVER, CONSTRAINT_TYPE_CLAMPTO, CONSTRAINT_TYPE_FOLLOWPATH, CONSTRAINT_TYPE_FOLLOWTRACK, CONSTRAINT_TYPE_KINEMATIC, CONSTRAINT_TYPE_LOCKTRACK, CONSTRAINT_TYPE_OBJECTSOLVER, CONSTRAINT_TYPE_PIVOT, CONSTRAINT_TYPE_SPLINEIK, CONSTRAINT_TYPE_TRACKTO, bPoseChannel::constraints, Object::constraints, CU_PATH, Object::data, bConstraint::data, data, ELEM3, exist_object(), ListBase::first, Curve::flag, bObjectSolverConstraint::flag, bCameraSolverConstraint::flag, bFollowTrackConstraint::flag, bSplineIKConstraint::flag, bConstraint::flag, bConstraintTypeInfo::flush_constraint_targets, get_armature(), bConstraintTypeInfo::get_constraint_targets, get_named_bone(), bLockTrackConstraint::lockflag, MEM_freeN(), bPoseChannel::name, bConstraintTarget::next, bConstraint::next, NULL, bSplineIKConstraint::numpoints, OB_ARMATURE, OB_CURVE, bFollowTrackConstraint::object, bSplineIKConstraint::points, bKinematicConstraint::polesubtarget, bKinematicConstraint::poletar, bTrackToConstraint::reserved1, bTrackToConstraint::reserved2, bConstraintTarget::subtarget, bPivotConstraint::subtarget, bKinematicConstraint::subtarget, bConstraintTarget::tar, bPivotConstraint::tar, bKinematicConstraint::tar, bFollowTrackConstraint::track, bLockTrackConstraint::trackflag, bFollowPathConstraint::trackflag, MovieClip::tracking, bConstraint::type, Object::type, and bFollowPathConstraint::upflag.

Referenced by object_test_constraints().

static void validate_pyconstraint_cb ( void *  arg1,
void *  arg2 
) [static]

Definition at line 148 of file object_constraint.c.

References data, G, i, Text::id, Object::index, ID::next, NULL, and bPythonConstraint::text.

Referenced by constraint_add_exec().


Variable Documentation

Initial value:
 {
    {EDIT_CONSTRAINT_OWNER_OBJECT, "OBJECT", 0, "Object", "Edit a constraint on the active object"},
    {EDIT_CONSTRAINT_OWNER_BONE, "BONE", 0, "Bone", "Edit a constraint on the active bone"},
    {0, NULL, 0, NULL, NULL}}

Definition at line 521 of file object_constraint.c.