Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/armature/armature_utils.c
| Show First 20 Lines • Show All 101 Lines • ▼ Show 20 Lines | |||||
| /* Bone Operations */ | /* Bone Operations */ | ||||
| /* XXX bone_looper is only to be used when we want to access settings | /* XXX bone_looper is only to be used when we want to access settings | ||||
| * (i.e. editability/visibility/selected) that context doesn't offer */ | * (i.e. editability/visibility/selected) that context doesn't offer */ | ||||
| int bone_looper(Object *ob, Bone *bone, void *data, int (*bone_func)(Object *, Bone *, void *)) | int bone_looper(Object *ob, Bone *bone, void *data, int (*bone_func)(Object *, Bone *, void *)) | ||||
| { | { | ||||
| /* We want to apply the function bone_func to every bone | /* We want to apply the function bone_func to every bone | ||||
| * in an armature -- feed bone_looper the first bone and | * in an armature -- feed bone_looper the first bone and | ||||
| * a pointer to the bone_func and watch it go!. The int count | * a pointer to the bone_func and watch it go! The int count | ||||
| * can be useful for counting bones with a certain property | * can be useful for counting bones with a certain property | ||||
| * (e.g. skinnable) | * (e.g. skinnable) | ||||
| */ | */ | ||||
| int count = 0; | int count = 0; | ||||
| if (bone) { | if (bone) { | ||||
| /* only do bone_func if the bone is non null */ | /* only do bone_func if the bone is non null */ | ||||
| count += bone_func(ob, bone, data); | count += bone_func(ob, bone, data); | ||||
| ▲ Show 20 Lines • Show All 848 Lines • Show Last 20 Lines | |||||