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

Remove "Mesh not found." exception #910

Closed

Conversation

oocytanb
Copy link
Contributor

issue #909 のパッチです。

  • UniGLTF.gltfExporter.ExportNode で、"Mesh not found." の例外をスローしている部分を、単に削除することで修正してみました。

  • glTF.nodes の mesh のインデックスが 0 未満のものは、UniGLTF.GltfSerializer:Serialize_gltf_nodes_ITEM でメッシュの出力がスキップされますので、例外を投げずにそのまま続行すればよさそうだと考えました。

  • もし、この修正方法がまずければ、適切に実装されてください。

glTF に出力したときの node のサンプル

TextMeshPro のオブジェクトや、マテリアルがないオブジェクトは、node は出力されますが、mesh のインデックスはありません。v0.72.0 と同様の状態になります。

  "nodes": [
    {
      "name": "text_mesh_pro_obj",
      "rotation": [
        0,
        0,
        0,
        1
      ],
      "scale": [
        1,
        1,
        1
      ],
      "translation": [
        0,
        0,
        0
      ]
    },
    {
      "name": "cylinder_nomat",
      "rotation": [
        0,
        0,
        0,
        1
      ],
      "scale": [
        1,
        1,
        1
      ],
      "translation": [
        5,
        0,
        0
      ]
    },
    {
      "name": "cube_nomat",
      "rotation": [
        0,
        0,
        0,
        1
      ],
      "scale": [
        1,
        1,
        1
      ],
      "translation": [
        4,
        0,
        0
      ]
    },
    {
      "mesh": 0,
      "name": "cube_1",
      "rotation": [
        0,
        0,
        0,
        1
      ],
      "scale": [
        1,
        1,
        1
      ],
      "translation": [
        -1,
        0,
        0
      ]
    },
    {
      "mesh": 0,
      "name": "cube_2",
      "rotation": [
        0,
        0,
        0,
        1
      ],
      "scale": [
        1,
        1,
        1
      ],
      "translation": [
        2,
        0,
        0
      ]
    }
  ],

@ousttrue
Copy link
Contributor

#899 との関連で問題が2つありました。

で対応させていただきました。

@ousttrue ousttrue closed this May 11, 2021
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