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

Feature/refactor textureitem #744

Merged
merged 16 commits into from
Feb 15, 2021

Conversation

ousttrue
Copy link
Contributor

@ousttrue ousttrue commented Feb 15, 2021

#732
#450 の準備。

ImporterContext の materials と textures の生成責務を
それぞれ、MaterialFactory、TextureFactory に移譲した。

Texture生成をコンストラクタで渡してから後で変換パラメーターというように小出しにする(TextureItem)のをやめて、
すべての必要なパラメーター一回の static 関数呼び出しに渡すという路線に変更。
TextureItem を単純化することを目指した。

TextureFactory.GetTextureAsync(GetTextureParam param) 関数が中心。

    public struct GetTextureParam
    {
        public const string NORMAL_PROP = "_BumpMap";
        public const string METALLIC_GLOSS_PROP = "_MetallicGlossMap";
        public const string OCCLUSION_PROP = "_OcclusionMap";

        public readonly string TextureType;
        public readonly float MetallicFactor;
        public readonly ushort? Index0;
        public readonly ushort? Index1;
        public readonly ushort? Index2;
        public readonly ushort? Index3;
        public readonly ushort? Index4;
        public readonly ushort? Index5;
}

public async Task<Texture2D> GetTextureAsync(GetTextureParam param)

部分的に Task を導入、Editor 時の UnitySynchronizationContext.Exec の呼び出し対策を施した(AsIEnumerator)。

@ousttrue ousttrue requested a review from Santarh February 15, 2021 05:03
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.

よさそう。
async も CancellationToken の導入をすればなおヨシ(もうちょい試行錯誤入ると思うのでまた)

@ousttrue ousttrue merged commit df8e554 into vrm-c:master Feb 15, 2021
@ousttrue ousttrue deleted the feature/refactor_textureitem branch April 2, 2021 04:33
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.

2 participants