|
Blender V5.0
|
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 54 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 6163 of file constraint.cc.
References add_new_constraint(), and name.
Referenced by blo_do_version_old_trackto_to_constraints(), blender::ed::object::constraint_add_exec(), blender::ed::object::parent_set_with_depsgraph(), blender::io::usd::USDXformReader::read_object_data(), blender::io::alembic::AbcObjectReader::setupObjectTransform(), and blender::ed::object::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 6151 of file constraint.cc.
References add_new_constraint(), and name.
Referenced by blender::ed::transform::add_temporary_ik_constraint(), and blender::ed::object::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 5952 of file constraint.cc.
References BKE_constraint_apply_for_object(), BKE_constraint_remove_ex(), constraints, and depsgraph.
Referenced by blender::ed::object::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 6014 of file constraint.cc.
References BKE_constraint_apply_for_pose(), BKE_constraint_remove_ex(), constraints, and depsgraph.
Referenced by blender::ed::object::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 5911 of file constraint.cc.
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(), DEG_get_evaluated_scene(), depsgraph, ID_IS_EDITABLE, bConstraintOb::matrix, mul_m4_m4m4(), and bConstraint::name.
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 5965 of file constraint.cc.
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(), DEG_get_evaluated_scene(), depsgraph, ListBase::first, Bone::flag, ID_IS_EDITABLE, ListBase::last, bConstraintOb::matrix, mul_m4_m4m4(), bConstraint::name, bPoseChannel::name, Object::pose, and bPoseChannel::pose_mat.
Referenced by BKE_constraint_apply_and_remove_for_pose().
| void BKE_constraint_blend_read_data | ( | struct BlendDataReader * | reader, |
| struct ID * | id_owner, | ||
| struct ListBase * | lb ) |
Definition at line 6771 of file constraint.cc.
References BKE_constraint_typeinfo_get(), BLO_read_float_array(), BLO_read_string(), BLO_read_struct_by_name_array(), BLO_read_struct_list, CONSTRAINT_IK_AUTO, CONSTRAINT_OVERRIDE_LIBRARY_LOCAL, CONSTRAINT_TYPE_ARMATURE, CONSTRAINT_TYPE_GEOMETRY_ATTRIBUTE, CONSTRAINT_TYPE_KINEMATIC, CONSTRAINT_TYPE_NULL, CONSTRAINT_TYPE_SPLINEIK, CONSTRAINT_TYPE_TRANSFORM_CACHE, data, ID_IS_LINKED, LISTBASE_FOREACH, and bConstraintTypeInfo::struct_name.
Referenced by BKE_pose_blend_read_data(), and object_blend_read_data().
| void BKE_constraint_blend_write | ( | struct BlendWriter * | writer, |
| struct ListBase * | conlist ) |
Definition at line 6727 of file constraint.cc.
References BKE_constraint_typeinfo_get(), BLO_write_float_array(), BLO_write_string(), BLO_write_struct, BLO_write_struct_by_name(), CONSTRAINT_TYPE_ARMATURE, CONSTRAINT_TYPE_GEOMETRY_ATTRIBUTE, CONSTRAINT_TYPE_SPLINEIK, data, LISTBASE_FOREACH, and bConstraintTypeInfo::struct_name.
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 6262 of file constraint.cc.
References add_new_constraint_to_list(), BKE_constraint_duplicate_ex(), and ID_IS_EDITABLE.
Referenced by blender::ed::object::constraint_copy_exec(), blender::ed::object::constraint_copy_for_object(), and blender::ed::object::constraint_copy_to_selected_exec().
| 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 6251 of file constraint.cc.
References add_new_constraint_to_list(), BKE_constraint_duplicate_ex(), and ID_IS_EDITABLE.
Referenced by blender::ed::object::constraint_copy_exec(), blender::ed::object::constraint_copy_for_pose(), and blender::ed::object::constraint_copy_to_selected_exec().
| 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 6622 of file constraint.cc.
References CONSTRAINT_SPACE_WORLD, constraint_target_to_mat4(), is_custom_space_needed(), bConstraintOb::space_obj_world_matrix, bConstraint::space_object, bConstraint::space_subtarget, and unit_m4().
Referenced by BKE_constraint_target_matrix_get(), BKE_constraints_solve(), blender::ed::transform::constraintTransLim(), blender::draw::overlay::Relations::object_sync(), update_duplicate_action_constraint_settings(), update_duplicate_loc_rot_constraint_settings(), and update_duplicate_transform_constraint_settings().
| 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 6243 of file constraint.cc.
References constraint_copy_data_ex(), flag, MEM_dupallocN(), bConstraint::next, and bConstraint::prev.
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 6348 of file constraint.cc.
References bPose::chanbase, constraint_list_find_from_target(), Object::constraints, LISTBASE_FOREACH, Object::pose, and result.
Referenced by blender::deg::RNANodeQuery::construct_node_identifier().
| void BKE_constraint_free_data | ( | struct bConstraint * | con | ) |
Definition at line 5863 of file constraint.cc.
References BKE_constraint_free_data_ex().
Referenced by BKE_constraint_apply_for_object(), BKE_constraint_apply_for_pose(), and constraint_remove().
| 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 5841 of file constraint.cc.
References BKE_constraint_typeinfo_get(), con_invoke_id_looper(), con_unlink_refs_cb(), bConstraint::data, bConstraintTypeInfo::free_data, IDWALK_NOP, and MEM_freeN().
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. |
References constraints, depsgraph, and name.
Referenced by blender::ed::object::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 256 of file constraint.cc.
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, invert_m4_m4(), invert_m4_m4_safe(), mul_m4_m4m4(), mul_m4_series, normalize_m4(), 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(), dvar_eval_transChan(), shrinkwrap_get_tarmat(), update_duplicate_action_constraint_settings(), update_duplicate_loc_rot_constraint_settings(), and update_duplicate_transform_constraint_settings().
| void BKE_constraint_panel_expand | ( | struct bConstraint * | con | ) |
Definition at line 6028 of file constraint.cc.
References bConstraint::ui_expand_flag, and UI_PANEL_DATA_EXPAND_ROOT.
Referenced by blender::ed::outliner::outliner_set_properties_tab().
| bool BKE_constraint_remove_ex | ( | ListBase * | list, |
| struct Object * | ob, | ||
| struct bConstraint * | con ) |
Remove the specified constraint from the given constraint stack.
Definition at line 5895 of file constraint.cc.
References BIK_clear_data(), BKE_animdata_drivers_remove_for_rna_struct(), constraint_remove(), CONSTRAINT_TYPE_KINEMATIC, CONSTRAINT_TYPE_SPLINEIK, ELEM, Object::id, Object::pose, and bConstraint::type.
Referenced by BKE_constraint_apply_and_remove_for_object(), BKE_constraint_apply_and_remove_for_pose(), blender::ed::object::constraint_delete_exec(), blender::ed::outliner::constraint_fn(), blender::ed::object::object_track_clear_exec(), and blender::ed::object::pose_ik_clear_exec().
| 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 6510 of file constraint.cc.
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(), bConstraintOb::ob, bConstraintOb::pchan, bPoseChannel::pose_mat, bConstraintOb::scene, bConstraintOb::startmat, bConstraintOb::type, and unit_m4().
Referenced by base_callback(), execute_posetree(), blender::ed::object::parent_set_with_depsgraph(), and target_callback().
| bool BKE_constraint_target_uses_bbone | ( | struct bConstraint * | con, |
| struct bConstraintTarget * | ct ) |
Definition at line 6140 of file constraint.cc.
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 6482 of file constraint.cc.
References BKE_constraint_typeinfo_get(), BLI_assert, BLI_freelinkN(), CONSTRAINT_TAR_CUSTOM_SPACE, bConstraintTarget::flag, bConstraintTypeInfo::flush_constraint_targets, is_custom_space_needed(), ListBase::last, bConstraint::space_object, bConstraint::space_subtarget, STRNCPY_UTF8, bConstraintTarget::subtarget, and bConstraintTarget::tar.
Referenced by BKE_pose_channels_remove(), blender::deg::DepsgraphRelationBuilder::build_constraints(), constraint_bone_name_fix(), copy_object_pose(), joined_armature_fix_links_constraints(), object_modifier_recurse_for_update_subframe(), blender::draw::overlay::Relations::object_sync(), pose_select_constraint_target_exec(), separated_armature_fix_links(), blender::ed::object::set_constraint_nth_target(), blender::ed::object::test_constraint(), and update_duplicate_subtarget().
| 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 6589 of file constraint.cc.
References BKE_constraint_typeinfo_get(), CONSTRAINT_TYPE_ARMATURE, depsgraph, ELEM, bConstraintTypeInfo::get_constraint_targets, bConstraintTypeInfo::get_target_matrix, LISTBASE_FOREACH, bConstraintTypeInfo::type, and unit_m4().
Referenced by BKE_constraints_solve(), and blender::ed::transform::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 6453 of file constraint.cc.
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_pose_channels_remove(), blender::deg::DepsgraphRelationBuilder::build_constraints(), constraint_bone_name_fix(), copy_object_pose(), joined_armature_fix_links_constraints(), object_modifier_recurse_for_update_subframe(), blender::draw::overlay::Relations::object_sync(), pose_select_constraint_target_exec(), separated_armature_fix_links(), blender::ed::object::set_constraint_nth_target(), blender::ed::object::test_constraint(), and update_duplicate_subtarget().
| 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 5773 of file constraint.cc.
References CLOG_WARN, CONSTRAINT_TYPE_NULL, constraints_init_typeinfo(), constraintsTypeInfo, CTI_INIT, LOG, and NUM_CONSTRAINT_TYPES.
Referenced by add_new_constraint_internal(), BKE_constraint_typeinfo_get(), bone_constraint_panel_id(), blender::ed::transform::constraintRotLim(), blender::ed::transform::constraintScaleLim(), blender::ed::transform::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 5792 of file constraint.cc.
References BKE_constraint_typeinfo_from_type(), and bConstraint::type.
Referenced by BKE_constraint_blend_read_data(), 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 blender::draw::overlay::Relations::object_sync().
| 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 123 of file constraint.cc.
References BLI_uniquename(), DATA_, bConstraint::name, name, and offsetof.
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 6300 of file constraint.cc.
References CONSTRAINT_ACTIVE, and LISTBASE_FOREACH.
Referenced by blender::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 6316 of file constraint.cc.
References CONSTRAINT_ACTIVE, and LISTBASE_FOREACH.
Referenced by add_new_constraint_to_list(), blender::ed::object::constraint_active_set(), and blender::ed::outliner::constraint_fn().
| void BKE_constraints_clear_evalob | ( | struct bConstraintOb * | cob | ) |
Cleanup after constraint evaluation.
Definition at line 207 of file constraint.cc.
References bPoseChannel::constinv, Object::constinv, CONSTRAINT_OBTYPE_BONE, CONSTRAINT_OBTYPE_OBJECT, copy_m4_m4(), invert_m4_m4(), bConstraintOb::matrix, MEM_freeN(), mul_m4_m4m4(), bConstraintOb::ob, bConstraintOb::pchan, bPoseChannel::pose_mat, Object::runtime, 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 6295 of file constraint.cc.
References BLI_findstring(), name, and offsetof.
Referenced by BKE_constraint_apply_for_object(), BKE_constraint_apply_for_pose(), and blender::ed::object::edit_constraint_property_get().
| void BKE_constraints_free | ( | struct ListBase * | list | ) |
Definition at line 5879 of file constraint.cc.
References BKE_constraints_free_ex().
Referenced by blender::ed::object::constraint_link(), blender::ed::object::make_object_duplilist_real(), blender::ed::object::object_constraints_clear_exec(), and blender::ed::object::pose_constraints_clear_exec().
| void BKE_constraints_free_ex | ( | struct ListBase * | list, |
| bool | do_id_user ) |
Free all constraints from a constraint-stack.
Definition at line 5868 of file constraint.cc.
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, | ||
| const int | flag, | ||
| void * | userdata ) |
Run the given callback on all ID-blocks in list of constraints.
| flag | the IDWALK_ flags controlling the behavior of the foreach_id code, see BKE_lib_query.hh |
Definition at line 6170 of file constraint.cc.
References BKE_constraint_typeinfo_get(), con_invoke_id_looper(), flag, and LISTBASE_FOREACH.
Referenced by 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 130 of file constraint.cc.
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, bConstraintOb::pchan, bPoseChannel::pose_mat, bPoseChannel::rotmode, Object::rotmode, bConstraintOb::rotOrder, bConstraintOb::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(), blender::draw::overlay::Relations::object_sync(), and object_where_is_calc_ex().
| 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 6643 of file constraint.cc.
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, bConstraintTypeInfo::evaluate_constraint, bConstraintTypeInfo::flush_constraint_targets, interp_m4_m4m4(), LISTBASE_FOREACH, bConstraintOb::matrix, bConstraintOb::ob, 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().