Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/object.c
| Context not available. | |||||
| /* TODO: smoke?, cloth? */ | /* TODO: smoke?, cloth? */ | ||||
| } | } | ||||
| /* Find the list that a given constraint belongs to, and/or also get the posechannel this is from (if applicable) */ | |||||
| ListBase *BKE_object_constraint_listbase_get(Object *ob, bConstraint *con, bPoseChannel **r_pchan) | |||||
| { | |||||
| if (r_pchan) | |||||
| *r_pchan = NULL; | |||||
| if (ELEM(NULL, ob, con)) | |||||
| return NULL; | |||||
| /* try object constraints first */ | |||||
| if ((BLI_findindex(&ob->constraints, con) != -1)) { | |||||
| return &ob->constraints; | |||||
| } | |||||
| /* if armature, try pose bones too */ | |||||
| if (ob->pose) { | |||||
| bPoseChannel *pchan; | |||||
| /* try each bone in order | |||||
| * NOTE: it's not possible to directly look up the active bone yet, so this will have to do | |||||
| */ | |||||
| for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) { | |||||
| if ((BLI_findindex(&pchan->constraints, con) != -1)) { | |||||
| if (r_pchan) | |||||
| *r_pchan = pchan; | |||||
| return &pchan->constraints; | |||||
| } | |||||
| } | |||||
| } | |||||
| /* done */ | |||||
| return NULL; | |||||
| } | |||||
| /* free data derived from mesh, called when mesh changes or is freed */ | /* free data derived from mesh, called when mesh changes or is freed */ | ||||
| void BKE_object_free_derived_caches(Object *ob) | void BKE_object_free_derived_caches(Object *ob) | ||||
| { | { | ||||
| Context not available. | |||||