Blender  V3.3
Public Attributes | List of all members
bConstraintTypeInfo Struct Reference

#include <BKE_constraint.h>

Public Attributes

short type
 
short size
 
char name [32]
 
char structName [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)
 
void(* 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 75 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 92 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

Definition at line 119 of file BKE_constraint.h.

Referenced by bc_validateConstraints(), BKE_constraints_solve(), constraintRotLim(), constraintSizeLim(), and 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 109 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 88 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 104 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

void(* 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)

Definition at line 113 of file BKE_constraint.h.

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

◆ 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 90 of file BKE_constraint.h.

Referenced by con_invoke_id_looper().

◆ name

char bConstraintTypeInfo::name[32]

name of constraint in interface

Definition at line 82 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 97 of file BKE_constraint.h.

Referenced by add_new_constraint_internal().

◆ size

short bConstraintTypeInfo::size

size in bytes of the struct

Definition at line 80 of file BKE_constraint.h.

Referenced by add_new_constraint_internal().

◆ structName

char bConstraintTypeInfo::structName[32]

◆ type

short bConstraintTypeInfo::type

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