public override bool Run()
        {
            GameObject lookAtTarget = ShowObjectSelectionDialog(Actor);

            if (lookAtTarget == null)
            {
                return(false);
            }

            string poseData = PoseManager.GetCurrentPose(Actor);

            if (poseData == null)
            {
                return(false);
            }

            this.Actor.LookAtManager.EnableLookAts();
            this.Actor.LookAtManager.SetLookAt(LookAtManager.Type.Interaction, lookAtTarget, 20000, LookAtJointFilter.EyeBones);
            this.Actor.OverlayComponent.UpdateInteractionFreeParts(AwarenessLevel.OverlayUpperbody);
            this.Actor.LookAtManager.DisableLookAts();
            PoseManager.SetCurrentPose(Actor, poseData);
            Target.PlaySoloAnimation(this.Actor.SimDescription.IsHuman, this.Actor, poseData, true, ProductVersion.BaseGame);
            this.Actor.ResetAllAnimation();
            Target.PlaySoloAnimation(this.Actor.SimDescription.IsHuman, this.Actor, poseData, true, ProductVersion.BaseGame);
            this.Actor.ResetAllAnimation();

            this.Actor.WaitForExitReason(3.40282347E+38f, ExitReason.UserCanceled);
            Actor.LookAtManager.EnableLookAts();
            return(true);
        }
Example #2
0
        public override bool Run()
        {
            bool result = true;

            Actor.OverlayComponent.UpdateInteractionFreeParts(AwarenessLevel.OverlayNone);
            Actor.LookAtManager.DisableLookAts();
            for (int i = 0; i < shots; i++)
            {
                if (Actor.HasExitReason(ExitReason.UserCanceled))
                {
                    result = false;
                    break;
                }

                PoseData poseData = GetRandomPose();
                if (poseData == null)
                {
                    result = false;
                    break;
                }
                PoseManager.SetCurrentPose(Actor, poseData.Key);
                Target.PlaySoloAnimation(this.Actor.SimDescription.IsHuman, this.Actor, poseData.Key, true, ProductVersion.BaseGame);
                Actor.ResetAllAnimation();
                Target.PlaySoloAnimation(this.Actor.SimDescription.IsHuman, this.Actor, poseData.Key, true, ProductVersion.BaseGame);
                Actor.ResetAllAnimation();
                bool userCanceled = Actor.WaitForExitReason(simMinutesToPose, ExitReason.UserCanceled);
                if (userCanceled)
                {
                    result = false;
                    break;
                }
            }
            Actor.LookAtManager.EnableLookAts();
            return(result);
        }
Example #3
0
        public override bool Run()
        {
            List <ObjectListPickerInfo> Entries = ListExpressions();
            string text = (string)ObjectListPickerDialog.Show("Expression", Entries);

            if (text != null && text != "")
            {
                ReactionTypes reaction = (ReactionTypes)Enum.Parse(typeof(ReactionTypes), text);

                Array             reactionTypes = Enum.GetValues(typeof(ReactionTypes));
                CustomOverlayData data          = null;
                CmoPoseBox        box           = PoseManager.FindPoseBox();
                string            poseData      = PoseManager.GetCurrentPose(Actor);
                if (poseData == null)
                {
                    return(false);
                }
                Actor.LookAtManager.DisableLookAts();
                PoseManager.SetCurrentPose(Actor, poseData);
                box.PlaySoloAnimation(Actor.SimDescription.IsHuman, Actor, poseData, true, ProductVersion.BaseGame);
                Actor.ResetAllAnimation();
                Actor.OverlayComponent.UpdateInteractionFreeParts(AwarenessLevel.OverlayFace);//OverlayUpperbody);
                StateMachineClient stateMachineClient = StateMachineClient.Acquire(Actor.ObjectId, "facial_idle", AnimationPriority.kAPDefault, true);
                data = (CustomOverlayData)OverlayComponent.GetOverlayData(reaction, Actor);


                stateMachineClient.UseActorBridgeOrigins = false;
                stateMachineClient.SetActor("x", Actor);
                stateMachineClient.RemoveEventHandler(new SacsEventHandler(Actor.OverlayComponent.InteractionPartLevelCallback));
                stateMachineClient.RemoveEventHandler(new SacsEventHandler(Actor.OverlayComponent.ClearInteractionPartLevelCallback));
                stateMachineClient.EnterState("x", "Enter");
                stateMachineClient.SetProductVersion(data.ProductVersion);
                stateMachineClient.RequestState("x", data.AnimClipName);
                //Actor.OverlayComponent.UpdateInteractionFreeParts(AwarenessLevel.OverlayFace);

                box.PlaySoloAnimation(Actor.SimDescription.IsHuman, Actor, poseData, true, ProductVersion.BaseGame);
                Actor.ResetAllAnimation();

                Actor.WaitForExitReason(3.40282347E+38f, ExitReason.UserCanceled);
                Actor.LookAtManager.EnableLookAts();
                return(true);
            }
            return(false);
        }
        public override bool Run()
        {
            bool result = true;

            Actor.OverlayComponent.UpdateInteractionFreeParts(AwarenessLevel.OverlayNone);
            Actor.LookAtManager.DisableLookAts();
            // Clone the list to prevent need for synchronization
            List <string> poseList = new List <string>(CmoPoseBox.myList);

            foreach (string poseName in poseList)
            {
                if (Actor.HasExitReason(ExitReason.UserCanceled))
                {
                    result = false;
                    break;
                }
                if (poseName == null)
                {
                    result = false;
                    break;
                }
                PoseManager.SetCurrentPose(Actor, poseName);
                Target.PlaySoloAnimation(this.Actor.SimDescription.IsHuman, this.Actor, poseName, true, ProductVersion.BaseGame);
                Actor.ResetAllAnimation();
                Target.PlaySoloAnimation(this.Actor.SimDescription.IsHuman, this.Actor, poseName, true, ProductVersion.BaseGame);
                Actor.ResetAllAnimation();
                bool userCanceled = Actor.WaitForExitReason(simMinutesToPose, ExitReason.UserCanceled);
                if (userCanceled)
                {
                    result = false;
                    break;
                }
            }
            Actor.LookAtManager.EnableLookAts();
            return(result);
        }