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
โ๏ธ Related PME Features
- 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.