Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/armature/pose_edit.c
| Show First 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | Object *ED_pose_object_from_context(bContext *C) | ||||
| else { | else { | ||||
| ob = BKE_object_pose_armature_get(CTX_data_active_object(C)); | ob = BKE_object_pose_armature_get(CTX_data_active_object(C)); | ||||
| } | } | ||||
| return ob; | return ob; | ||||
| } | } | ||||
| /* This function is used to process the necessary updates for */ | /* This function is used to process the necessary updates for */ | ||||
| void ED_armature_enter_posemode(bContext *C, Base *base) | void ED_armature_enter_posemode(bContext *C, ObjectBase *base) | ||||
| { | { | ||||
| ReportList *reports = CTX_wm_reports(C); | ReportList *reports = CTX_wm_reports(C); | ||||
| Object *ob = base->object; | Object *ob = base->object; | ||||
| if (ID_IS_LINKED_DATABLOCK(ob)) { | if (ID_IS_LINKED_DATABLOCK(ob)) { | ||||
| BKE_report(reports, RPT_WARNING, "Cannot pose libdata"); | BKE_report(reports, RPT_WARNING, "Cannot pose libdata"); | ||||
| return; | return; | ||||
| } | } | ||||
| Show All 9 Lines | switch (ob->type) { | ||||
| default: | default: | ||||
| return; | return; | ||||
| } | } | ||||
| /* XXX: disabled as this would otherwise cause a nasty loop... */ | /* XXX: disabled as this would otherwise cause a nasty loop... */ | ||||
| //ED_object_toggle_modes(C, ob->mode); | //ED_object_toggle_modes(C, ob->mode); | ||||
| } | } | ||||
| void ED_armature_exit_posemode(bContext *C, Base *base) | void ED_armature_exit_posemode(bContext *C, ObjectBase *base) | ||||
| { | { | ||||
| if (base) { | if (base) { | ||||
| Object *ob = base->object; | Object *ob = base->object; | ||||
| ob->restore_mode = ob->mode; | ob->restore_mode = ob->mode; | ||||
| ob->mode &= ~OB_MODE_POSE; | ob->mode &= ~OB_MODE_POSE; | ||||
| WM_event_add_notifier(C, NC_SCENE | ND_MODE | NS_MODE_OBJECT, NULL); | WM_event_add_notifier(C, NC_SCENE | ND_MODE | NS_MODE_OBJECT, NULL); | ||||
| ▲ Show 20 Lines • Show All 1,067 Lines • Show Last 20 Lines | |||||