Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/armature/pose_edit.c
| Show First 20 Lines • Show All 1,009 Lines • ▼ Show 20 Lines | static int armature_bone_layers_invoke(bContext *C, wmOperator *op, const wmEvent *event) | ||||
| /* part to sync with other similar operators... */ | /* part to sync with other similar operators... */ | ||||
| return WM_operator_props_popup(C, op, event); | return WM_operator_props_popup(C, op, event); | ||||
| } | } | ||||
| /* Set the visible layers for the active armature (edit and pose modes) */ | /* Set the visible layers for the active armature (edit and pose modes) */ | ||||
| static int armature_bone_layers_exec(bContext *C, wmOperator *op) | static int armature_bone_layers_exec(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| Object *ob = CTX_data_edit_object(C); | Object *ob = CTX_data_edit_object(C); | ||||
| bArmature *arm = (ob) ? ob->data : NULL; | |||||
| PointerRNA ptr; | PointerRNA ptr; | ||||
| int layers[32]; /* hardcoded for now - we can only have 32 armature layers, so this should be fine... */ | int layers[32]; /* hardcoded for now - we can only have 32 armature layers, so this should be fine... */ | ||||
| /* get the values set in the operator properties */ | /* get the values set in the operator properties */ | ||||
| RNA_boolean_get_array(op->ptr, "layers", layers); | RNA_boolean_get_array(op->ptr, "layers", layers); | ||||
| /* 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 (C, EditBone *, ebone, selected_editable_bones) | CTX_DATA_BEGIN_WITH_ID (C, EditBone *, ebone, selected_editable_bones, bArmature *, arm) | ||||
| { | { | ||||
| /* get pointer for pchan, and write flags this way */ | /* get pointer for pchan, and write flags this way */ | ||||
| RNA_pointer_create((ID *)arm, &RNA_EditBone, ebone, &ptr); | RNA_pointer_create((ID *)arm, &RNA_EditBone, ebone, &ptr); | ||||
| RNA_boolean_set_array(&ptr, "layers", layers); | RNA_boolean_set_array(&ptr, "layers", layers); | ||||
| } | } | ||||
| CTX_DATA_END; | CTX_DATA_END; | ||||
| /* note, notifier might evolve */ | /* note, notifier might evolve */ | ||||
| ▲ Show 20 Lines • Show All 190 Lines • Show Last 20 Lines | |||||