godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.03k stars 21.18k forks source link

Regression: It's impossible to modify exported NodePath array content for instanced subscene #13971

Closed kubecz3k closed 6 years ago

kubecz3k commented 6 years ago

Operating system or device, Godot version, GPU Model and driver (if graphics related): af27414b1c10173584539186e396668a899e06b2 Ubuntu 17.04

Issue description: This is an issue that reveals quite often since I'm on 3.0 I'm not always able to reproduce it from scratch, but when it happens it's permanent. Also for the issue to happen, user need to close every scene in which given tool subscene is instanced (even if not directly). I'm quite sure this is 3.0 related issue since I'm using array nodepaths this way since a long time, also this issue is for sure not very fresh, I tried to track it down couple of times already. Short video description: https://youtu.be/1fjAQXu49TY (the subscene don't need to be in tool mode for this to happen as it turned out)

Steps to reproduce: You can check video for quick 40s reproduction process with provided sample

  1. Download reproduction project.
  2. Open "ExportedNodePathArraySave" tscn
  3. Add new nodepath item to 'onTest' node and fill it
  4. Save the scene
  5. Close it
  6. Open "ExportedNodePathArraySave" tscn again and see the node path was not saved

Link to minimal example project: ExportedNodePathArraySave.zip

reduz commented 6 years ago

@bojidar-bg ?

bojidar-bg commented 6 years ago

Found the issue, not sure if it is fixable before 3.0:

  1. onTest.tscn has an Array assigned to the property.
  2. ExportedNodePathArraySave.tscn instances onTest, but does not create a new array reference.
  3. User edits the array in ExportedNodePathArraySave.tscn and saves. It doesn't save the array since it is the same as the one in the base scene.
  4. User reopens ExportedNodePathArraySave, but keeps onTest opened -> the array referenced in both of the scenes remains the wrong one
  5. User reopens both -> the array is reloaded from disk. Since ExportedNodePathArraySave.tscn doesn't have one, it is read from onTest.tscn, and is the original array.

One way to fix this would be to allow for a new array to be created in the subscene, instead of editing the old one. Also, the "Changes might be lost" popup doesn't show up properly.

Looks slightly related to #12205.

akien-mga commented 6 years ago

Moving to 3.1 as per https://github.com/godotengine/godot/pull/15368#issuecomment-355975450.