Spent a bunch of time on stream today wrestling with a "RuntimeError: Operator b...

@Cheeseness@mastodon.social

Spent a bunch of time on stream today wrestling with a "RuntimeError: Operator bpy.ops.object.shape_key_move.poll() failed, context is incorrect" error in the Blender addon I'm writing.

After reading through some Blender source code and still not understanding what it wanted, I noticed that the object I expected to be selected/active at the point it errored out was not. Turns out I was setting the active object to a new thing before I'd linked that new thing to the current scene. Whoops.