Blender  V2.93
Classes | Typedefs | Functions
BKE_constraint.h File Reference

Go to the source code of this file.

Classes

struct  bConstraintOb
 
struct  bConstraintTypeInfo
 

Typedefs

typedef struct bConstraintOb bConstraintOb
 
typedef void(* ConstraintIDFunc) (struct bConstraint *con, struct ID **idpoin, bool is_reference, void *userdata)
 
typedef struct bConstraintTypeInfo bConstraintTypeInfo
 

Functions

const bConstraintTypeInfoBKE_constraint_typeinfo_get (struct bConstraint *con)
 
const bConstraintTypeInfoBKE_constraint_typeinfo_from_type (int type)
 
void BKE_constraint_unique_name (struct bConstraint *con, struct ListBase *list)
 
struct bConstraintBKE_constraint_duplicate_ex (struct bConstraint *src, const int flag, const bool do_extern)
 
struct bConstraintBKE_constraint_copy_for_pose (struct Object *ob, struct bPoseChannel *pchan, struct bConstraint *src)
 
struct bConstraintBKE_constraint_copy_for_object (struct Object *ob, struct bConstraint *src)
 
void BKE_constraints_free (struct ListBase *list)
 
void BKE_constraints_free_ex (struct ListBase *list, bool do_id_user)
 
void BKE_constraints_copy (struct ListBase *dst, const struct ListBase *src, bool do_extern)
 
void BKE_constraints_copy_ex (struct ListBase *dst, const struct ListBase *src, const int flag, bool do_extern)
 
void BKE_constraints_id_loop (struct ListBase *list, ConstraintIDFunc func, void *userdata)
 
void BKE_constraint_free_data (struct bConstraint *con)
 
void BKE_constraint_free_data_ex (struct bConstraint *con, bool do_id_user)
 
bool BKE_constraint_target_uses_bbone (struct bConstraint *con, struct bConstraintTarget *ct)
 
struct bConstraintBKE_constraints_active_get (struct ListBase *list)
 
void BKE_constraints_active_set (ListBase *list, struct bConstraint *con)
 
struct bConstraintBKE_constraints_find_name (struct ListBase *list, const char *name)
 
struct bConstraintBKE_constraint_find_from_target (struct Object *ob, struct bConstraintTarget *tgt, struct bPoseChannel **r_pchan)
 
bool BKE_constraint_is_nonlocal_in_liboverride (const struct Object *ob, const struct bConstraint *con)
 
struct bConstraintBKE_constraint_add_for_object (struct Object *ob, const char *name, short type)
 
struct bConstraintBKE_constraint_add_for_pose (struct Object *ob, struct bPoseChannel *pchan, const char *name, short type)
 
bool BKE_constraint_remove_ex (ListBase *list, struct Object *ob, struct bConstraint *con, bool clear_dep)
 
bool BKE_constraint_remove (ListBase *list, struct bConstraint *con)
 
void BKE_constraint_panel_expand (struct bConstraint *con)
 
void BKE_constraints_proxylocal_extract (struct ListBase *dst, struct ListBase *src)
 
bool BKE_constraints_proxylocked_owner (struct Object *ob, struct bPoseChannel *pchan)
 
struct bConstraintObBKE_constraints_make_evalob (struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, void *subdata, short datatype)
 
void BKE_constraints_clear_evalob (struct bConstraintOb *cob)
 
void BKE_constraint_mat_convertspace (struct Object *ob, struct bPoseChannel *pchan, struct bConstraintOb *cob, float mat[4][4], short from, short to, const bool keep_scale)
 
void BKE_constraint_target_matrix_get (struct Depsgraph *depsgraph, struct Scene *scene, struct bConstraint *con, int index, short ownertype, void *ownerdata, float mat[4][4], float ctime)
 
void BKE_constraint_targets_for_solving_get (struct Depsgraph *depsgraph, struct bConstraint *con, struct bConstraintOb *ob, struct ListBase *targets, float ctime)
 
void BKE_constraint_custom_object_space_get (float r_mat[4][4], struct bConstraint *con)
 
void BKE_constraints_solve (struct Depsgraph *depsgraph, struct ListBase *conlist, struct bConstraintOb *cob, float ctime)
 
void BKE_constraint_blend_write (struct BlendWriter *writer, struct ListBase *conlist)
 
void BKE_constraint_blend_read_data (struct BlendDataReader *reader, struct ListBase *lb)
 
