Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to show a message from a blender script?

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.

like image 470
Andrew Avatar asked Oct 08 '11 14:10

Andrew


People also ask

Does Blender have an API?

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.

What can you do with scripting in Blender?

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 .

Can you use Python with Blender?

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.


1 Answers

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.

like image 121
Kay Avatar answered Sep 30 '22 13:09

Kay