Skip to content

Commit

Permalink
Merge pull request #89 from soupday/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
soupday authored Aug 2, 2023
2 parents 583c200 + b0c9544 commit 5254ecc
Show file tree
Hide file tree
Showing 22 changed files with 353 additions and 533 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
Changelog
=========

### 1.5.2
- Animation Retargeter fixes.
- AnimationMode removed.
- Clip generation file name suffix corrected.
- Animation Clip overwrite no longer breaks references in Unity 2023.1.
- Clip settings (foot IK, mirror, speed) reset to defaults on opening retarget window.
- Character prefab generation no longer breaks references. (Except 2023.1.1-5 due to Unity bugs)
- Rogue usings removed from code.
- Animation processing fixes.
- Correct character prefab used to retarget _motion.fbx files.
- Animation Clip overwrite no longer breaks references in Unity 2023.1.

### 1.5.1
- Character Build no longer creates and adds a default animation controller due to bugs in Unity 2022/2023 causing memory leaks when applying animation controllers to prefabs.
- Instalod and other renamed object/material name matching improvements.
Expand Down
362 changes: 86 additions & 276 deletions Editor/AnimPlayerGUI.cs

Large diffs are not rendered by default.

52 changes: 29 additions & 23 deletions Editor/AnimPlayerOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ public class AnimPlayerOverlay : IMGUIOverlay, ITransientOverlay
private static bool visibility = false;
public static bool Visibility { get { return visibility; } }
public static float width;
public static float height;
public static float height;
public static float containerHeight;
public static float containerWidth;
public static bool setInitialPosition = false;

public static bool AnyVisible()
{
Expand All @@ -45,59 +48,55 @@ public static bool AnyVisible()
}
return false;
}

public static void ShowAll()
{
visibility = true;
visibility = true;
foreach (AnimPlayerOverlay apo in createdOverlays)
{
apo.Show();
}
}
}

public static void HideAll()
{
visibility = false;
visibility = false;
foreach (AnimPlayerOverlay apo in createdOverlays)
{
apo.Hide();
}
}

AnimPlayerOverlay()
{
isVisible = visibility;
{
isVisible = visibility;
}

public void Show()
{
isVisible = true;
{
if (isInToolbar) Undock();
collapsed = false;
floatingPosition = new Vector2(
containerWindow.position.width - width - 3f,
containerWindow.position.height - height - 3f
);
collapsed = false;
setInitialPosition = true;
isVisible = true;
}

public void Hide()
{
{
isVisible = false;
}

public override void OnCreated()
{
createdOverlays.Add(this);
{
createdOverlays.Add(this);
}

public override void OnWillBeDestroyed()
{
{
if (createdOverlays.Contains(this))
{
Hide();
createdOverlays.Remove(this);
}
Debug.Log("OnWillBeDestroyed");
base.OnWillBeDestroyed();
}

Expand All @@ -107,11 +106,18 @@ public override void OnGUI()
AnimPlayerGUI.DrawPlayer();
AnimPlayerGUI.DrawFacialMorph();

if (Event.current.type == EventType.Repaint)
if (setInitialPosition)
{
Rect last = GUILayoutUtility.GetLastRect();
width = last.x + last.width;
height = last.y + last.height;
if (Event.current.type == EventType.Repaint)
{
Rect last = GUILayoutUtility.GetLastRect();
width = last.x + last.width;
height = last.y + last.height;
containerHeight = this.containerWindow.position.height;
containerWidth = this.containerWindow.position.width;
floatingPosition = new Vector2(containerWidth - width - 14f, containerHeight - height - 23f);
setInitialPosition = false;
}
}
}
}
Expand Down
8 changes: 3 additions & 5 deletions Editor/AnimPlayerWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ public static void OnSceneGUI(SceneView sceneView)
public static void ShowPlayer()
{
if (!isShown)
{
Debug.Log("WINDOW: SHOWING PLAYER");
{
SceneView.duringSceneGui -= AnimPlayerWindow.OnSceneGUI;
SceneView.duringSceneGui += AnimPlayerWindow.OnSceneGUI;
isShown = true;
Expand All @@ -80,8 +79,7 @@ public static void ShowPlayer()
public static void HidePlayer()
{
if (isShown)
{
Debug.Log("WINDOW: HIDING PLAYER");
{
SceneView.duringSceneGui -= AnimPlayerWindow.OnSceneGUI;
AnimPlayerGUI.CleanUp();

Expand All @@ -97,7 +95,7 @@ public static void DoWindow(int id)

public static void Empty(int id)
{
Debug.Log("Showing " + id);
Util.LogInfo("Showing " + id);
}
}
}
Loading

0 comments on commit 5254ecc

Please sign in to comment.