1

How to making a function that return the last line of string in the console (Assuming the console is not open). I'm using blender 3.4 and trying to use the stdout method, but it doesn't work, is there another way to achieve

enter image description here

How can I catch reports from Operators in Python script?

My situation is assuming I have a handler running in the background. It runs on every redraw in my add-on. When the user triggers any condition in the interface to display any text in the console, then assign the string to a global variable for me to access in some special cases.

For example, When the value of Rest Source changes from Original Coords to Bind Coords in Corrective Smooth modifier, the console will print a line: ERROR (bke.modifier): C:\Users\blender\git\blender-v350\blender.git\source\blender\blenkernel\intern\modifier.cc:459 BKE_modifier_set_error: Object: "Cube", Modifier: "CorrectiveSmooth", Bind data required.
Since this triggers redraw, I can put a function into the handler to listen.

enter image description here

X Y
  • 5,234
  • 1
  • 6
  • 20

0 Answers0