﻿<?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%3AMont29%2FDev%2FUI_Template_List_Enhancement</id>
	<title>利用者:Mont29/Dev/UI Template List Enhancement - 版の履歴</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%3AMont29%2FDev%2FUI_Template_List_Enhancement"/>
	<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:Mont29/Dev/UI_Template_List_Enhancement&amp;action=history"/>
	<updated>2026-05-19T09:18:59Z</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:Mont29/Dev/UI_Template_List_Enhancement&amp;diff=104019&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:Mont29/Dev/UI_Template_List_Enhancement&amp;diff=104019&amp;oldid=prev"/>
		<updated>2018-06-28T19:42:16Z</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日 (木) 19:42時点における版&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:Mont29/Dev/UI_Template_List_Enhancement&amp;diff=104018&amp;oldid=prev</id>
		<title>2012年12月29日 (土) 18:55にwiki&gt;Mont29による</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:Mont29/Dev/UI_Template_List_Enhancement&amp;diff=104018&amp;oldid=prev"/>
		<updated>2012-12-29T18:55:43Z</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 Template List Enhancement=&lt;br /&gt;
&lt;br /&gt;
{{Warning/Important}} This page is about an old “customization” system, which has now been replaced by a fully pythonic system to define your own lists, pretty much like you define your own menus or panels. Please refer to current ui py code ([code]release/scripts/startup/bl_ui/properties_data_mesh.py[/code] &amp;amp; co) for examples…&lt;br /&gt;
&lt;br /&gt;
==What?==&lt;br /&gt;
[[File:UITemplateListEnhancementPatchEx.png|frame|right|A generic list display of a collection, with custom item controls.]]&lt;br /&gt;
This patch adds an opportunity for generic items in a collection displayed by that template to display custom controls (e.g. check boxes, numfield, etc.). See the picture to the right (note that you could even, if you like, have different controls for each row/item).&lt;br /&gt;
&lt;br /&gt;
==Why?==&lt;br /&gt;
Well, because right now, except for a limited, hard-coded set of collections (e.g. vertex groups, textures/materials slots…), the template list only displays the name of each item in a generic collection, which isn’t so useful… That is especially frustrating when using python-defined collections!&lt;br /&gt;
&lt;br /&gt;
==How?==&lt;br /&gt;
Right now, I implemented that by searching, for each item, in the default case, a given string property (which name is given to the template function). That string is then split on ':', and the resulting strings should correspond to the names of some properties in the template-listed item, that are to be displayed in that row of the list.&lt;br /&gt;
&lt;br /&gt;
To test it, you first need to build your own blender patched with the patch linked [[#Links|below]].&lt;br /&gt;
&lt;br /&gt;
Then, copy/paste the following code in a Blender text block, and execute it as a Python script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import bpy&lt;br /&gt;
from bpy.props import StringProperty, BoolProperty, IntProperty, CollectionProperty&lt;br /&gt;
&lt;br /&gt;
class TestPropertyGroup(bpy.types.PropertyGroup):&lt;br /&gt;
    bool    = BoolProperty(default=False)&lt;br /&gt;
    integer = IntProperty()&lt;br /&gt;
    string  = StringProperty()&lt;br /&gt;
    # A list of identifiers (colon-separated strings) which property’s controls should be displayed&lt;br /&gt;
    # in a template_list.&lt;br /&gt;
    # Note that the order is respected.&lt;br /&gt;
    template_list_controls = StringProperty(default=&amp;quot;integer:string:bool&amp;quot;, options={&amp;quot;HIDDEN&amp;quot;})&lt;br /&gt;
&lt;br /&gt;
bpy.utils.register_class(TestPropertyGroup)&lt;br /&gt;
&lt;br /&gt;
bpy.types.Scene.my_settings = CollectionProperty(type=TestPropertyGroup)&lt;br /&gt;
# Unused, but this is needed for the TemplateList to work…&lt;br /&gt;
bpy.types.Scene.my_settings_idx = IntProperty()&lt;br /&gt;
&lt;br /&gt;
# Add ten default items…&lt;br /&gt;
my_sett = bpy.context.scene.my_settings&lt;br /&gt;
for i in range(10):&lt;br /&gt;
    my_item = my_sett.add()&lt;br /&gt;
    my_item.name = &amp;quot;item {}&amp;quot;.format(i)&lt;br /&gt;
    # Hide one property for odd items.&lt;br /&gt;
    if i % 2:&lt;br /&gt;
        my_item.template_list_controls = &amp;quot;string:bool&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Now, create a panel to show all this!&lt;br /&gt;
class OBJECT_PT_TemplateListTest(bpy.types.Panel):&lt;br /&gt;
    bl_label = &amp;quot;Template List Test Panel&amp;quot;&lt;br /&gt;
    bl_space_type = &amp;quot;PROPERTIES&amp;quot;&lt;br /&gt;
    bl_region_type = &amp;quot;WINDOW&amp;quot;&lt;br /&gt;
    bl_context = &amp;quot;render&amp;quot;&lt;br /&gt;
    def draw(self, context):&lt;br /&gt;
        layout = self.layout&lt;br /&gt;
        layout.template_list(context.scene, &amp;quot;my_settings&amp;quot;, context.scene, &amp;quot;my_settings_idx&amp;quot;,&lt;br /&gt;
                             prop_list=&amp;quot;template_list_controls&amp;quot;, rows=5)&lt;br /&gt;
&lt;br /&gt;
bpy.utils.register_class(OBJECT_PT_TemplateListTest)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This should give you a {{Literal|Template List Test Panel}} in the {{Literal|Buttons}} window, {{Literal|Render}} context, with a list which items have a label, a numeric field (for even items only), a text field and a check box. Note how the order of the identifiers in the &amp;lt;code&amp;gt;template_list_controls&amp;lt;/code&amp;gt; string determines the order of the UI elements…&lt;br /&gt;
&lt;br /&gt;
You can also enable the [[Extensions:2.5/Py/Scripts/Render/Copy Settings|{{Literal|Render: Copy Setting}} addon]], as I coded this patch for this purpose!&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
* tracker: http://projects.blender.org/tracker/index.php?func=detail&amp;amp;aid=26629 &lt;br /&gt;
* patch: http://projects.blender.org/tracker/download.php/9/127/26629/15655/ui_template_list_svn35916.patch&lt;br /&gt;
&lt;br /&gt;
==Change Log==&lt;br /&gt;
===0.0.1===&lt;br /&gt;
Initial release.&lt;br /&gt;
&lt;br /&gt;
===0.0.2===&lt;br /&gt;
As asked by Campbell, made the name of the “control property” customizable – you now just have to pass it as an optional parameter of template_list() bpy func.&lt;br /&gt;
Leave it empty if you want the default behavior !&lt;br /&gt;
&lt;br /&gt;
===0.0.3===&lt;br /&gt;
Now list of properties to display is a simple, colon-separated string, much much easier to handle!&lt;/div&gt;</summary>
		<author><name>wiki&gt;Mont29</name></author>
		
	</entry>
</feed>