0
$\begingroup$

I want to add a modal operator (a set of shortcuts) to the asset browser whn a button on the menu on the 3D viewer is clicked.

I know that by using

context.window_manager.modal_handler_add(self)

I add the modal operator to the current context, but is there a way to override things so that the modal operator gets added to another area or space?

I tried:

override = context.copy()
override["area"] = area
with context.temp_override(**override):
     window_manager.modal_handler_add(self)
     print(context)

but I get a crash and the message:

AttributeError: 'Context' object has no attribute 'temp_override'
$\endgroup$

0

You must log in to answer this question.

Browse other questions tagged .