Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/armature.c
| Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | |||||
| #include "BKE_idtype.h" | #include "BKE_idtype.h" | ||||
| #include "BKE_lattice.h" | #include "BKE_lattice.h" | ||||
| #include "BKE_lib_id.h" | #include "BKE_lib_id.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_object.h" | #include "BKE_object.h" | ||||
| #include "BKE_scene.h" | #include "BKE_scene.h" | ||||
| #include "DEG_depsgraph_build.h" | #include "DEG_depsgraph_build.h" | ||||
| #include "DEG_depsgraph_query.h" | |||||
| #include "BIK_api.h" | #include "BIK_api.h" | ||||
| #include "atomic_ops.h" | #include "atomic_ops.h" | ||||
| #include "CLG_log.h" | #include "CLG_log.h" | ||||
| static CLG_LogRef LOG = {"bke.armature"}; | static CLG_LogRef LOG = {"bke.armature"}; | ||||
| ▲ Show 20 Lines • Show All 398 Lines • ▼ Show 20 Lines | |||||
| static void armature_refresh_layer_used_recursive(bArmature *arm, ListBase *bones) | static void armature_refresh_layer_used_recursive(bArmature *arm, ListBase *bones) | ||||
| { | { | ||||
| LISTBASE_FOREACH (Bone *, bone, bones) { | LISTBASE_FOREACH (Bone *, bone, bones) { | ||||
| arm->layer_used |= bone->layer; | arm->layer_used |= bone->layer; | ||||
| armature_refresh_layer_used_recursive(arm, &bone->childbase); | armature_refresh_layer_used_recursive(arm, &bone->childbase); | ||||
| } | } | ||||
| } | } | ||||
| /* Update the layers_used variable after bones are moved between layer | void BKE_armature_refresh_layer_used(struct Depsgraph *depsgraph, struct bArmature *arm) | ||||
| * NOTE: Used to be done in drawing code in 2.7, but that won't work with | |||||
| * Copy-on-Write, as drawing uses evaluated copies. | |||||
| */ | |||||
| void BKE_armature_refresh_layer_used(bArmature *arm) | |||||
| { | { | ||||
| if (arm->edbo != NULL) { | |||||
| /* Don't perform this update when the armature is in edit mode. In that case it should be | |||||
| * handled by ED_armature_edit_refresh_layer_used(). */ | |||||
| return; | |||||
| } | |||||
| arm->layer_used = 0; | arm->layer_used = 0; | ||||
| armature_refresh_layer_used_recursive(arm, &arm->bonebase); | armature_refresh_layer_used_recursive(arm, &arm->bonebase); | ||||
| if (depsgraph == NULL || DEG_is_active(depsgraph)) { | |||||
| bArmature *arm_orig = (bArmature *)DEG_get_original_id(&arm->id); | |||||
| arm_orig->layer_used = arm->layer_used; | |||||
| } | |||||
| } | } | ||||
| /* Finds the best possible extension to the name on a particular axis. (For renaming, check for | /* Finds the best possible extension to the name on a particular axis. (For renaming, check for | ||||
| * unique names afterwards) strip_number: removes number extensions (TODO: not used) | * unique names afterwards) strip_number: removes number extensions (TODO: not used) | ||||
| * axis: the axis to name on | * axis: the axis to name on | ||||
| * head/tail: the head/tail co-ordinate of the bone on the specified axis */ | * head/tail: the head/tail co-ordinate of the bone on the specified axis */ | ||||
| int bone_autoside_name( | int bone_autoside_name( | ||||
| char name[MAXBONENAME], int UNUSED(strip_number), short axis, float head, float tail) | char name[MAXBONENAME], int UNUSED(strip_number), short axis, float head, float tail) | ||||
| ▲ Show 20 Lines • Show All 2,621 Lines • Show Last 20 Lines | |||||