Is it possible to catch reports from Operators in a Python script?
For example, the Operator bpy.ops.object.modifier_apply()
shows errors in the console when something goes wrong. I'd be happy to have a try... catch...
method to handle those.
Same with some addons like 3D Print Toolbox who send back useful info in the console and UI, but I can't seem to find a way to catch those. Is this possible?
Update:
To give a concrete example, this file uses a boolean modifier on two objects and when applied, the Operator returns a lot of WARNING
or errors in the console. How could I catch those?
try... catch
, but if I could somehow access those reports, that would be useful. $\endgroup$res = bpy.ops.some_operator()
. Common values are{'FINISHED'}
,{'CANCELED'}
and{'RUNNING_MODAL'}
, among others. $\endgroup$report()
function from those Operators. For a particular and specific example, in the 3D Print Toolbox addon, at line 477, theOperator.report()
function is called. That's what I'm trying to catch. $\endgroup$