1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Not allowed to access vertex data on mesh 'Body' at array index 0

Last updated at Posted at 2021-08-12

問題点: Not allowed to access vertex data

Burstコンパイラなどで、SkinnedMeshの読み取り専用のスナップショットを取得する際に、AcquireReadOnlyMeshDataという関数を以下のように取得するのですが(参考は、Keijiro氏のSmrvfx )、

var dataArray = Mesh.AcquireReadOnlyMeshData(meshes)

そうすると、

InvalidOperationException: Not allowed to access vertex data on mesh 'Body' at array index 0 (isReadable is false; Read/Write must be enabled in import settings)

というように、MeshのVertexにアクセスできないと言われます。

解決法

この問題は、アクセスしようとしているSkinnedMeshやMeshの元となるFBXファイルの「Read/Write」をオンにすることで解決しました!

ReadWriteFromScript.png

最後に

ぜひ、フォローよろしくお願いいたします!

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?