﻿<?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=%E5%88%A9%E7%94%A8%E8%80%85%3ABrita%2FProposals%2FUIPreviews</id>
	<title>利用者:Brita/Proposals/UIPreviews - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=%E5%88%A9%E7%94%A8%E8%80%85%3ABrita%2FProposals%2FUIPreviews"/>
	<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:Brita/Proposals/UIPreviews&amp;action=history"/>
	<updated>2026-04-30T01:40:49Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:Brita/Proposals/UIPreviews&amp;diff=149681&amp;oldid=prev</id>
		<title>Yamyam: 1版 をインポートしました</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:Brita/Proposals/UIPreviews&amp;diff=149681&amp;oldid=prev"/>
		<updated>2018-06-28T21:13:54Z</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日 (木) 21:13時点における版&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=%E5%88%A9%E7%94%A8%E8%80%85:Brita/Proposals/UIPreviews&amp;diff=149680&amp;oldid=prev</id>
		<title>2017年3月20日 (月) 18:03にwiki&gt;Britaによる</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:Brita/Proposals/UIPreviews&amp;diff=149680&amp;oldid=prev"/>
		<updated>2017-03-20T18:03:37Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=UI Previews - Proposal=&lt;br /&gt;
&lt;br /&gt;
UI previews is an addition to the blender python API that allows requesting of image previews from files and the displaying of said previews in the UI as custom icons.&lt;br /&gt;
&lt;br /&gt;
It is now possible to load single image or a set of previews for use in the UI with the existing widgets. It is not possible to override the default icons or share icons between addons.&lt;br /&gt;
&lt;br /&gt;
Displaying previews in Blender's UI and requesting those previews is a stepping stone for the asset-experiments and engine projects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==UI Examples==&lt;br /&gt;
A preview can be used as a custom icon in any place an icon can be used.&lt;br /&gt;
Examples:&lt;br /&gt;
[[File:Rl-ui_previews_button.png|thumb|left|button with label]]&lt;br /&gt;
[[File:Rl-ui_previews_button_no_label.png|thumb|left|no label]]&lt;br /&gt;
[[File:Rl-ui_previews_menu_item.png|thumb|left|menu item]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sample UI script:&lt;br /&gt;
[https://developer.blender.org/diffusion/B/browse/master/release/scripts/templates_py/ui_previews_custom_icon.py scripts/templates_py/ui_previews_custom_icon.py]&lt;br /&gt;
&lt;br /&gt;
Furthermore, an EnumProperty with custom icons can be built and displayed in the appropriate templates.&lt;br /&gt;
Examples:&lt;br /&gt;
[[File:Rl-ui_previews_prop.png|thumb|left|164px|prop]]&lt;br /&gt;
[[File:Rl-ui_previews_iconview.png|thumb|left|546px|template_icon_view]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sample UI script:&lt;br /&gt;
[https://developer.blender.org/diffusion/B/browse/master/release/scripts/templates_py/ui_previews_dynamic_enum.py scripts/templates_py/ui_previews_dynamic_enum.py]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Use Cases==&lt;br /&gt;
&lt;br /&gt;
* custom icon for buttons or menu items representing:&lt;br /&gt;
** an action not available in Blender's default icons&lt;br /&gt;
&amp;lt;!--** custom branding of a 3rd party (eg. external render engine logo)--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* set of file previews for picking image, movie, font and blend files integrated in the UI&lt;br /&gt;
* set of previews representing presets or that otherwise illustrate the results of a choice&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The big picture==&lt;br /&gt;
* This system allows thumbnail images to be used in the UI, as preview image or as an icon.&lt;br /&gt;
* These preview images are in a dynamic cache, which can be deleted or refreshed at any time. &lt;br /&gt;
* For that reason addons or UI scripts that rely on the feature have to carefully manage this, to not overload Blender with preview loading time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Design specs - if you want to use this in a release==&lt;br /&gt;
&lt;br /&gt;
* Do not use this for advertising, logos or other non-functional use cases.&lt;br /&gt;
* Use a minimum of custom icons. This helps uncluttering the interface and keeping Blender's interface uniform.&lt;br /&gt;
* Only use these images in a way that is compatible with how rest of Blender works - as if it's a default interface we provide for everyone.&lt;br /&gt;
* Only use the feature within the context and UI of your own Add-on. You cannot rely on other add-ons to have this already preloaded. This feature also does not allow replacing of the default icons.&lt;br /&gt;
* Do not force preview image creation outside of the add-on dir, except when explicitly asked for by the user in the UI.&lt;br /&gt;
* Use the previews via &amp;quot;lazy loading&amp;quot; - create on first use, not on start of Blender.&lt;br /&gt;
* The default icon size in Blender is 32x32 and for previews 256x256. Your images will be scaled to fit these sizes on their maximum side.&lt;br /&gt;
&lt;br /&gt;
==How things work internally==&lt;br /&gt;
* previews of files can be requested via python&lt;br /&gt;
* Blender generates a PreviewImage and populates the image data using the existing thumbnailing capacities ('IMAGE', 'MOVIE', 'BLEND', 'FONT')&lt;br /&gt;
&lt;br /&gt;
* the PreviewImage is used as a source for BKE_icon by being placed in the 'obj' field of Icon&lt;br /&gt;
* PreviewImages have an icon_id which can be used in UI functions as the icon_value&lt;br /&gt;
&lt;br /&gt;
* if a preview is requested from a file already thumbnailed, the cache is used if possible&lt;br /&gt;
* previews are accessed in python through 'preview collections': dict like wrappers that hold previews and are extendable&lt;br /&gt;
* previews are internally stored in a GHash 'gCachedPreviews' using the collection and filename as hash value&lt;br /&gt;
* if an already existing preview is requested (same collection+filename) it is simply retrieved, having however the option to force reload&lt;br /&gt;
* previews are freed when the collection they belong to is deleted&lt;br /&gt;
* addons should delete collections they create in unregister()&lt;br /&gt;
* addons can also free their previews on pre/post loading blend files&lt;br /&gt;
* preview collections are created and deleted via bpy.utils.previews&lt;br /&gt;
&lt;br /&gt;
* PreviewImages are not IDs, they are generated and never saved with blend files&lt;/div&gt;</summary>
		<author><name>wiki&gt;Brita</name></author>
		
	</entry>
</feed>