如何显示来自Blender脚本的消息? [英] 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.
推荐答案
更新:该链接不再正式存在,因此我停止为Blender开发.旧的2.5版食谱仍可在Internet档案中找到,网址为:
https://web.archive.org/web/20120824033549/http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Cookbook/Code_snippets/Interface#A_popup_dialog
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
看看这个错误代码/消息窗口的代码段.选择后,读取单词 return 时会弹出一个(文本)文件,并显示一条消息.它基本上可以正常工作,但是我必须逃脱才能使该框消失(在Mac OSX上),因为鼠标输入没有任何反应.
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.
在我看来,在Blender 2.5中没有普遍建议的显示消息框的方法.也许设计人员希望鼓励附加的程序员使用self.report消息,而使用工具架来获取操作员的输入.但这只是一个假设,我还是一个初学者.
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.
这篇关于如何显示来自Blender脚本的消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!