Browse Source

Fix compilation issues for COM3D2.5

Swapping for AIKCtrl gets the build to compile but as stated in #54, IK
does not work except for the edit maid.
habeebweeb 1 year ago
parent
commit
7f7f699a53

+ 22 - 3
src/MeidoPhotoStudio.Plugin/DragPoint/DragPointMeido.cs

@@ -19,6 +19,8 @@ public abstract class DragPointMeido : DragPoint
     protected bool isPlaying;
     protected bool isBone;
 
+    private const string IkDataTag = "左手";
+
     public virtual bool IsBone
     {
         get => isBone;
@@ -32,8 +34,14 @@ public abstract class DragPointMeido : DragPoint
         }
     }
 
-    protected IKCtrlData IkCtrlData =>
-        meido.Body.IKCtrl.GetIKData("左手");
+    // TODO: Come up with an intermediary fix for this until I can rewrite the IK system.
+    // WARN: This does NOT work and is only done so the compiler does not complain
+    protected
+#if COM25
+        AIKCtrl IkCtrlData => meido.Body.fullBodyIK.GetIKCtrl(IkDataTag);
+#else
+        IKCtrlData IkCtrlData => meido.Body.IKCtrl.GetIKData(IkDataTag);
+#endif
 
     public virtual void Initialize(Meido meido, Func<Vector3> position, Func<Vector3> rotation)
     {
@@ -65,6 +73,17 @@ public abstract class DragPointMeido : DragPoint
     protected void InitializeIK(TBody.IKCMO iKCmo, Transform upper, Transform middle, Transform lower) =>
         iKCmo.Init(upper, middle, lower, maid.body0);
 
-    protected void Porc(TBody.IKCMO ikCmo, IKCtrlData ikData, Transform upper, Transform middle, Transform lower) =>
+    // WARN: This does NOT work and is only done so the compiler does not complain
+    protected void Porc(
+        TBody.IKCMO ikCmo,
+#if COM25
+        AIKCtrl
+#else
+        IKCtrlData
+#endif
+        ikData,
+        Transform upper,
+        Transform middle,
+        Transform lower) =>
         ikCmo.Porc(upper, middle, lower, CursorPosition(), Vector3.zero, ikData);
 }

+ 9 - 1
src/MeidoPhotoStudio.Plugin/Meido/IK/DragPointFinger.cs

@@ -11,7 +11,15 @@ public class DragPointFinger : DragPointMeido
     private readonly TBody.IKCMO ik = new();
     private readonly Quaternion[] jointRotation = new Quaternion[2];
 
-    private IKCtrlData ikCtrlData;
+    // WARN: This does NOT work and is only done so the compiler does not complain
+    private
+#if COM25
+            AIKCtrl
+#else
+            IKCtrlData
+#endif
+    ikCtrlData;
+
     private Transform[] ikChain;
     private bool baseFinger;
 

+ 9 - 1
src/MeidoPhotoStudio.Plugin/Meido/IK/IK Chain/DragPointChain.cs

@@ -7,7 +7,15 @@ public abstract class DragPointChain : DragPointMeido
     protected readonly TBody.IKCMO IK = new();
     protected readonly Quaternion[] jointRotation = new Quaternion[3];
 
-    protected IKCtrlData ikCtrlData;
+    // WARN: This does NOT work and is only done so the compiler does not complain
+    protected
+#if COM25
+    AIKCtrl
+#else
+    IKCtrlData
+#endif
+    ikCtrlData;
+
     protected Transform[] ikChain;
 
     public override void Set(Transform myObject)