Last active
May 22, 2023 14:08
-
-
Save p2or/154a8998a16acf23444397ebdba997ee to your computer and use it in GitHub Desktop.
Supress Operator output II #Blender #BSE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# for http://blender.stackexchange.com/questions/56087/check-if-an-operation-can-be-applied-without-runtime-errors | |
import bpy | |
if bpy.ops.mesh.fill_grid.poll(): | |
print("correct context") | |
try: | |
bpy.ops.mesh.fill_grid() | |
except RuntimeError as exception: | |
error = "\n".join(exception.args) | |
print("error:", error) | |
else: | |
print ("incorrect context") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment