Blender
V3.3
|
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 |
typedef struct bConstraintOb bConstraintOb |
typedef struct bConstraintTypeInfo 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.
typedef void(* ConstraintIDFunc) (struct bConstraint *con, struct ID **idpoin, bool is_reference, void *userdata) |
Definition at line 55 of file BKE_constraint.h.
struct bConstraint* BKE_constraint_add_for_object | ( | struct Object * | ob, |
const char * | name, | ||
short | type | ||
) |
Add new constraint for the given object.
Definition at line 5870 of file constraint.c.
References add_new_constraint(), NULL, and type.
Referenced by blo_do_version_old_trackto_to_constraints(), constraint_add_exec(), DocumentImporter::create_constraints(), ED_object_parent_set(), blender::io::usd::USDXformReader::read_object_data(), blender::io::alembic::AbcObjectReader::setupObjectTransform(), and track_set_exec().
struct bConstraint* BKE_constraint_add_for_pose | ( | struct Object * | ob, |
struct bPoseChannel * | pchan, | ||
const char * | name, | ||
short | type | ||
) |
Add new constraint for the given bone.
Definition at line 5858 of file constraint.c.
References add_new_constraint(), NULL, and type.
Referenced by add_temporary_ik_constraint(), and constraint_add_exec().
bool BKE_constraint_apply_and_remove_for_object | ( | struct Depsgraph * | depsgraph, |
struct Scene * | scene, | ||
ListBase * | constraints, | ||
struct Object * | ob, | ||
struct bConstraint * | con | ||
) |
Definition at line 5658 of file constraint.c.
References BKE_constraint_apply_for_object(), BKE_constraint_remove_ex(), constraints, depsgraph, and scene.
Referenced by constraint_apply_exec().
bool BKE_constraint_apply_and_remove_for_pose | ( | struct Depsgraph * | depsgraph, |
struct Scene * | scene, | ||
ListBase * | constraints, | ||
struct Object * | ob, | ||
struct bConstraint * | con, | ||
struct bPoseChannel * | pchan | ||
) |
Definition at line 5720 of file constraint.c.
References BKE_constraint_apply_for_pose(), BKE_constraint_remove_ex(), constraints, depsgraph, and scene.
Referenced by constraint_apply_exec().
bool BKE_constraint_apply_for_object | ( | struct Depsgraph * | depsgraph, |
struct Scene * | scene, | ||
struct Object * | ob, | ||
struct bConstraint * | con | ||
) |
Apply the specified constraint in the given constraint stack.
Definition at line 5617 of file constraint.c.
References BKE_constraint_duplicate_ex(), BKE_constraint_free_data(), BKE_constraints_clear_evalob(), BKE_constraints_find_name(), BKE_constraints_make_evalob(), BKE_constraints_solve(), BKE_object_apply_mat4(), BKE_scene_frame_get(), BLI_freelinkN(), Object::constinv, CONSTRAINT_OBTYPE_OBJECT, Object::constraints, DEG_get_evaluated_object(), DEG_get_evaluated_scene(), depsgraph, ID_IS_LINKED, bConstraintOb::matrix, mul_m4_m4m4(), bConstraint::name, NULL, Object::obmat, and scene.
Referenced by BKE_constraint_apply_and_remove_for_object().
bool BKE_constraint_apply_for_pose | ( | struct Depsgraph * | depsgraph, |
struct Scene * | scene, | ||
struct Object * | ob, | ||
struct bPoseChannel * | pchan, | ||
struct bConstraint * | con | ||
) |
Definition at line 5671 of file constraint.c.
References BKE_armature_mat_pose_to_bone(), BKE_constraint_duplicate_ex(), BKE_constraint_free_data(), BKE_constraints_clear_evalob(), BKE_constraints_find_name(), BKE_constraints_make_evalob(), BKE_constraints_solve(), BKE_pchan_apply_mat4(), BKE_pose_channel_find_name(), BKE_scene_frame_get(), BLI_freelinkN(), bPoseChannel::bone, BONE_CONNECTED, bPoseChannel::constinv, CONSTRAINT_OBTYPE_BONE, bPoseChannel::constraints, copy_v3_v3(), DEG_get_evaluated_object(), DEG_get_evaluated_scene(), depsgraph, ListBase::first, Bone::flag, ID_IS_LINKED, ListBase::last, bConstraintOb::matrix, mul_m4_m4m4(), bPoseChannel::name, bConstraint::name, Object::pose, bPoseChannel::pose_mat, and scene.
Referenced by BKE_constraint_apply_and_remove_for_pose().
void BKE_constraint_blend_read_data | ( | struct BlendDataReader * | reader, |
struct ListBase * | lb | ||
) |
Definition at line 6489 of file constraint.c.
References BLO_read_data_address, BLO_read_list(), CONSTRAINT_IK_AUTO, CONSTRAINT_SPACE_POSE, CONSTRAINT_SPACEONCE, CONSTRAINT_TYPE_ARMATURE, CONSTRAINT_TYPE_CHILDOF, CONSTRAINT_TYPE_KINEMATIC, CONSTRAINT_TYPE_PYTHON, CONSTRAINT_TYPE_SPLINEIK, CONSTRAINT_TYPE_TRANSFORM_CACHE, data, bConstraint::data, bConstraint::flag, IDP_BlendDataRead, bConstraint::lin_error, LISTBASE_FOREACH, NULL, bConstraint::ownspace, bConstraint::rot_error, and bConstraint::type.
Referenced by BKE_pose_blend_read_data(), and object_blend_read_data().
void BKE_constraint_blend_read_expand | ( | struct BlendExpander * | expander, |
struct ListBase * | lb | ||
) |
Definition at line 6596 of file constraint.c.
References BKE_constraints_id_loop(), BLO_expand, expand_constraint_cb(), and LISTBASE_FOREACH.
Referenced by BKE_pose_blend_read_expand(), and object_blend_read_expand().
void BKE_constraint_blend_read_lib | ( | struct BlendLibReader * | reader, |
struct ID * | id, | ||
struct ListBase * | conlist | ||
) |
Definition at line 6559 of file constraint.c.
References BKE_constraints_id_loop(), BLO_read_id_address, CONSTRAINT_OVERRIDE_LIBRARY_LOCAL, CONSTRAINT_TYPE_NULL, bConstraint::data, bConstraint::flag, tConstraintLinkData::id, id, ID_IS_LINKED, ID::lib, lib_link_constraint_cb(), LISTBASE_FOREACH, NULL, tConstraintLinkData::reader, and bConstraint::type.
Referenced by BKE_pose_blend_read_lib(), and object_blend_read_lib().
void BKE_constraint_blend_write | ( | struct BlendWriter * | writer, |
struct ListBase * | conlist | ||
) |
Definition at line 6437 of file constraint.c.
References BKE_constraint_typeinfo_get(), BLO_write_float_array(), BLO_write_struct, BLO_write_struct_by_name(), CONSTRAINT_TYPE_ARMATURE, CONSTRAINT_TYPE_PYTHON, CONSTRAINT_TYPE_SPLINEIK, data, bConstraint::data, IDP_BlendWrite(), LISTBASE_FOREACH, bConstraintTypeInfo::structName, and bConstraint::type.
Referenced by BKE_pose_blend_write(), and object_blend_write().
struct bConstraint* BKE_constraint_copy_for_object | ( | struct Object * | ob, |
struct bConstraint * | src | ||
) |
Add a copy of the given constraint for the given object.
Definition at line 5966 of file constraint.c.
References add_new_constraint_to_list(), BKE_constraint_duplicate_ex(), ID_IS_LINKED, NULL, and src.
Referenced by constraint_copy_exec(), constraint_copy_to_selected_exec(), and ED_object_constraint_copy_for_object().
struct bConstraint* BKE_constraint_copy_for_pose | ( | struct Object * | ob, |
struct bPoseChannel * | pchan, | ||
struct bConstraint * | src | ||
) |
Add a copy of the given constraint for the given bone.
Definition at line 5955 of file constraint.c.
References add_new_constraint_to_list(), BKE_constraint_duplicate_ex(), ID_IS_LINKED, NULL, and src.
Referenced by constraint_copy_exec(), constraint_copy_to_selected_exec(), and ED_object_constraint_copy_for_pose().
void BKE_constraint_custom_object_space_init | ( | struct bConstraintOb * | cob, |
struct bConstraint * | con | ||
) |
Initialize the Custom Space matrix inside cob
(if required by the constraint).
cob | Constraint evaluation context (contains the matrix to be initialized). |
con | Constraint that is about to be evaluated. |
Definition at line 6331 of file constraint.c.
References CONSTRAINT_SPACE_WORLD, constraint_target_to_mat4(), is_custom_space_needed(), NULL, bConstraintOb::space_obj_world_matrix, bConstraint::space_object, bConstraint::space_subtarget, and unit_m4().
Referenced by BKE_constraint_target_matrix_get(), BKE_constraints_solve(), constraintTransLim(), OVERLAY_relationship_lines(), updateDuplicateActionConstraintSettings(), and updateDuplicateLocRotConstraintSettings().
struct bConstraint* BKE_constraint_duplicate_ex | ( | struct bConstraint * | src, |
int | flag, | ||
bool | do_extern | ||
) |
Allocate and duplicate a single constraint, outside of any object/pose context.
Definition at line 5947 of file constraint.c.
References constraint_copy_data_ex(), MEM_dupallocN, bConstraint::next, NULL, bConstraint::prev, and src.
Referenced by BKE_constraint_apply_for_object(), BKE_constraint_apply_for_pose(), BKE_constraint_copy_for_object(), and BKE_constraint_copy_for_pose().
struct bConstraint* BKE_constraint_find_from_target | ( | struct Object * | ob, |
struct bConstraintTarget * | tgt, | ||
struct bPoseChannel ** | r_pchan | ||
) |
Finds the constraint that owns the given target within the object.
Definition at line 6052 of file constraint.c.
References bPose::chanbase, constraint_list_find_from_target(), Object::constraints, LISTBASE_FOREACH, NULL, Object::pose, and result.
Referenced by blender::deg::RNANodeQuery::construct_node_identifier().
void BKE_constraint_free_data | ( | struct bConstraint * | con | ) |
Definition at line 5571 of file constraint.c.
References BKE_constraint_free_data_ex().
Referenced by BKE_constraint_apply_for_object(), BKE_constraint_apply_for_pose(), BKE_constraint_remove(), and blo_do_versions_280().
void BKE_constraint_free_data_ex | ( | struct 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 5549 of file constraint.c.
References BKE_constraint_typeinfo_get(), con_invoke_id_looper(), con_unlink_refs_cb(), bConstraint::data, bConstraintTypeInfo::free_data, MEM_freeN, and NULL.
Referenced by BKE_constraint_free_data(), and BKE_constraints_free_ex().
bool BKE_constraint_is_nonlocal_in_liboverride | ( | const struct Object * | ob, |
const struct bConstraint * | con | ||
) |
Check whether given constraint is not local (i.e. from linked data) when the object is a library override.
con | May be NULL, in which case we consider it as a non-local constraint case. |
Referenced by edit_constraint_poll_generic().
void BKE_constraint_mat_convertspace | ( | struct Object * | ob, |
struct bPoseChannel * | pchan, | ||
struct bConstraintOb * | cob, | ||
float | mat[4][4], | ||
short | from, | ||
short | to, | ||
bool | keep_scale | ||
) |
This function is responsible for the correct transformations/conversions of a matrix from one space to another for constraint evaluation. For now, this is only implemented for objects and pose-channels.
Definition at line 245 of file constraint.c.
References Bone::arm_mat, BKE_armature_mat_bone_to_pose(), BKE_armature_mat_pose_to_bone(), BKE_constraint_mat_convertspace(), BKE_object_to_mat4(), BLI_assert, bPoseChannel::bone, CONSTRAINT_SPACE_CUSTOM, CONSTRAINT_SPACE_LOCAL, CONSTRAINT_SPACE_OWNLOCAL, CONSTRAINT_SPACE_PARLOCAL, CONSTRAINT_SPACE_POSE, CONSTRAINT_SPACE_WORLD, copy_m4_m4(), ELEM, from, invert_m4_m4(), invert_m4_m4_safe(), mul_m4_m4m4(), mul_m4_series, normalize_m4(), NULL, Object::obmat, Object::parent, Object::parentinv, bConstraintOb::pchan, bConstraintOb::space_obj_world_matrix, and zero_v3().
Referenced by BKE_constraint_mat_convertspace(), BKE_constraints_solve(), constraint_target_to_mat4(), dvar_eval_locDiff(), shrinkwrap_get_tarmat(), updateDuplicateActionConstraintSettings(), and updateDuplicateLocRotConstraintSettings().
void BKE_constraint_panel_expand | ( | struct bConstraint * | con | ) |
Definition at line 5734 of file constraint.c.
References bConstraint::ui_expand_flag, and UI_PANEL_DATA_EXPAND_ROOT.
Referenced by outliner_set_properties_tab().
bool BKE_constraint_remove | ( | ListBase * | list, |
struct bConstraint * | con | ||
) |
Remove the specified constraint from the given constraint stack.
Definition at line 5592 of file constraint.c.
References BKE_constraint_free_data(), and BLI_freelinkN().
Referenced by BKE_constraint_remove_ex(), object_track_clear_exec(), and pose_ik_clear_exec().
bool BKE_constraint_remove_ex | ( | ListBase * | list, |
struct Object * | ob, | ||
struct bConstraint * | con, | ||
bool | clear_dep | ||
) |
Definition at line 5603 of file constraint.c.
References BIK_clear_data(), BKE_constraint_remove(), CONSTRAINT_TYPE_KINEMATIC, CONSTRAINT_TYPE_SPLINEIK, ELEM, Object::pose, type, and bConstraint::type.
Referenced by BKE_constraint_apply_and_remove_for_object(), BKE_constraint_apply_and_remove_for_pose(), constraint_delete_exec(), and constraint_fn().
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 | ||
) |
This function is a relic from the prior implementations of the constraints system, when all constraints either had one or no targets. It used to be called during the main constraint solving loop, but is now only used for the remaining cases for a few constraints.
None of the actual calculations of the matrices should be done here! Also, this function is not to be used by any new constraints, particularly any that have multiple targets.
Definition at line 6214 of file constraint.c.
References BKE_constraint_custom_object_space_init(), BKE_constraint_typeinfo_get(), BLI_findlink(), CONSTRAINT_OBTYPE_BONE, CONSTRAINT_OBTYPE_OBJECT, copy_m4_m4(), bConstraintOb::depsgraph, depsgraph, bConstraintTypeInfo::flush_constraint_targets, bConstraintTypeInfo::get_constraint_targets, bConstraintTypeInfo::get_target_matrix, bConstraintOb::matrix, bConstraintTarget::matrix, MEM_callocN, MEM_freeN, NULL, bConstraintOb::ob, Object::obmat, bConstraintOb::pchan, bPoseChannel::pose_mat, bConstraintOb::scene, scene, bConstraintOb::startmat, bConstraintOb::type, and unit_m4().
Referenced by base_callback(), ED_object_parent_set(), execute_posetree(), and target_callback().
bool BKE_constraint_target_uses_bbone | ( | struct bConstraint * | con, |
struct bConstraintTarget * | ct | ||
) |
Definition at line 5847 of file constraint.c.
References CONSTRAINT_BBONE_SHAPE, CONSTRAINT_TAR_CUSTOM_SPACE, CONSTRAINT_TYPE_ARMATURE, bConstraint::flag, bConstraintTarget::flag, and bConstraint::type.
Referenced by blender::deg::DepsgraphRelationBuilder::build_constraints().
void BKE_constraint_targets_flush | ( | struct bConstraint * | con, |
struct ListBase * | targets, | ||
bool | no_copy | ||
) |
Copies changed data from the list produced by BKE_constraint_targets_get back to the constraint data structures and frees memory.
targets | List of targets filled by BKE_constraint_targets_get. |
no_copy | Only free memory without copying changes (read-only mode). |
Definition at line 6186 of file constraint.c.
References BKE_constraint_typeinfo_get(), BLI_assert, BLI_freelinkN(), BLI_strncpy(), CONSTRAINT_TAR_CUSTOM_SPACE, bConstraintTarget::flag, bConstraintTypeInfo::flush_constraint_targets, if(), is_custom_space_needed(), ListBase::last, bConstraint::space_object, bConstraint::space_subtarget, bConstraintTarget::subtarget, and bConstraintTarget::tar.
Referenced by BKE_object_modifier_update_subframe(), BKE_pose_channels_remove(), blender::deg::DepsgraphRelationBuilder::build_constraints(), constraint_bone_name_fix(), copy_object_pose(), BCAnimationSampler::is_animated_by_constraint(), joined_armature_fix_links_constraints(), OVERLAY_relationship_lines(), pose_select_constraint_target_exec(), separated_armature_fix_links(), set_constraint_nth_target(), test_constraint(), and updateDuplicateSubtarget().
void BKE_constraint_targets_for_solving_get | ( | struct Depsgraph * | depsgraph, |
struct bConstraint * | con, | ||
struct bConstraintOb * | ob, | ||
struct ListBase * | targets, | ||
float | ctime | ||
) |
Get the list of targets required for solving a constraint.
Definition at line 6293 of file constraint.c.
References BKE_constraint_typeinfo_get(), CONSTRAINT_TYPE_ARMATURE, depsgraph, ELEM, ListBase::first, bConstraintTypeInfo::get_constraint_targets, bConstraintTypeInfo::get_target_matrix, bConstraintTarget::matrix, bConstraintTarget::next, bConstraintTypeInfo::type, and unit_m4().
Referenced by BKE_constraints_solve(), and constraintTransLim().
int BKE_constraint_targets_get | ( | struct bConstraint * | con, |
struct ListBase * | r_targets | ||
) |
Retrieves the list of all constraint targets, including the custom space target. Must be followed by a call to BKE_constraint_targets_flush to free memory.
r_targets | Pointer to the list to be initialized with target data. |
Definition at line 6157 of file constraint.c.
References BKE_constraint_typeinfo_get(), BLI_listbase_clear(), CONSTRAINT_SPACE_WORLD, CONSTRAINT_TAR_CUSTOM_SPACE, count, bConstraintTarget::flag, bConstraintTypeInfo::get_constraint_targets, is_custom_space_needed(), SINGLETARGET_GET_TARS, bConstraintTarget::space, bConstraint::space_object, and bConstraint::space_subtarget.
Referenced by BKE_object_modifier_update_subframe(), BKE_pose_channels_remove(), blender::deg::DepsgraphRelationBuilder::build_constraints(), constraint_bone_name_fix(), copy_object_pose(), BCAnimationSampler::is_animated_by_constraint(), joined_armature_fix_links_constraints(), OVERLAY_relationship_lines(), pose_select_constraint_target_exec(), separated_armature_fix_links(), set_constraint_nth_target(), test_constraint(), and updateDuplicateSubtarget().
const bConstraintTypeInfo* BKE_constraint_typeinfo_from_type | ( | int | type | ) |
This function should be used for getting the appropriate type-info when only a constraint type is known.
Definition at line 5487 of file constraint.c.
References CLOG_WARN, CONSTRAINT_TYPE_NULL, constraints_init_typeinfo(), constraintsTypeInfo, CTI_INIT, LOG, NULL, NUM_CONSTRAINT_TYPES, and type.
Referenced by add_new_constraint_internal(), BKE_constraint_typeinfo_get(), bone_constraint_panel_id(), constraintRotLim(), constraintSizeLim(), constraintTransLim(), and object_constraint_panel_id().
const bConstraintTypeInfo* BKE_constraint_typeinfo_get | ( | struct bConstraint * | con | ) |
This function should always be used to get the appropriate type-info, as it has checks which prevent segfaults in some weird cases.
Definition at line 5506 of file constraint.c.
References BKE_constraint_typeinfo_from_type(), NULL, and bConstraint::type.
Referenced by bc_validateConstraints(), BKE_constraint_blend_write(), BKE_constraint_free_data_ex(), BKE_constraint_target_matrix_get(), BKE_constraint_targets_flush(), BKE_constraint_targets_for_solving_get(), BKE_constraint_targets_get(), BKE_constraints_id_loop(), BKE_constraints_solve(), blender::deg::DepsgraphRelationBuilder::build_constraints(), constraint_copy_data_ex(), object_solver_camera(), object_solver_inverted_matrix(), and OVERLAY_relationship_lines().
void BKE_constraint_unique_name | ( | struct bConstraint * | con, |
struct ListBase * | list | ||
) |
Find the first available, non-duplicate name for a given constraint.
Definition at line 112 of file constraint.c.
References BLI_uniquename(), DATA_, and bConstraint::name.
Referenced by add_new_constraint_to_list().
struct bConstraint* BKE_constraints_active_get | ( | struct ListBase * | list | ) |
Finds the 'active' constraint in a constraint stack.
Definition at line 6001 of file constraint.c.
References CONSTRAINT_ACTIVE, bConstraint::flag, LISTBASE_FOREACH, and NULL.
Referenced by ED_object_constraint_active_get().
void BKE_constraints_active_set | ( | ListBase * | list, |
struct bConstraint * | con | ||
) |
Set the given constraint as the active one (clearing all the others).
Definition at line 6017 of file constraint.c.
References CONSTRAINT_ACTIVE, and LISTBASE_FOREACH.
Referenced by add_new_constraint_to_list(), constraint_fn(), and ED_object_constraint_active_set().
void BKE_constraints_clear_evalob | ( | struct bConstraintOb * | cob | ) |
Cleanup after constraint evaluation.
Definition at line 196 of file constraint.c.
References bPoseChannel::constinv, Object::constinv, CONSTRAINT_OBTYPE_BONE, CONSTRAINT_OBTYPE_OBJECT, copy_m4_m4(), Object::imat, invert_m4_m4(), bConstraintOb::matrix, MEM_freeN, mul_m4_m4m4(), NULL, bConstraintOb::ob, Object::obmat, bConstraintOb::pchan, bPoseChannel::pose_mat, bConstraintOb::startmat, and bConstraintOb::type.
Referenced by BKE_constraint_apply_for_object(), BKE_constraint_apply_for_pose(), BKE_object_eval_constraints(), BKE_pose_where_is_bone(), and object_where_is_calc_ex().
void BKE_constraints_copy_ex | ( | struct ListBase * | dst, |
const struct ListBase * | src, | ||
int | flag, | ||
bool | do_extern | ||
) |
Duplicate all of the constraints in a constraint stack.
Referenced by BKE_pose_copy_data_ex(), and object_copy_data().
struct bConstraint* BKE_constraints_find_name | ( | struct ListBase * | list, |
const char * | name | ||
) |
Definition at line 5996 of file constraint.c.
References BLI_findstring().
Referenced by BKE_constraint_apply_for_object(), BKE_constraint_apply_for_pose(), and edit_constraint_property_get().
Definition at line 5587 of file constraint.c.
References BKE_constraints_free_ex().
Referenced by ED_object_constraint_link(), make_object_duplilist_real(), object_constraints_clear_exec(), and pose_constraints_clear_exec().
Free all constraints from a constraint-stack.
Definition at line 5576 of file constraint.c.
References BKE_constraint_free_data_ex(), BLI_freelistN(), and LISTBASE_FOREACH.
Referenced by BKE_constraints_free(), BKE_pose_channel_free_ex(), and object_free_data().
void BKE_constraints_id_loop | ( | struct ListBase * | list, |
ConstraintIDFunc | func, | ||
void * | userdata | ||
) |
Run the given callback on all ID-blocks in list of constraints.
Definition at line 5877 of file constraint.c.
References BKE_constraint_typeinfo_get(), con_invoke_id_looper(), and LISTBASE_FOREACH.
Referenced by BKE_constraint_blend_read_expand(), BKE_constraint_blend_read_lib(), blender::deg::DepsgraphNodeBuilder::build_object(), blender::deg::DepsgraphRelationBuilder::build_object(), blender::deg::DepsgraphNodeBuilder::build_pose_constraints(), blender::deg::DepsgraphRelationBuilder::build_rig(), and object_foreach_id().
struct bConstraintOb* BKE_constraints_make_evalob | ( | struct Depsgraph * | depsgraph, |
struct Scene * | scene, | ||
struct Object * | ob, | ||
void * | subdata, | ||
short | datatype | ||
) |
Package an object/bone for use in constraint evaluation.
This function MEM_calloc's a bConstraintOb struct, that will need to be freed after evaluation.
Definition at line 119 of file constraint.c.
References CONSTRAINT_OBTYPE_BONE, CONSTRAINT_OBTYPE_OBJECT, copy_m4_m4(), bConstraintOb::depsgraph, depsgraph, EULER_ORDER_DEFAULT, bConstraintOb::matrix, MEM_callocN, mul_m4_m4m4(), bConstraintOb::ob, Object::obmat, bConstraintOb::pchan, bPoseChannel::pose_mat, bPoseChannel::rotmode, Object::rotmode, bConstraintOb::rotOrder, bConstraintOb::scene, scene, bConstraintOb::startmat, bConstraintOb::type, and unit_m4().
Referenced by BKE_constraint_apply_for_object(), BKE_constraint_apply_for_pose(), BKE_object_eval_constraints(), BKE_pose_where_is_bone(), object_where_is_calc_ex(), and OVERLAY_relationship_lines().
void BKE_constraints_solve | ( | struct Depsgraph * | depsgraph, |
struct ListBase * | conlist, | ||
struct bConstraintOb * | cob, | ||
float | ctime | ||
) |
This function is called whenever constraints need to be evaluated. Currently, all constraints that can be evaluated are every time this gets run.
BKE_constraints_make_evalob and BKE_constraints_clear_evalob should be called before and after running this function, to sort out cob.
Definition at line 6352 of file constraint.c.
References BKE_constraint_custom_object_space_init(), BKE_constraint_mat_convertspace(), BKE_constraint_targets_for_solving_get(), BKE_constraint_typeinfo_get(), CONSTRAINT_DISABLE, CONSTRAINT_OFF, CONSTRAINT_SPACE_WORLD, CONSTRAINT_SPACEONCE, copy_m4_m4(), depsgraph, bConstraint::enforce, bConstraintTypeInfo::evaluate_constraint, ListBase::first, bConstraint::flag, bConstraintTypeInfo::flush_constraint_targets, interp_m4_m4m4(), bConstraintOb::matrix, bConstraint::next, NULL, bConstraintOb::ob, bConstraint::ownspace, and bConstraintOb::pchan.
Referenced by BKE_constraint_apply_for_object(), BKE_constraint_apply_for_pose(), BKE_object_eval_constraints(), BKE_pose_where_is_bone(), and object_where_is_calc_ex().