void BKE_constraint_blend_read_lib (struct BlendLibReader *reader, struct ID *id, struct ListBase *conlist)
 
void BKE_constraint_blend_read_expand (struct BlendExpander *expander, struct ListBase *lb)
 

Typedef Documentation

◆ bConstraintOb

typedef struct bConstraintOb bConstraintOb

◆ bConstraintTypeInfo

Constraint Type-Info (shorthand in code = cti): This struct provides function pointers for runtime, so that functions can be written more generally (with fewer/no special exceptions for various constraints).

Callers of these functions must check that they actually point to something useful, as some constraints don't define some of these.

Warning: it is not too advisable to reorder order of members of this struct, as you'll have to edit quite a few NUM_CONSTRAINT_TYPES of these structs.

◆ ConstraintIDFunc

typedef void(* ConstraintIDFunc) (struct bConstraint *con, struct ID **idpoin, bool is_reference, void *userdata)

Definition at line 71 of file BKE_constraint.h.

Function Documentation

◆ BKE_constraint_add_for_object()

struct bConstraint* BKE_constraint_add_for_object ( struct Object ob,
const char *  name,
short  type 
)

◆ BKE_constraint_add_for_pose()

struct bConstraint* BKE_constraint_add_for_pose ( struct Object ob,
struct bPoseChannel pchan,
const char *  name,
short  type 
)

Definition at line 5659 of file constraint.c.

References add_new_constraint(), NULL, and type.

Referenced by add_temporary_ik_constraint(), and constraint_add_exec().

◆ BKE_constraint_blend_read_data()

void BKE_constraint_blend_read_data ( struct BlendDataReader reader,
struct ListBase lb 
)

◆ BKE_constraint_blend_read_expand()

void BKE_constraint_blend_read_expand ( struct BlendExpander expander,
struct ListBase lb 
)

◆ BKE_constraint_blend_read_lib()

void BKE_constraint_blend_read_lib ( struct BlendLibReader reader,
struct ID id,
struct ListBase conlist 
)

◆ BKE_constraint_blend_write()

void BKE_constraint_blend_write ( struct BlendWriter writer,
struct ListBase conlist 
)

◆ BKE_constraint_copy_for_object()

struct bConstraint* BKE_constraint_copy_for_object ( struct Object ob,
struct bConstraint src 
)

◆ BKE_constraint_copy_for_pose()

struct bConstraint* BKE_constraint_copy_for_pose ( struct Object ob,
struct bPoseChannel pchan,
struct bConstraint src 
)

◆ BKE_constraint_custom_object_space_get()

void BKE_constraint_custom_object_space_get ( float  r_mat[4][4],
struct bConstraint con 
)

◆ BKE_constraint_duplicate_ex()

struct bConstraint* BKE_constraint_duplicate_ex ( bConstraint src,
const int  flag,
const bool  do_extern 
)

Allocate and duplicate a single constraint, outside of any object/pose context.

Definition at line 5755 of file constraint.c.

References constraint_copy_data_ex(), CONSTRAINT_OVERRIDE_LIBRARY_LOCAL, bConstraint::flag, MEM_dupallocN, bConstraint::next, NULL, and bConstraint::prev.

Referenced by BKE_constraint_copy_for_object(), and BKE_constraint_copy_for_pose().

◆ BKE_constraint_find_from_target()

struct bConstraint* BKE_constraint_find_from_target ( struct Object ob,
struct bConstraintTarget tgt,
struct bPoseChannel **  r_pchan 
)

◆ BKE_constraint_free_data()

void BKE_constraint_free_data ( struct bConstraint con)

Definition at line 5492 of file constraint.c.

References BKE_constraint_free_data_ex().

Referenced by BKE_constraint_remove(), and blo_do_versions_280().

◆ BKE_constraint_free_data_ex()

void BKE_constraint_free_data_ex ( bConstraint con,
bool  do_id_user 
)

Free data of a specific constraint if it has any info. be sure to run BIK_clear_data() when freeing an IK constraint, unless DAG_relations_tag_update is called.

Definition at line 5470 of file constraint.c.

References BKE_constraint_typeinfo_get(), con_unlink_refs_cb(), bConstraint::data, bConstraintTypeInfo::free_data, bConstraintTypeInfo::id_looper, MEM_freeN, and NULL.

Referenced by BKE_constraint_free_data(), and BKE_constraints_free_ex().

◆ BKE_constraint_is_nonlocal_in_liboverride()

bool BKE_constraint_is_nonlocal_in_liboverride ( const struct Object ob,
const struct bConstraint con 
)

