Post #1345: Mighty Pea:

๐Ÿ“‹ Metadata

  • Author: roaoao
  • Date: 2018-04-26 02:47:56
  • Type: answer
  • Quality Score: 8/10
  • Reply to: post_01344

๐Ÿท๏ธ Tags

hotkeys advanced

  • Python Scripting
  • Macro Editor

๐Ÿ’ฌ Content

Mighty Pea:

can I not force run the command regardless of location, or momentarily switch to the required mode, or trick it into thinking it is?

Yes, you can use some operators in any screen/area if you override the context.
For example:

bpy.ops.console.clear(override_context('CONSOLE', "Scripting"))

Where โ€˜CONSOLEโ€™ is a type of the area and โ€œScriptingโ€ is a screen name with that area.
You can find more info about override_context() function in pie_menu_editor/scripts/autorun/functions.py.


๐Ÿ”— View on Blender Artists