ozzr / godot_terrain

Custom Godot Engine Build with Terrain Module

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crash when trying to save Terrain Data with 2k paint textures

outobugi opened this issue · comments

Setting the Paint Texture size in Storage settings to 2048 freezes the editor for a while but works.
The crash happens when trying to save the storage data even with one paint texture.

ERROR: Condition "!mem" is true. Returned: nullptr
   at: Memory::realloc_static (core\os\memory.cpp:130)
ERROR: Condition "!_ptrnew" is true. Returned: ERR_OUT_OF_MEMORY
   at: CowData<unsigned char>::resize (F:\godot_custom_builds\godot-3.5.1-stable\core/cowdata.h:288)

The errors are the same with every crash related to saving the data.
This probably is a Godot issue rather than specific to this plugin. Any time I have tried to save a lot of big resources, Godot just dies.

EDIT:
Tried to save the paint texture (Image resource) to disk, but Godot froze and spammed the error above.

commented

Fixed by changing how the Terrain Data stores its resources. Now instead of storing every texture inside by default, it will export them into separate folders as textures while capturing the paths.