Is there a way to show a simple message box with a text from a blender script? For example if i'm having an error during execution.
Blender uses the Python programming language for its scripting API. The Blender Python API is based on Python 3. It is integrated deeply, used for writing add-ons, generating user interface layouts, and import and export of many file formats. It covers all user-accessible data and functionality.
Most areas of Blender can be scripted, including animation, rendering, import and export, object creation and automating repetitive tasks. To interact with Blender, scripts can make use of the tightly integrated API .
Python in BlenderBlender provides its Python modules, such as bpy and mathutils , to the embedded interpreter so they can be imported into a script and give access to Blender's data, classes, and functions. Scripts that deal with Blender data will need to import the modules to work.
Update: The link does not exist officially any longer and I stopped developing for Blender. The old 2.5 cookbook is still available in the internet archive at:
https://web.archive.org/web/20120824033549/http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Cookbook/Code_snippets/Interface#A_popup_dialog
Have a look at this code snippet for an error dialog / message window. After selecting, a (text) file a message pops up when the word return is read. It works basically but I had to hit escape to make the box disappearing (on Mac OSX) because there was no reaction on mouse input.
Seems to me that there is no generally recommended way for displaying message boxes in Blender 2.5. Maybe the designers want to encourage the add-on programmers to use the self.report for messages and the tool shelf for getting operator's input instead. But this is just an assumption, I am still a beginner.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With