Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/armature/pose_transform.c
| Show First 20 Lines • Show All 1,253 Lines • ▼ Show 20 Lines | if ((ob->adt) && (ob->adt->action)) { | ||||
| } | } | ||||
| } | } | ||||
| /* was copied without constraints */ | /* was copied without constraints */ | ||||
| BLI_freelistN(&dummyPose->chanbase); | BLI_freelistN(&dummyPose->chanbase); | ||||
| MEM_freeN(dummyPose); | MEM_freeN(dummyPose); | ||||
| } | } | ||||
| else { | else { | ||||
| /* no animation, so just reset whole pose to rest pose | /* No animation, so just reset to the rest pose. */ | ||||
| * (cannot just restore for selected though) | BKE_pose_rest(ob->pose, only_select); | ||||
| */ | |||||
| BKE_pose_rest(ob->pose); | |||||
| } | } | ||||
| /* notifiers and updates */ | /* notifiers and updates */ | ||||
| DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); | DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); | ||||
| WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, ob); | WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, ob); | ||||
| } | } | ||||
| FOREACH_OBJECT_IN_MODE_END; | FOREACH_OBJECT_IN_MODE_END; | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| void POSE_OT_user_transforms_clear(wmOperatorType *ot) | void POSE_OT_user_transforms_clear(wmOperatorType *ot) | ||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Clear User Transforms"; | ot->name = "Clear User Transforms"; | ||||
| ot->idname = "POSE_OT_user_transforms_clear"; | ot->idname = "POSE_OT_user_transforms_clear"; | ||||
| ot->description = "Reset pose on selected bones to keyframed state"; | ot->description = "Reset pose bone transforms to keyframed state"; | ||||
| /* callbacks */ | /* callbacks */ | ||||
| ot->exec = pose_clear_user_transforms_exec; | ot->exec = pose_clear_user_transforms_exec; | ||||
| ot->poll = ED_operator_posemode; | ot->poll = ED_operator_posemode; | ||||
| /* flags */ | /* flags */ | ||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ||||
| /* properties */ | /* properties */ | ||||
| RNA_def_boolean(ot->srna, "only_selected", true, "Only Selected", "Only visible/selected bones"); | RNA_def_boolean(ot->srna, "only_selected", true, "Only Selected", "Only visible/selected bones"); | ||||
| } | } | ||||