Godot: PackedScene export variable corrupts the scene file

Created on 16 Dec 2018  路  7Comments  路  Source: godotengine/godot

Godot version:

v3.1.alpha.custom_build.01fa067

OS/device including version:

Windows 10

Issue description:

For some reason when you define an export variable as PackedScene and give a path to a scene, save the scene, and reopen the scene, the engine will crash without any errors.

There is also another error that gets produced that if you go to the inspector and click on the refresh icon of the PackedScene with an given a path to a scene this error gets produced:

core\object.cpp:1241 - Error calling method from signal 'property_changed': 'EditorInspector::_property_changed': Method expected 2 arguments, but called with 1.

If you load up the engine again and try to open the scene again the engine will crash. To fix the corrupted scene file you have to delete the PackedScene export variable or manually edit the scene file and remove the PackedScene variable from it.

Also if you try to load up the scene in-game the game will also crash.

Steps to reproduce:
To get the engine to crash:

  1. Create a script and make an export variable with the type PackedScene
  2. Go in the inspector and load in a scene path
  3. Save and reopen the scene
  4. The engine crashes

To get the error:

  1. Give the PackedScene a path to load
  2. Press the refresh icon in the inspector on the PackedScene
  3. An error gets produced
bug high priority core

Most helpful comment

PackedScene export is sometimes nice (e.g. having a selection of enemy ships or the like that can be swapped on the fly in editor) so instead of forbidding it completely, maybe replace it with a path internally?

All 7 comments

Can i ask why this is not "high priority"? The reason is that i can't work with Godot right now because of this bug.

On C# it is crashing on [Export] Texture as well. Same Bug as above. Writing same error and crashes all the time on reopen scene or other things. Spectator is not working correctly (or lets say. It doesnt work with Texture Export) on the Export and so on.

Right now i cant work with Godot because of this. It crashes all the time only because of Export Texture var.

I know that C# is alpha state. But its only crashing. It seems a Windows only problem. Would be nice to see this fixed soon. Not tested with PackedScene. But when its the same thing i will run in it too as well soon.

I have same error _property_changed in project settings - https://streamable.com/oyvf2

I am seriously considering forbidding the ability to have these loaded in-editor, since the editor itself uses packed scenes too and having them loaded may be asking for trouble. Also of course, plenty of ways to corrupt and break the scene file by mystake.

@vnen we should probably forbid exporing properties for scene files, or maybe making the editor use some sort of internal placeholder for this that just contains a path to the file. What do you think?

PackedScene export is sometimes nice (e.g. having a selection of enemy ships or the like that can be swapped on the fly in editor) so instead of forbidding it completely, maybe replace it with a path internally?

@Zireael07 Yeah, I agree, I use it for spawners and such. No need to rewrite them, just drag the enemy scenes on to the export var, save, and done. Copy and paste the spawner scene, and rapidly we have lots of reusable and quick to configure enemy spawners.

@reduz I very much like the option for export (PackedScene). It does two nice things for me at least. It allows a drag and drop of PackedScene that the script can easily reference (IE - An artist can drag and drop desired scenes she has created, copied, or modified for the script to act on at _ready().) The second is that it apparently preloads it too. These are behaviors some of my projects rely on.

I hope the solution you guys settle on can preserve these things at least.

Ok, I guess this fails because of circular references somehow? I will make it detect them and ensure they are erased on load.

Was this page helpful?
0 / 5 - 0 ratings