godot icon indicating copy to clipboard operation
godot copied to clipboard

Changing `CompositorEffect` array in the editor while the game is running gives `Cannot asign contents of array[Object]`

Open GustJc opened this issue 1 year ago • 2 comments

Tested versions

  • Reproducible in 4.3.beta2
  • And v4.3.beta.gh-93876 [3ccb371a2] (latested dev build at time, merge has no relation with this bug)
  • Still reproducible in v4.3.rc1.mono.official [e343dbbcc]

System information

Windows 10 - Vulkan (forward+) - dedicated

Issue description

Not anything critical, but if your game is running and you try to change the Compositor array, Godot will spit out an error saying.

E 0:03:29:0436   Array::assign: Cannot assign contents of "Array[Object]" to "Array[Object]".
  <C++ Error>    Method/function failed.
  <C++ Source>   core\variant\array.cpp:245 @ Array::assign()

And won't update the running game.

https://github.com/godotengine/godot/assets/3084189/8f1eb03d-06ba-429c-a72e-1e866e2032c8

Steps to reproduce

  • Run the game.
  • Change the environment Compositor array (either add or remove something)

Result: Error in output. No crash, but no change either. Expected: Running game updated with the new Compositor values like it does for other things.

Minimal reproduction project (MRP)

There is really no need. But here's a project with an empty scene and an environment node. compositor-error.zip

GustJc avatar Jul 04 '24 11:07 GustJc

Is the conclusion that the changes in #93876 caused this bug or did it exist in previous versions? I took a quick look at the bug and couldn't figure out how they would be connected.

JacobMillner avatar Jul 25 '24 21:07 JacobMillner

No relation at all. That second 'Tested version' I put there with this merge was just the latest dev build that I tested at the time. Just to make sure it was not already fixed on dev at the time. No relation with this bug at all.

I think this error always existed since CompositorEffects was implemented. Syncing scene changes doesn't work with the compositor. This is not a very common use case so I guess it never got tested. Maybe this is even intended and you might not be able to change the rendering hooks after the scene has started.

GustJc avatar Jul 27 '24 17:07 GustJc

Still present in v4.3.stable.official [77dcf97d8]. Happens when I either add a new compositor effect or change effect order from the editor. Yet if you do it in code, it's fine. For example, the following works for me:

var compositor_effects_new_order = compositor.compositor_effects
compositor_effects_new_order.reverse()
compositor.compositor_effects = compositor_effects_new_order

tsutsen avatar Sep 11 '24 15:09 tsutsen