- Home /
How to make a combined mesh readable, or access the original sharedMesh?
I'm trying to use Edelweiss' Decal System, which, in order to create decals in runtime (bullet impacts and such), needs to read the data of the mesh it's being projected on.
The problem is that, when using the Unity's Static Batching feature, all static meshes (sharedMesh from MeshFilter) in the scene become a runtime generated combined mesh, which apparently is not readable, and thus, not usable by the Decal System mesh generator.
I'd like to use the very useful batching feature and at the same time be able to create decals.
A possible solution would be to use the sharedMesh from the MeshCollider, but of course I'm not using a MeshCollider everywhere.
Thanks in advance!
Absence of answers means it's not possible? Or am I posing it wrongly?
Hey! Any work around here tmdchi? I'm procedurally generating a lot of meshes which require lots of combining for a decent fps, but also later I require those meshes to be exported as obj files.
Like you I currently can't read the combined meshes, and have no ideas about how to read them now, apart from duplicating each one and only combining the child meshes of one of the pairs.
An interesting fact is I am still able to read the combined meshes via Editor scripts such as a standard obj exporter editor script.
Isaac
Answer by dgoyette · Jun 20, 2018 at 05:30 PM
This is a very old post, but it's the first result I found in Google when researching a similar issue I was having. In my case, I have a script that does some interesting visual effects which rely on accesses in the mesh of an object. This script wasn't working on Static objects, because the MeshFilter's mesh was a Combined Mesh by the time Start() was executed on mys script.
Anyway, what worked for me was to move my code from Start() to Awake(). It seems that the Mesh isn't combined yet in Awake, but is combined by the time Start is called.
This is under Unity 2018.1.
Actually, scratch that! It appears that the above statement is correct when run in Unity's editor, but it is NOT true when run as part of a build. It's possibly bug-related, but this is discussed more on the forums: https://forum.unity.com/posts/3544143/
Your answer
![](https://koobas.hobune.stream/wayback/20220613095739im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Export objects to a .3DS file at runtime 1 Answer
Create / Modify Texture2D to Read/Write Enabled at Runtime 3 Answers
Unity Projects 01 Stealth - problem! 1 Answer
AssetPreview at runtime 3 Answers
Detect GLES version at runtime 1 Answer