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

EditorTextureSerializer で例外になるテクスチャを事前にエラーメッセージにする #1102

Merged
merged 4 commits into from
Jul 19, 2021

Conversation

ousttrue
Copy link
Contributor

@ousttrue ousttrue requested a review from Santarh July 16, 2021 06:51
{
case TextureImporterType.Default:
case TextureImporterType.NormalMap:
break;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

EditorTextureSerializer はこの2種類しか対応していない

Santarh
Santarh previously approved these changes Jul 16, 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.

Editor の話

{
public virtual string GetGltfMaterialTypeFromUnityShaderName(string shaderName)
{
if (shaderName == "Standard")
Copy link
Contributor

Choose a reason for hiding this comment

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

この辺の判定は将来的に変わりそう

using UnityEngine;

namespace UniGLTF
{
public interface IMaterialValidator
Copy link
Contributor

Choose a reason for hiding this comment

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

いまはこれでいいですが、このインタフェースは Validator だけの概念ではなく Exporter が参照すべきではありそう。

switch (textureImporter.textureType)
{
case TextureImporterType.Default:
case TextureImporterType.NormalMap:
Copy link
Contributor

Choose a reason for hiding this comment

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

Exporter と Validator で2重に定義を持っていていいのかという感じはありますが、まあ Validator が厳しい分にはいいか…

Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: Validator(ExportDialog) と Exporter で同じ処理を共通化する

ousttrue added 2 commits July 16, 2021 16:47
Exporter がテクスチャー列挙という形式をとらずに全部展開してするという手法を取っているため、それほど共通化されない。
@ousttrue
Copy link
Contributor Author

  • IMaterialValidator 独立
  • MeshExportList 追加

あまりきれいにならず。

IMaterialValidator と IMaterialExporter は合体でいいかも。
おいおいやる。

@ousttrue
Copy link
Contributor Author

  • Exporter.Prepare() (収集)
  • Exporter.Vdalidate() (エクスポートできるか状態確認)
  • Exporter.Export() (エクスポート)

というのが良かったか。

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 の挙動や public な interface に変更はなさそう ✔️

@Santarh
Copy link
Contributor

Santarh commented Jul 16, 2021

Prepare, Validate, Export はたしかによさそう

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