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 remove scaling #2177

Merged
merged 6 commits into from
Oct 26, 2023
Merged

Conversation

ousttrue
Copy link
Contributor

#2169 の部品。

  • VRM1 の新ダイアログ
  • VRM0 のダイアログに反映
  • GLTF の愛あログに反映

という作業順を予定。

  • VRM1 の新ダイアログ(仮)を実装

freeze => integrate => split というパイプラインを予定しています。
freeze の一部としてヒエラルキーからの scale/rotation 除去を実装しました。
vrm0 の該当部分とコードを共有しました。

@ousttrue
Copy link
Contributor Author

dialog

@ousttrue ousttrue requested a review from Santarh October 25, 2023 13:00
@@ -15,20 +15,20 @@ namespace UniGLTF.MeshUtility
/// UnityEngine.Object を継承したクラスのフィールドに ユーザー定義 struct を配置する。
/// 持ち主の SerializedObject を経由して EditorGUILayout.PropertyField してる。
/// </summary>
[CustomEditor(typeof(MeshProcessDialog), true)]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

gltf の meshutility を rename。中身は変えていない

@@ -10,7 +10,6 @@ namespace UniGLTF
public static class TopMenu
{
private const string UserGltfMenuPrefix = UniGLTFVersion.MENU;
private const string UserMeshUtilityPrefix = UniGLTFVersion.MENU + "/Mesh Utility";
private const string DevelopmentMenuPrefix = UniGLTFVersion.MENU + "/Development";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Menu が深かったので浅くしてみた

static (GameObject, Dictionary<Transform, Transform>) NormalizeHierarchy(GameObject go, CreateAvatarFunc createAvatar)
public static (GameObject, Dictionary<Transform, Transform>) CreateNormalizedHierarchy(GameObject go,
bool removeScaling = true,
bool removeRotation = true)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

新機能。ヒエラルキーからの Scale/Rotation の除去を
Scale だけの除去ができるように追加した。

@@ -271,5 +272,42 @@ public static bool GetHumanDescription(UnityEngine.Object target, ref HumanDescr
return false;
}
#endif

Copy link
Contributor Author

Choose a reason for hiding this comment

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

コールバックで渡していた定型処理を関数化

@@ -0,0 +1,96 @@
using System.Collections.Generic;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

新規。vrm1 mesh utlity ダイアログ

using UniHumanoid;
using UnityEngine;

namespace UniVRM10
Copy link
Contributor Author

Choose a reason for hiding this comment

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

新規。vrm1 mesh utility のロジック。
なるべく Runtime、
なるべく Gltf層、
というように後で整理して共通化する予定。

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.

ついでに Runtime から実行できると嬉しい(願望)

@@ -271,5 +272,42 @@ public static bool GetHumanDescription(UnityEngine.Object target, ref HumanDescr
return false;
}
#endif

public static void AddAnimator(GameObject _src,
Copy link
Contributor

Choose a reason for hiding this comment

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

やってる内容としては CreateAvatarAndAddAnimatorComponent ってところかな。
Avatar は Animator とは無関係に作れるので、その処理は

Avatrar CreateAvatar(~~~)

として関数分けておいた方が読みやすいかもしれません。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

確かに。次の更新に入れます

@ousttrue ousttrue merged commit 26c7cb9 into vrm-c:master Oct 26, 2023
1 check passed
@ousttrue ousttrue deleted the fix/impl_remove_scaling branch January 24, 2024 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants