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

Fix/scripted importer axes #958

Merged
merged 7 commits into from May 20, 2021

Conversation

ousttrue
Copy link
Contributor

@ousttrue ousttrue commented May 19, 2021

#940

ScriptedImporterAxes を導入して、gltf/glb のデフォルト変換軸設定の実装方法を変更した。

@ousttrue ousttrue requested a review from Santarh May 19, 2021 09:09
@ousttrue ousttrue added this to the v0.75 milestone May 19, 2021
Santarh
Santarh previously approved these changes May 19, 2021
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.

挙動に関して改善の余地ありな気がするが、定義はよさそう!

/// </summary>
public enum ScriptedImporterAxes
{
Default,
Copy link
Contributor

Choose a reason for hiding this comment

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

モデルがそれぞれ Default の属性を持てるのはよさそう

case ScriptedImporterAxes.X: return Axes.X;
case ScriptedImporterAxes.Default:
{
#if UNIGLTF_DEFAULT_AXES_X
Copy link
Contributor

Choose a reason for hiding this comment

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

Symbols 切り替えは(大きなプロジェクトに入ったときに)重そうではあるw

* symbol UNIGLTF_DEFAULT_AXES_X は止める
Santarh
Santarh previously approved these changes May 20, 2021
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.

よさそう。
ただエッジケースに気づいてしまった感。

たとえばまず、GLB ファイルをプロジェクトに入れて、Default 設定として Import 。
その次にプロジェクトのデフォルト軸の設定を変更。

その状態だと、GLB ファイルは Default なのにプロジェクトの設定と食い違った状態で読み込まれているという矛盾状態。
そしてこの状態は、プロジェクトの Reimport All などが走ったタイミングで是正されて、突然軸方向が "正しくなって" しまう。

したがって次の挙動があるべきなきはする。
「プロジェクトのデフォルト軸設定を変更したとき、プロジェクトに読み込まれているすべての GLB ファイルは再インポートが走る」

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.

yosasou


namespace UniGLTF
{
public static class UniGLTFPreference
{
static IEnumerable<string> GetReimportPaths()
{
String[] guids = AssetDatabase.FindAssets("t:GameObject", null);
Copy link
Contributor

Choose a reason for hiding this comment

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

なるほど

}
else if (AssetImporter.GetAtPath(assetPath) is GltfScriptedImporter gltf)
{
if (gltf.m_reverseAxis == ScriptedImporterAxes.Default)
Copy link
Contributor

Choose a reason for hiding this comment

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

よさそう

@ousttrue ousttrue merged commit 0ca5f97 into vrm-c:master May 20, 2021
@ousttrue ousttrue deleted the fix/scripted_importer_acxes branch October 27, 2021 06:01
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