Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/screen/screen_context.c
| Show First 20 Lines • Show All 495 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| static eContextResult screen_ctx_active_pose_bone(const bContext *C, bContextDataResult *result) | static eContextResult screen_ctx_active_pose_bone(const bContext *C, bContextDataResult *result) | ||||
| { | { | ||||
| wmWindow *win = CTX_wm_window(C); | wmWindow *win = CTX_wm_window(C); | ||||
| ViewLayer *view_layer = WM_window_get_active_view_layer(win); | ViewLayer *view_layer = WM_window_get_active_view_layer(win); | ||||
| Object *obact = view_layer->basact ? view_layer->basact->object : NULL; | Object *obact = view_layer->basact ? view_layer->basact->object : NULL; | ||||
| Object *obpose = BKE_object_pose_armature_get(obact); | Object *obpose = BKE_object_pose_armature_get(obact); | ||||
| bPoseChannel *pchan = BKE_pose_channel_active(obpose); | bPoseChannel *pchan = BKE_pose_channel_active_if_layer_visible(obpose); | ||||
| if (pchan) { | if (pchan) { | ||||
| CTX_data_pointer_set(result, &obpose->id, &RNA_PoseBone, pchan); | CTX_data_pointer_set(result, &obpose->id, &RNA_PoseBone, pchan); | ||||
| return CTX_RESULT_OK; | return CTX_RESULT_OK; | ||||
| } | } | ||||
| return CTX_RESULT_NO_DATA; | return CTX_RESULT_NO_DATA; | ||||
| } | } | ||||
| static eContextResult screen_ctx_active_object(const bContext *C, bContextDataResult *result) | static eContextResult screen_ctx_active_object(const bContext *C, bContextDataResult *result) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 788 Lines • Show Last 20 Lines | |||||