godot
godot copied to clipboard
`MovieWriter` extension support
Fixes #96055 , MPR is fixed by this PR.
In setup2 the setup sequence for the MovieWriter runs before any user provided subclasses of MovieWriter can be inserted into the lookup table. We can't instance MovieWriter prior to this point because, to my knowledge, it must be instanced during scene loading. Moving the writer directly after scene gdextension initialization fixes this, but I'm unsure if it's a clean solution or if the writer is selected directly after the render server is initialized for any specific reason.
Moving the writer directly after scene gdextension initialization fixes this, but I'm unsure if it's a clean solution or if the writer is selected directly after the render server is initialized for any specific reason.
Can you explain this problem more?
It's likely the same as in https://github.com/godotengine/godot/pull/91374... Wrong order of things being initialized causes the registration to fail. The change likely fixes this, but it's in main.cpp so it's scary to touch and hard to ensure it doesn't break anything.
Can you explain this problem more?
Sure. As it stands to use a movie writer you need to instantiate it, then call MovieWriter::add_writer, this inserts it into a static table. The problem is that this static table is searched for the writer before the writer can be initialized. The lowest initialization level where you can construct a MovieWriter is INITIALIZATION_LEVEL_SCENE.
I recognize that touching main is modifying a very hot, and essential code path. I would appreciate any help or alternative directions someone could take this. Other solutions I can think up don't preserve MovieWriter functionality as it was designed, i.e. adding API to allow the user to swap to another MovieWriter at recording time.
All squashed, ready for CI to run.
Thanks! Congratulations on your first merged contribution! 🎉