public override bool ApplyPreset(GameObject avatar)
        {
            if (!avatar)
            {
                return(false);
            }

            Undo.RegisterFullObjectHierarchyUndo(avatar, "Apply Pose");

            PumkinsAvatarTools.ResetPose(avatar);

            if (presetMode == PosePresetMode.HumanPose)
            {
                Animator anim = avatar.GetComponent <Animator>();
                if (anim && anim.avatar && anim.avatar.isHuman)
                {
                    Vector3    pos = avatar.transform.position;
                    Quaternion rot = avatar.transform.rotation;

                    avatar.transform.SetPositionAndRotation(Vector3.zero, Quaternion.identity);

                    var humanPoseHandler = new HumanPoseHandler(anim.avatar, avatar.transform);

                    var humanPose = new HumanPose();
                    humanPoseHandler.GetHumanPose(ref humanPose);

                    humanPose.muscles = muscles;

                    if (PumkinsAvatarTools.Settings.posePresetTryFixSinking)
                    {
                        if (humanPose.bodyPosition.y < 1 && !Mathf.Approximately(humanPose.bodyPosition.y, 0))
                        {
                            PumkinsAvatarTools.Log(Strings.PoseEditor.bodyPositionYTooSmall, LogType.Warning, humanPose.bodyPosition.y.ToString());
                            humanPose.bodyPosition.y = 1;
                        }
                    }

                    if (PumkinsAvatarTools.Settings.posePresetApplyBodyPosition)
                    {
                        humanPose.bodyPosition = bodyPosition;
                    }
                    if (PumkinsAvatarTools.Settings.posePresetApplyBodyRotation)
                    {
                        humanPose.bodyRotation = bodyRotation;
                    }

                    humanPoseHandler.SetHumanPose(ref humanPose);
                    avatar.transform.SetPositionAndRotation(pos, rot);

                    PumkinsPoseEditor.OnPoseWasChanged(PumkinsPoseEditor.PoseChangeType.Reset);
                    return(true);
                }
                else
                {
                    PumkinsAvatarTools.Log(Strings.Log.cantSetPoseNonHumanoid, LogType.Error, name);
                    return(false);
                }
            }
            else
            {
                if (!avatar)
                {
                    return(false);
                }

                for (int i = 0; i < transformPaths.Count; i++)
                {
                    var t = avatar.transform.Find(transformPaths[i]);
                    if (t != null)
                    {
                        t.localEulerAngles = transformRotations[i];
                    }
                }
                return(true);
            }
        }