Message Box Button greyed out in some cases.

I’ve written a custom blender export script that iterates through the contents of a blender file, verifies a few criteria about each one, then writes it to a file in a specific format. I formatted it so that it could be registered as a mesh operator.

Then, I wrote another operator that displays a message box notifying our users of some caveats of using the exporter, and registered the operator to be displayed in the export menu. The message box has a button on it that executes the first operator I mentioned above.

In some files, I can load a file and immediately do a file-export and it works as expected, but in one in particular, it requires me to click on one of the triangle icons in the Outliner panel section in order to make the export button on the message box active. Any suggestions as to how I can make the message box draw function do the same? Or insight into what else I can change to work around this? As i’m checking every object in bpy.data.objects regardless of what is selected, i just need to trick it into letting me execute the function regardless of the context/selection.

Thanks for your help.

do you have a poll() function?

if that returns False, operator buttons and menu entries will be grayed out. poll() should only return True if context is suitable for the op to execute, e.g. there’s an active object (bpy.context.object is not None)

Thanks a bunch!