ソースを参照

Reset maid eye rotation on unload

Keep the initial eye rotation in Meido rather than DragPointHead as well
habeebweeb 4 年 前
コミット
88df6142c3

+ 2 - 6
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Meido/IK/DragPointHead.cs

@@ -9,8 +9,6 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         private Quaternion headRotation;
         private Vector3 eyeRotationL;
         private Vector3 eyeRotationR;
-        private Quaternion defEyeRotL;
-        private Quaternion defEyeRotR;
         public event EventHandler Select;
         public bool IsIK { get; set; }
 
@@ -18,8 +16,6 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         {
             base.Set(myObject);
             this.body = this.maid.body0;
-            this.defEyeRotL = this.maid.body0.quaDefEyeL;
-            this.defEyeRotR = this.maid.body0.quaDefEyeR;
         }
 
         protected override void ApplyDragType()
@@ -72,8 +68,8 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         {
             if (CurrentDragType == DragType.MoveXZ || CurrentDragType == DragType.MoveY)
             {
-                body.quaDefEyeL = defEyeRotL;
-                body.quaDefEyeR = defEyeRotR;
+                body.quaDefEyeL = this.meido.DefaultEyeRotL;
+                body.quaDefEyeR = this.meido.DefaultEyeRotR;
             }
             else if (CurrentDragType == DragType.RotLocalY || CurrentDragType == DragType.RotLocalXZ)
             {

+ 6 - 0
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Meido/Meido.cs

@@ -37,6 +37,8 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         public string LastName { get; private set; }
         public string NameJP => $"{LastName}\n{FirstName}";
         public string NameEN => $"{FirstName}\n{LastName}";
+        public Quaternion DefaultEyeRotL { get; private set; }
+        public Quaternion DefaultEyeRotR { get; private set; }
         public int ActiveSlot { get; private set; }
         public event EventHandler<MeidoUpdateEventArgs> UpdateMeido;
         public event EventHandler BodyLoad;
@@ -208,6 +210,8 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
                 Maid.body0.MuneYureR(1f);
                 Maid.body0.jbMuneL.enabled = true;
                 Maid.body0.jbMuneR.enabled = true;
+                Maid.body0.quaDefEyeL = DefaultEyeRotL;
+                Maid.body0.quaDefEyeR = DefaultEyeRotR;
             }
 
             Maid.body0.SetMaskMode(TBody.MaskMode.None);
@@ -374,6 +378,8 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
                 this.BlendValuesBackup = Utility.GetFieldValue<TMorph, float[]>(morph, "BlendValuesBackup");
                 this.BlendValues = Utility.GetFieldValue<TMorph, float[]>(morph, "BlendValues");
 
+                this.DefaultEyeRotL = this.Maid.body0.quaDefEyeL;
+                this.DefaultEyeRotR = this.Maid.body0.quaDefEyeR;
                 initialized = true;
             }