◆ BKE_constraint_mat_convertspace()

void BKE_constraint_mat_convertspace ( struct Object ob,
struct bPoseChannel pchan,
struct bConstraintOb cob,
float  mat[4][4],
short  from,
short  to,
const bool  keep_scale 
)

◆ BKE_constraint_panel_expand()

void BKE_constraint_panel_expand ( struct bConstraint con)

Definition at line 5540 of file constraint.c.

References bConstraint::ui_expand_flag, and UI_PANEL_DATA_EXPAND_ROOT.

Referenced by outliner_set_properties_tab().

◆ BKE_constraint_remove()

bool BKE_constraint_remove ( ListBase list,
struct bConstraint con 
)

◆ BKE_constraint_remove_ex()

bool BKE_constraint_remove_ex ( ListBase list,
struct Object ob,
struct bConstraint con,
bool  clear_dep 
)

◆ BKE_constraint_target_matrix_get()

void BKE_constraint_target_matrix_get ( struct Depsgraph depsgraph,
struct Scene scene,
struct bConstraint con,
int  index,
short  ownertype,
void *  ownerdata,
float  mat[4][4],
float  ctime 
)

◆ BKE_constraint_target_uses_bbone()

bool BKE_constraint_target_uses_bbone ( struct bConstraint con,
struct bConstraintTarget ct 
)

◆ BKE_constraint_targets_for_solving_get()

void BKE_constraint_targets_for_solving_get ( struct Depsgraph depsgraph,
struct bConstraint con,
struct bConstraintOb ob,
struct ListBase targets,
float  ctime 
)

◆ BKE_constraint_typeinfo_from_type()

const bConstraintTypeInfo* BKE_constraint_typeinfo_from_type ( int  type)

◆ BKE_constraint_typeinfo_get()

const bConstraintTypeInfo* BKE_constraint_typeinfo_get ( struct bConstraint con)

◆ BKE_constraint_unique_name()

void BKE_constraint_unique_name ( struct bConstraint con,
struct ListBase list 
)

Definition at line 123 of file constraint.c.

References BLI_uniquename(), DATA_, and bConstraint::name.

Referenced by add_new_constraint_to_list().

◆ BKE_constraints_active_get()

struct bConstraint* BKE_constraints_active_get ( struct ListBase list)

Definition at line 5812 of file constraint.c.

References CONSTRAINT_ACTIVE, bConstraint::flag, LISTBASE_FOREACH, and NULL.

Referenced by ED_object_constraint_active_get().

◆ BKE_constraints_active_set()

void BKE_constraints_active_set ( ListBase list,
struct bConstraint con 
)

◆ BKE_constraints_clear_evalob()

void BKE_constraints_clear_evalob ( struct bConstraintOb cob)

◆ BKE_constraints_copy()

void BKE_constraints_copy ( struct ListBase dst,
const struct ListBase src,
bool  do_extern 
)

◆ BKE_constraints_copy_ex()

void BKE_constraints_copy_ex ( struct ListBase dst,
const struct ListBase src,
const int  flag,
bool  do_extern 
)

◆ BKE_constraints_find_name()

struct bConstraint* BKE_constraints_find_name ( struct ListBase list,
const char *  name 
)

Definition at line 5806 of file constraint.c.

References BLI_findstring().

Referenced by edit_constraint_property_get().

◆ BKE_constraints_free()

void BKE_constraints_free ( struct ListBase list)

◆ BKE_constraints_free_ex()

void BKE_constraints_free_ex ( struct ListBase list,
bool  do_id_user 
)

◆ BKE_constraints_id_loop()

void BKE_constraints_id_loop ( struct ListBase list,
ConstraintIDFunc  func,
void *  userdata 
)

◆ BKE_constraints_make_evalob()

struct bConstraintOb* BKE_constraints_make_evalob ( struct Depsgraph depsgraph,
struct Scene scene,
struct Object ob,
void *  subdata,
short  datatype 
)

◆ BKE_constraints_proxylocal_extract()

void BKE_constraints_proxylocal_extract ( struct ListBase dst,
struct ListBase src 
)

◆ BKE_constraints_proxylocked_owner()

bool BKE_constraints_proxylocked_owner ( struct Object ob,
struct bPoseChannel pchan 
)

◆ BKE_constraints_solve()

void BKE_constraints_solve ( struct Depsgraph depsgraph,
struct ListBase conlist,
struct bConstraintOb cob,
float  ctime 
)