Blender V5.0
bConstraintTypeInfo Struct Reference

#include <BKE_constraint.h>

Public Attributes

short type
short size
char name [32]
char struct_name [32]
void(* free_data )(struct bConstraint *con)
void(* id_looper )(struct bConstraint *con, ConstraintIDFunc func, void *userdata)
void(* copy_data )(struct bConstraint *con, struct bConstraint *src)
void(* new_data )(void *cdata)
int(* get_constraint_targets )(struct bConstraint *con, struct ListBase *list)
void(* flush_constraint_targets )(struct bConstraint *con, struct ListBase *list, bool no_copy)
bool(* get_target_matrix )(struct Depsgraph *depsgraph, struct bConstraint *con, struct bConstraintOb *cob, struct bConstraintTarget *ct, float ctime)
void(* evaluate_constraint )(struct bConstraint *con, struct bConstraintOb *cob, struct ListBase *targets)

Detailed Description

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.

Definition at line 74 of file BKE_constraint.h.

Member Data Documentation

◆ copy_data

void(* bConstraintTypeInfo::copy_data) (struct bConstraint *con, struct bConstraint *src)

copy any special data that is allocated separately (optional)

Definition at line 91 of file BKE_constraint.h.

Referenced by constraint_copy_data_ex().

◆ evaluate_constraint

void(* bConstraintTypeInfo::evaluate_constraint) (struct bConstraint *con, struct bConstraintOb *cob, struct ListBase *targets)

Evaluate the constraint for the given time. solved as separate loop.

Definition at line 129 of file BKE_constraint.h.

Referenced by BKE_constraints_solve(), blender::ed::transform::constraintRotLim(), blender::ed::transform::constraintScaleLim(), and blender::ed::transform::constraintTransLim().

◆ flush_constraint_targets

void(* bConstraintTypeInfo::flush_constraint_targets) (struct bConstraint *con, struct ListBase *list, bool no_copy)

For single-target constraints only: flush data back to source data, and the free memory used.

Definition at line 108 of file BKE_constraint.h.

Referenced by BKE_constraint_target_matrix_get(), BKE_constraint_targets_flush(), and BKE_constraints_solve().

◆ free_data

void(* bConstraintTypeInfo::free_data) (struct bConstraint *con)

free any data that is allocated separately (optional)

Definition at line 87 of file BKE_constraint.h.

Referenced by BKE_constraint_free_data_ex().

◆ get_constraint_targets

int(* bConstraintTypeInfo::get_constraint_targets) (struct bConstraint *con, struct ListBase *list)

For multi-target constraints: return that list; otherwise make a temporary list (returns number of targets).

Definition at line 103 of file BKE_constraint.h.

Referenced by BKE_constraint_target_matrix_get(), BKE_constraint_targets_for_solving_get(), and BKE_constraint_targets_get().

◆ get_target_matrix

bool(* bConstraintTypeInfo::get_target_matrix) (struct Depsgraph *depsgraph, struct bConstraint *con, struct bConstraintOb *cob, struct bConstraintTarget *ct, float ctime)

Set the ct->matrix for the given constraint target (at the given ctime).

Returns
Whether the constraint has a valid target. This can be an explicitly-given target, but can also be dynamically chosen (for example for auto-IK).

Note that ct->matrix may still be updated (typically to the identity matrix) even when this function returns false.

Definition at line 120 of file BKE_constraint.h.

Referenced by BKE_constraint_target_matrix_get(), BKE_constraint_targets_for_solving_get(), and blender::draw::overlay::Relations::object_sync().

◆ id_looper

void(* bConstraintTypeInfo::id_looper) (struct bConstraint *con, ConstraintIDFunc func, void *userdata)

run the provided callback function on all the ID-blocks linked to the constraint

Definition at line 89 of file BKE_constraint.h.

Referenced by con_invoke_id_looper().

◆ name

char bConstraintTypeInfo::name[32]

name of constraint in interface

Definition at line 81 of file BKE_constraint.h.

Referenced by add_new_constraint_internal(), and blender::deg::DepsgraphRelationBuilder::build_constraints().

◆ new_data

void(* bConstraintTypeInfo::new_data) (void *cdata)

Set settings for data that will be used for bConstraint.data (memory already allocated using MEM_callocN).

Definition at line 96 of file BKE_constraint.h.

Referenced by add_new_constraint_internal().

◆ size

short bConstraintTypeInfo::size

size in bytes of the struct

Definition at line 79 of file BKE_constraint.h.

Referenced by add_new_constraint_internal().

◆ struct_name

char bConstraintTypeInfo::struct_name[32]

◆ type


The documentation for this struct was generated from the following file: