DSCN_Plugin
DSCN_Plugin copied to clipboard
Importing SpatialMaterials with images causes errors in the debugger
Right now when you import a scene with a SpatialMaterial, you get a bunch of errors in the debugger saying the following:
Condition ' !f ' is true. returned: ERR_CANT_OPEN
This is because saved SpatialMaterials currently do not have their images cleared before being saved. This means when the DSCN file is being loaded and the SpatialMaterial is created, it tries to load images at RID's that do not exist.
This does not cause any problems beyond some annoying messages though, because the images in the material are replaced with the saved images in the DSCN shortly after.
The solution to this is to clear any references to images in the SpatialMaterial before saving the SpatialMaterial, similar to what is being done for Sprite nodes. Unfortunately when I tried clearing the images in materials previously, it cleared the images in the currently open scene as well.
Ideally, saved SpatialMaterials will have all their images cleared before being saved, which will remove these errors in the debugger. The problem is clearing the references without altering the materials in the scene.