Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vrm1.0] impl refactor mesh integration #2180

Merged
merged 4 commits into from
Oct 31, 2023

Conversation

ousttrue
Copy link
Contributor

#2169 の部品

List を統合するシンプルなインタフェースに改変。
exclude や統合対象を調整する責務は呼び出し側に移動した。

@@ -90,7 +90,7 @@ public static bool Execute(GameObject src, bool onlyBlendShapeRenderers)
// write mesh asset.
foreach (var result in results)
{
var mesh = result.IntegratedRenderer.sharedMesh;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

result には Renderer 乗せない(sharedMesh, sharedMaterials, bones を保持する)

@@ -144,5 +145,33 @@ static void RemoveScaleAndRotationRecursive(Transform src, Transform dst, Dictio

return (normalized, boneMap);
}

public static void WriteBackResult(GameObject go, GameObject normalized, Dictionary<Transform, Transform> boneMap)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy せずにヒエラルキーを直接改変するために作った。
TODO: undo に対応する。

@@ -232,7 +236,24 @@ public void Push(SkinnedMeshRenderer renderer)
}
}

public MeshIntegrationResult Integrate(MeshEnumerateOption onlyBlendShapeRenderers)
public static MeshIntegrationResult Integrate(MeshIntegrationGroup group, bool useBlendShape)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MeshEnumerateOption を見て‘Renderer を収集する責務を外に移動。

@@ -306,5 +306,30 @@ public static bool GetHumanDescription(UnityEngine.Object target, ref HumanDescr
avatar.name = "created";
return avatar;
}

public static Avatar RecreateAvatar(Animator src)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

親子関係は変わっていないが transform が変わったヒエラルキーに対して
avatar を再作成する関数。

Copy link
Contributor

@Santarh Santarh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using に関してだけ

@@ -1,9 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.WebSockets;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

おそらく Reference ミス?コンパイル通らなくなる場合ありそうなので消してもらえると

using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

こちらも不要な using?
どうでもいいものならいいんですが CompilerServices は特定環境でマズそう

@ousttrue ousttrue requested a review from Santarh October 31, 2023 07:40
@ousttrue ousttrue merged commit e896c6c into vrm-c:master Oct 31, 2023
1 check was pending
@ousttrue ousttrue deleted the fix/refactor_mesh_integration branch January 24, 2024 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants