|
Blender
V2.93
|
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 71 of file BKE_constraint.h.
| struct bConstraint* BKE_constraint_add_for_object | ( | struct Object * | ob, |
| const char * | name, | ||
| short | type | ||
| ) |
Definition at line 5672 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::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 | ||
| ) |
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().
| void BKE_constraint_blend_read_data | ( | struct BlendDataReader * | reader, |
| struct ListBase * | lb | ||
| ) |
Definition at line 6314 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 6421 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 6384 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::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 6262 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 | ||
| ) |
Definition at line 5777 of file constraint.c.
References add_new_constraint_to_list(), BKE_constraint_duplicate_ex(), ID_IS_LINKED, and NULL.
Referenced by ED_object_constraint_copy_for_object().
| struct bConstraint* BKE_constraint_copy_for_pose | ( | struct Object * | ob, |
| struct bPoseChannel * | pchan, | ||
| struct bConstraint * | src | ||
| ) |
Definition at line 5765 of file constraint.c.
References add_new_constraint_to_list(), BKE_constraint_duplicate_ex(), ID_IS_LINKED, and NULL.
Referenced by ED_object_constraint_copy_for_pose().
| void BKE_constraint_custom_object_space_get | ( | float | r_mat[4][4], |
| struct bConstraint * | con | ||
| ) |
Definition at line 6140 of file constraint.c.
References CONSTRAINT_SPACE_CUSTOM, CONSTRAINT_SPACE_WORLD, constraint_target_to_mat4(), copy_m4_m4(), bConstraintTarget::matrix, NULL, bConstraint::ownspace, SINGLETARGET_FLUSH_TARS, SINGLETARGET_GET_TARS, bConstraint::space_object, bConstraint::space_subtarget, bConstraintTarget::subtarget, bConstraintTarget::tar, bConstraint::tarspace, unit_m4(), and VALID_CONS_TARGET.
Referenced by BKE_constraints_solve(), updateDuplicateActionConstraintSettings(), and updateDuplicateLocRotConstraintSettings().
| 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().
| struct bConstraint* BKE_constraint_find_from_target | ( | struct Object * | ob, |
| struct bConstraintTarget * | tgt, | ||
| struct bPoseChannel ** | r_pchan | ||
| ) |
Definition at line 5865 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 5492 of file constraint.c.
References BKE_constraint_free_data_ex().
Referenced by BKE_constraint_remove(), and blo_do_versions_280().
| 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().
| bool BKE_constraint_is_nonlocal_in_liboverride | ( | const struct Object * | ob, |
| const struct bConstraint * | con | ||
| ) |
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, | ||
| const bool | keep_scale | ||
| ) |
Definition at line 264 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_PARLOCAL, CONSTRAINT_SPACE_POSE, CONSTRAINT_SPACE_WORLD, ELEM, from, invert_m4_m4(), invert_m4_m4_safe(), mul_m4_m4m4(), normalize_m4(), NULL, Object::obmat, Object::parent, Object::parentinv, 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(), updateDuplicateActionConstraintSettings(), and updateDuplicateLocRotConstraintSettings().
| 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().
| bool BKE_constraint_remove | ( | ListBase * | list, |
| struct bConstraint * | con | ||
| ) |
Definition at line 5515 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 5526 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 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 | ||
| ) |
Definition at line 6025 of file constraint.c.
References 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 | ||
| ) |
Referenced by blender::deg::DepsgraphRelationBuilder::build_constraints().
| void BKE_constraint_targets_for_solving_get | ( | struct Depsgraph * | depsgraph, |
| struct bConstraint * | con, | ||
| struct bConstraintOb * | ob, | ||
| struct ListBase * | targets, | ||
| float | ctime | ||
| ) |
Definition at line 6102 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().
| const bConstraintTypeInfo* BKE_constraint_typeinfo_from_type | ( | int | type | ) |
Definition at line 5413 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 | ) |
Definition at line 5435 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_for_solving_get(), BKE_constraints_id_loop(), BKE_constraints_solve(), BKE_object_modifier_update_subframe(), BKE_pose_channels_remove(), blender::deg::DepsgraphRelationBuilder::build_constraints(), constraint_bone_name_fix(), constraint_copy_data_ex(), copy_object_pose(), BCAnimationSampler::is_animated_by_constraint(), joined_armature_fix_links_constraints(), object_solver_camera(), object_solver_inverted_matrix(), OVERLAY_relationship_lines(), pose_proxy_sync(), pose_select_constraint_target_exec(), separated_armature_fix_links(), set_constraint_nth_target(), test_constraint(), and updateDuplicateSubtarget().
| 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().
| 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().
| void BKE_constraints_active_set | ( | ListBase * | list, |
| struct bConstraint * | con | ||
| ) |
Definition at line 5829 of file constraint.c.
References CONSTRAINT_ACTIVE, and LISTBASE_FOREACH.
Referenced by add_new_constraint_to_list(), constraint_delete_exec(), constraint_fn(), and ED_object_constraint_active_set().
| void BKE_constraints_clear_evalob | ( | struct bConstraintOb * | cob | ) |
Definition at line 211 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_object_eval_constraints(), BKE_pose_where_is_bone(), object_where_is_calc_ex(), and OVERLAY_relationship_lines().
| void BKE_constraints_copy_ex | ( | struct ListBase * | dst, |
| const struct ListBase * | src, | ||
| const int | flag, | ||
| bool | do_extern | ||
| ) |
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 5806 of file constraint.c.
References BLI_findstring().
Referenced by edit_constraint_property_get().
| void BKE_constraints_free | ( | struct ListBase * | list | ) |
Definition at line 5509 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().
| void BKE_constraints_free_ex | ( | struct ListBase * | list, |
| bool | do_id_user | ||
| ) |
Definition at line 5498 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 | ||
| ) |
Definition at line 5680 of file constraint.c.
References BKE_constraint_typeinfo_get(), bConstraintTypeInfo::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 | ||
| ) |
Definition at line 133 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_object_eval_constraints(), BKE_pose_where_is_bone(), object_where_is_calc_ex(), and OVERLAY_relationship_lines().
Definition at line 5978 of file constraint.c.
References BLI_addtail(), BLI_remlink(), CONSTRAINT_PROXY_LOCAL, ListBase::first, bConstraint::flag, bConstraint::next, and next.
Referenced by pose_proxy_sync().
| bool BKE_constraints_proxylocked_owner | ( | struct Object * | ob, |
| struct bPoseChannel * | pchan | ||
| ) |
Definition at line 5995 of file constraint.c.
References bPoseChannel::bone, Object::data, Bone::layer, bArmature::layer_protected, Object::pose, and Object::proxy.
Referenced by add_new_constraint_to_list(), constraint_add_exec(), and draw_constraint_header().
| void BKE_constraints_solve | ( | struct Depsgraph * | depsgraph, |
| struct ListBase * | conlist, | ||
| struct bConstraintOb * | cob, | ||
| float | ctime | ||
| ) |
Definition at line 6177 of file constraint.c.
References BKE_constraint_custom_object_space_get(), 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, bConstraintOb::pchan, and bConstraintOb::space_obj_world_matrix.
Referenced by BKE_object_eval_constraints(), BKE_pose_where_is_bone(), and object_where_is_calc_ex().