Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/constraint.c
| Show First 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | |||||
| #include "BKE_shrinkwrap.h" | #include "BKE_shrinkwrap.h" | ||||
| #include "BKE_tracking.h" | #include "BKE_tracking.h" | ||||
| #include "BIK_api.h" | #include "BIK_api.h" | ||||
| #include "DEG_depsgraph.h" | #include "DEG_depsgraph.h" | ||||
| #include "DEG_depsgraph_query.h" | #include "DEG_depsgraph_query.h" | ||||
| #include "CLG_log.h" | |||||
| #ifdef WITH_PYTHON | #ifdef WITH_PYTHON | ||||
| # include "BPY_extern.h" | # include "BPY_extern.h" | ||||
| #endif | #endif | ||||
| #ifdef WITH_ALEMBIC | #ifdef WITH_ALEMBIC | ||||
| # include "ABC_alembic.h" | # include "ABC_alembic.h" | ||||
| #endif | #endif | ||||
| /* ---------------------------------------------------------------------------- */ | /* ---------------------------------------------------------------------------- */ | ||||
| /* Useful macros for testing various common flag combinations */ | /* Useful macros for testing various common flag combinations */ | ||||
| /* Constraint Target Macros */ | /* Constraint Target Macros */ | ||||
| #define VALID_CONS_TARGET(ct) ((ct) && (ct->tar)) | #define VALID_CONS_TARGET(ct) ((ct) && (ct->tar)) | ||||
| static CLG_LogRef LOG = {"bke.constraint"}; | |||||
| /* ************************ Constraints - General Utilities *************************** */ | /* ************************ Constraints - General Utilities *************************** */ | ||||
| /* These functions here don't act on any specific constraints, and are therefore should/will | /* These functions here don't act on any specific constraints, and are therefore should/will | ||||
| * not require any of the special function-pointers afforded by the relevant constraint | * not require any of the special function-pointers afforded by the relevant constraint | ||||
| * type-info structs. | * type-info structs. | ||||
| */ | */ | ||||
| static void damptrack_do_transform(float matrix[4][4], const float tarvec[3], int track_axis); | static void damptrack_do_transform(float matrix[4][4], const float tarvec[3], int track_axis); | ||||
| ▲ Show 20 Lines • Show All 4,589 Lines • ▼ Show 20 Lines | const bConstraintTypeInfo *BKE_constraint_typeinfo_from_type(int type) | ||||
| /* only return for valid types */ | /* only return for valid types */ | ||||
| if ((type >= CONSTRAINT_TYPE_NULL) && | if ((type >= CONSTRAINT_TYPE_NULL) && | ||||
| (type < NUM_CONSTRAINT_TYPES)) | (type < NUM_CONSTRAINT_TYPES)) | ||||
| { | { | ||||
| /* there shouldn't be any segfaults here... */ | /* there shouldn't be any segfaults here... */ | ||||
| return constraintsTypeInfo[type]; | return constraintsTypeInfo[type]; | ||||
| } | } | ||||
| else { | else { | ||||
| printf("No valid constraint type-info data available. Type = %i\n", type); | CLOG_WARN(&LOG, "No valid constraint type-info data available. Type = %i", type); | ||||
| } | } | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| /* This function should always be used to get the appropriate type-info, as it | /* This function should always be used to get the appropriate type-info, as it | ||||
| * has checks which prevent segfaults in some weird cases. | * has checks which prevent segfaults in some weird cases. | ||||
| */ | */ | ||||
| ▲ Show 20 Lines • Show All 666 Lines • Show Last 20 Lines | |||||