I can't run the TreeCoverter scene error Read/Write must be enabled

mchlhills 1 year ago • updated by Aaron Brown 1 year ago 7

Using Unity 5.6. I can't run the TreeCoverter scene.  I'm getting an error in the console: "not allowed to access vertices on mesh....  Read/Write must be enabled." Yet these are unity tree creator trees. Can anyone help?

Under review

That's strange, I've never seen this error before. My converter definitely edits a mesh, but not the mesh of your original tree, only the new LushLOD mesh that it creates. You might want to try clicking the little "refresh" button on your tree creator tree. It's in the inspector window, and its a really tiny button that's hard to find, it's located along the left side, just at the lower left corner of the "Tree" component. So you first select your Unity tree, and then look at the inspector window, find the "Tree" component, and look at the lower left corner of the tree component, and the little refresh button should be there. That little refresh button looks like a circular arrow. Clicking it will sometimes refresh the textures / mesh of the tree, which can fix all kinds of odd problems with Unity Trees. If that doesn't help, you might even try restarting Unity. 

If none of the above fixes it, would you be able to remove all but one of the trees that won't convert, and then create a package containing the scene and the tree, and send that package to me, so I can try the conversion on my computer and see if I can get the same error? You can create a package by following these steps:

1) Remove all other trees from the scene other than one that is failing to convert.

2) Right click the scene file, and select "View Dependencies",

3) Make a note of all the files that are required, it may be quite a few files related to that specific tree (textures, materials, meshes, etc). I'll need all those files.

4) Right click the scene again, and select "Create Package", and then select the scene and ALL the files related to that tree (which should have been found in step 3), along with any files you may think are needed by the tree which were possibly not shown in step 3.

5) It will create a package file, which you can then upload to drive.google.com or somewhere, and give me a link to download it.

Wow, thanks for you speedy reply, appreciated. I'll follow your steps and let you know what I find out.

Just another question. The trees I'm using are from the asset store Realistic Tree Pack 1. This is the full error:

not allowed to access vertices on the mesh 'Combined Mesh (root: scene)(clone)' (isReadable is false; Read/Write must be enabled in import settings)

Is it possible that when importing the asset package that a read write can be enabled somewhere. I know this can be done with imported FBX, but these are tree creator trees and I can't find this option for these trees? Thanks

Well, you could try this:

1) Right click the file for the Tree Creator Tree. Make sure it's not some small part of the tree, but the prefab file that contains the whole unity tree creator tree.

2) Click "Select Dependencies".

3) See if you see any mesh files in the list that it gives you. 

4) Select each mesh file, and see if it is by any chance a FBX file of some sort, with import settings that can be adjusted.

Honestly though, my script never accesses the individual mesh files that make up the tree. The whole tree is converted by the tree creator into a single mesh, and my script accesses the verticies of that mesh. But that single mesh is not any kind of FBX file or with any kind of import settings. Unless under some strange situations the tree creator can produce a tree that has a mesh that has import settings, but I've never seen it do that.

But if none of the above helps, you can still send me your scene with your tree and I'll be able to figure this out for you.

Also I have no idea why the name of the mesh is appended with the (root: scene)(clone) tags. That's kind of odd, I wonder if the tree package you are working with has some kind of other script that is messing with the tree in some way, for it to have those tags on the mesh file.

Good news, I figured it out: If an object is marked as static it is not allowed to access its vertices. It's that simple. I just turned off static and now it's working just fine. Thanks so much, and great product! 


Yikes! Glad you figured that one out.

Maybe I'll check if it is possible for my script to set the tree to non-static just before conversion, to avoid that error from happening. If not, I'll have it give the user a warning if it detects that the tree is static. Thanks for the bug report!