Jump to content

Error during Terrain Export


dixZo1337
Go to solution Solved by Peter,

Recommended Posts

Hello

I'm getting this error message when trying to export a Gaia made terrain to a low poly mesh:

Error during Terrain Export: Object reference not set to an instance of an object Stack Trace:   at Gaia.ConvertTerrains.ResizeTexture (UnityEngine.Texture2D texture, UnityEngine.TextureFormat format, System.Int32 aniso, System.Int32 width, System.Int32 height, System.Boolean mipmap, System.Boolean linear, System.Boolean compress) [0x00055] in E:\VIA Online\VIA Online\Assets\Procedural Worlds\Gaia\Scripts\Editor\ConvertTerrains.cs:1142
  at Gaia.ConvertTerrains.ExportBaseMap (UnityEngine.Terrain terrain, System.String LODPrefix) [0x0009c] in E:\VIA Online\VIA Online\Assets\Procedural Worlds\Gaia\Scripts\Editor\ConvertTerrains.cs:1212
  at Gaia.ConvertTerrains.ExportTextures (Gaia.ExportTerrainLODSettings LODSettings, UnityEngine.Terrain terrain) [0x0001a] in E:\VIA Online\VIA Online\Assets\Procedural Worlds\Gaia\Scripts\Editor\ConvertTerrains.cs:97
  at Gaia.ConvertTerrains.ExportSingleTerrain (UnityEngine.Terrain terrain, UnityEngine.SceneManagement.Scene originalScene, System.Collections.Generic.List`1[T] LODSettingsList, System.Int32 index, System.Int32 maxTerrainCount, System.Boolean isFinalLOD, System.Boolean isImpostorScenes, UnityEngine.SceneManagement.Scene serverScene) [0x001be] in E:\VIA Online\VIA Online\Assets\Procedural Worlds\Gaia\Scripts\Editor\ConvertTerrains.cs:1794
  at Gaia.TerrainConverterEditorWindow+<TerrainsCoroutine>d__64.MoveNext () [0x003ad] in E:\VIA Online\VIA Online\Assets\Procedural Worlds\Gaia\Scripts\Editor\TerrainConverterEditorWindow.cs:1591
UnityEngine.Debug:LogError (object)
Gaia.TerrainConverterEditorWindow/<TerrainsCoroutine>d__64:MoveNext () (at Assets/Procedural Worlds/Gaia/Scripts/Editor/TerrainConverterEditorWindow.cs:1607)
Gaia.TerrainConverterEditorWindow:EditorUpdate () (at Assets/Procedural Worlds/Gaia/Scripts/Editor/TerrainConverterEditorWindow.cs:175)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()

Would really appreciate help, since I don't have the slightest idea what went wrong. In total, the scene consists of 4 terrains. Work like a charm with the other 3. Only the last one doesn't work.

Thanks in advance and best regards,

 

Julian

Link to comment
Share on other sites

Sorry for the delay. 

Can you please try something for me? 
Will you try doing the 3 and then saving and restarting the editor? 
After restarting do the 4th one. 

You may need to disable all 3 first before doing the 4th. 
I am curious if that its going past the memory while trying to do this. 

Can you please tell me what Unity version you are using? 
How large are your terrains? 
What renderpipeline are you using? 

Link to comment
Share on other sites

On 9/20/2023 at 1:23 AM, Bryan said:

Sorry for the delay. 

Can you please try something for me? 
Will you try doing the 3 and then saving and restarting the editor? 
After restarting do the 4th one. 

You may need to disable all 3 first before doing the 4th. 
I am curious if that its going past the memory while trying to do this. 

Can you please tell me what Unity version you are using? 
How large are your terrains? 
What renderpipeline are you using? 

Did the first three. Then saved and restarted my editor, as you asked. After the restart, all exported meshes were gone. They are still in the newly generated folder in the user data, but not in the Unity hierarchy. I unfortunately don't know how to manually add the mesh terrains to the scene.

Tried to do the 4th anyway and got the same "Error during Terrain Export" again.

 

I am using untiy 2021.3.9.f1

Terrains are 512sqm each. 4 in total, makes 1024x1024 total size.

I am using URP

Further help would be great. Thanks in adavance.

Link to comment
Share on other sites

  • Solution

Hi @dixZo1337 I looked at the error again, and I might have a theory what could cause this: Could you please check / compare the textures on the terrain on the one that is crashing vs. the ones that are working?

The crash happens in the part of the export where Gaia creates the replacement texture for the mesh and looks at the terrain layers to determine which color values they have.

My sense is that on the problematic terrain there might be a terrain layer / texture on it that does not have a diffuse texture assigned, or the diffuse texture is missing or something similar.


image.png

Link to comment
Share on other sites

1 hour ago, Peter said:

Hi @dixZo1337 I looked at the error again, and I might have a theory what could cause this: Could you please check / compare the textures on the terrain on the one that is crashing vs. the ones that are working?

The crash happens in the part of the export where Gaia creates the replacement texture for the mesh and looks at the terrain layers to determine which color values they have.

My sense is that on the problematic terrain there might be a terrain layer / texture on it that does not have a diffuse texture assigned, or the diffuse texture is missing or something similar.


image.png

This did the Trick. Thanks so much, for the quick reply and the help.

  • Like 1
Link to comment
Share on other sites

Thank you for the update! 

If you are enjoying the asset and support if you haven't already could you please leave a review on the Unity asset store it would help us out a lot! 

Happy developing! 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Tell a friend

    Love Canopy - Procedural Worlds? Tell a friend!
  • Need help?

    We work with some of the biggest brands in global gaming, automotive, technology, and government to create environments, games, simulations, and product launches for desktop, mobile, and VR.

    Our unique expertise and technology enable us to deliver solutions that look and run better at a fraction of the time and cost of a typical project.

    Check out some of our non-NDA work in the Gallery, and then Contact Us to accelerate your next project!

×
×
  • Create New...