Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/armature/pose_edit.c
| Show First 20 Lines • Show All 895 Lines • ▼ Show 20 Lines | static int pose_bone_layers_exec(bContext *C, wmOperator *op) | ||||
| /* set layers of pchans based on the values set in the operator props */ | /* set layers of pchans based on the values set in the operator props */ | ||||
| CTX_DATA_BEGIN_WITH_ID (C, bPoseChannel *, pchan, selected_pose_bones, Object *, ob) { | CTX_DATA_BEGIN_WITH_ID (C, bPoseChannel *, pchan, selected_pose_bones, Object *, ob) { | ||||
| /* get pointer for pchan, and write flags this way */ | /* get pointer for pchan, and write flags this way */ | ||||
| RNA_pointer_create((ID *)ob->data, &RNA_Bone, pchan->bone, &ptr); | RNA_pointer_create((ID *)ob->data, &RNA_Bone, pchan->bone, &ptr); | ||||
| RNA_boolean_set_array(&ptr, "layers", layers); | RNA_boolean_set_array(&ptr, "layers", layers); | ||||
| if (prev_ob != ob) { | if (prev_ob != ob) { | ||||
| BKE_armature_refresh_layer_used(ob->data); | |||||
| /* Note, notifier might evolve. */ | /* Note, notifier might evolve. */ | ||||
| WM_event_add_notifier(C, NC_OBJECT | ND_POSE, ob); | WM_event_add_notifier(C, NC_OBJECT | ND_POSE, ob); | ||||
| DEG_id_tag_update((ID *)ob->data, ID_RECALC_COPY_ON_WRITE); | DEG_id_tag_update((ID *)ob->data, ID_RECALC_COPY_ON_WRITE); | ||||
| prev_ob = ob; | prev_ob = ob; | ||||
| } | } | ||||
| } | } | ||||
| CTX_DATA_END; | CTX_DATA_END; | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| ▲ Show 20 Lines • Show All 286 Lines • Show Last 20 Lines | |||||