﻿<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
	<id>https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=Dev%3A2.5%2FSource%2FArchitecture%2FReports</id>
	<title>Dev:2.5/Source/Architecture/Reports - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=Dev%3A2.5%2FSource%2FArchitecture%2FReports"/>
	<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:2.5/Source/Architecture/Reports&amp;action=history"/>
	<updated>2026-06-08T03:31:35Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=Dev:2.5/Source/Architecture/Reports&amp;diff=79755&amp;oldid=prev</id>
		<title>Yamyam: 1版 をインポートしました</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:2.5/Source/Architecture/Reports&amp;diff=79755&amp;oldid=prev"/>
		<updated>2018-06-28T18:37:29Z</updated>

		<summary type="html">&lt;p&gt;1版 をインポートしました&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ja&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← 古い版&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;2018年6月28日 (木) 18:37時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ja&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(相違点なし)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Yamyam</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=Dev:2.5/Source/Architecture/Reports&amp;diff=79754&amp;oldid=prev</id>
		<title>wiki&gt;Terrywallwork: /* Header */</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:2.5/Source/Architecture/Reports&amp;diff=79754&amp;oldid=prev"/>
		<updated>2010-03-30T19:30:37Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Header&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=Reporting Errors, Warnings and Debug Info=&lt;br /&gt;
&lt;br /&gt;
Reporting errors is something that is common to much code in Blender. Currently this is often either done through an blocking &amp;lt;tt&amp;gt;error()&amp;lt;/tt&amp;gt; call which will display a popup menu immediately, or a &amp;lt;tt&amp;gt;printf()&amp;lt;/tt&amp;gt; to the console which can go unnoticed. In 2.5 there are restrictions on when drawing and event handling is allowed, and as such &amp;lt;tt&amp;gt;error()&amp;lt;/tt&amp;gt; calls are not allowed anymore in modules such as blenkernel. As a replacement a &amp;lt;tt&amp;gt;ReportList&amp;lt;/tt&amp;gt; can now be passed along which can gather such error reports and either display them, print them in a console, or return them as an exception to python.&lt;br /&gt;
&lt;br /&gt;
==Header==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
/* Reporting Information and Errors */&lt;br /&gt;
&lt;br /&gt;
typedef enum ReportType {&lt;br /&gt;
    RPT_DEBUG                   = 0,&lt;br /&gt;
    RPT_INFO                    = 1000,&lt;br /&gt;
    RPT_WARNING                 = 2000,&lt;br /&gt;
    RPT_ERROR                   = 3000,&lt;br /&gt;
    RPT_ERROR_INVALID_INPUT     = 3001,&lt;br /&gt;
    RPT_ERROR_INVALID_CONTEXT   = 3002,&lt;br /&gt;
    RPT_ERROR_OUT_OF_MEMORY     = 3003&lt;br /&gt;
} ReportType;&lt;br /&gt;
&lt;br /&gt;
enum ReportListFlags {&lt;br /&gt;
    RPT_PRINT = 1,&lt;br /&gt;
    RPT_STORE = 2&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct Report {&lt;br /&gt;
    struct Report *next, *prev;&lt;br /&gt;
    ReportType type;&lt;br /&gt;
    char *typestr;&lt;br /&gt;
    char *message;&lt;br /&gt;
} Report;&lt;br /&gt;
&lt;br /&gt;
typedef struct ReportList {&lt;br /&gt;
    ListBase list;&lt;br /&gt;
    ReportType level;&lt;br /&gt;
    int flags;&lt;br /&gt;
} ReportList;&lt;br /&gt;
&lt;br /&gt;
void BKE_report_list_init(ReportList *reports, int flag);&lt;br /&gt;
void BKE_report_list_clear(ReportList *reports);&lt;br /&gt;
&lt;br /&gt;
void BKE_report(ReportList *reports, ReportType type, const char *message);&lt;br /&gt;
void BKE_reportf(ReportList *reports, ReportType type, const char *format, ...);&lt;br /&gt;
&lt;br /&gt;
ReportType BKE_report_level(ReportList *reports);&lt;br /&gt;
void BKE_report_level_set(ReportList *reports, ReportType level);&lt;br /&gt;
&lt;br /&gt;
int BKE_report_has_error(ReportList *reports);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Script]]&lt;br /&gt;
&lt;br /&gt;
==Report Types==&lt;br /&gt;
&lt;br /&gt;
There are four levels of reports: debug information, information for the user, warnings and errors. Debug information is only useful to developers and would be printed when running Blender with the -d option. Information for users is information useful to the user but not critical, for example how many vertices were removed in remove doubles or how much memory was used by rendering-- this should not cause a popup menu to be displayed but can be printed to a console. Warnings are information that something may not have gone as expected by the user. Errors mean that something critical has gone wrong, and the operation that was being executed failed in some important way.&lt;br /&gt;
&lt;br /&gt;
For each level there are also more specific types then, for example an out of memory error may be reported rather than an undefined error.&lt;br /&gt;
&lt;br /&gt;
==Report Lists and Context==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;ReportLists's&amp;lt;/tt&amp;gt; can be passed along to various pieces of code. For example file reading and writing function can take such a list as an argument and then gather warnings and errors. Or modifiers could also report errors in such a list which then could be displayed in the modifier stack. The context has a report list currently; however, it may be better to give operators such a report list rather than context.  Which approach is more convenient and clear needs to be figured out.&lt;br /&gt;
&lt;br /&gt;
When python code calls an operator or other code, it should be able to pass along its own &amp;lt;tt&amp;gt;ReportList&amp;lt;/tt&amp;gt; to gather errors and throw an exception if one is found.&lt;br /&gt;
&lt;br /&gt;
==User Interface==&lt;br /&gt;
&lt;br /&gt;
How such reports are best displayed in the user interface is debatable, as blocking popups, non-blocking messages prominently displayed, or in a console, etc. This document just tries to define a few different levels of reports that should be flexible enough to make different kinds of user interface ideas for such interaction work.&lt;/div&gt;</summary>
		<author><name>wiki&gt;Terrywallwork</name></author>
		
	</entry>
</feed>