Hello,
I am trying to figure out how I can create and put in my scene SpeedTree assets using a C# script.
So I have downloaded the Free_SpeedTrees package and drag drop one of them in my scene to see what results in the Hierarchy panel.
It appears that a SpeedTree asset is based on :
-object with LOD component
|_billboard
|_LOD n
|_LOD n+1
|_Collision object n
|_Collison object n+1
Each LOD has a MeshFilter that loads the .spm file it needs.
I looked into the documentation (both Manual and Scripting API). I found no class for SpeedTree, except the SpeedTreeImporter but it seems that this class only customize import settings.
Then I looked into LODComponent and LOD, but the only example uses Primitives.
I also went through the MeshFilter class and its Mesh attribute, which appears in the Editor as a filepath but is instead a Mesh object in the API. Unfortunatly, the Mesh object has no method for loading a 3D file and building itself from the file.
I really have no clue on where to start, which class is needed. Don’t even know if it is possible to dynamically create SpeedTree from script, as both the Forums and the Answers area are weak on this subject.
So any help would be greately appreciated!