﻿<?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%3APy%2FScripts%2FGuidelines%2FLayouts</id>
	<title>Dev:Py/Scripts/Guidelines/Layouts - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=Dev%3APy%2FScripts%2FGuidelines%2FLayouts"/>
	<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:Py/Scripts/Guidelines/Layouts&amp;action=history"/>
	<updated>2026-06-02T12:21:41Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=Dev:Py/Scripts/Guidelines/Layouts&amp;diff=89429&amp;oldid=prev</id>
		<title>Yamyam: 1版 をインポートしました</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:Py/Scripts/Guidelines/Layouts&amp;diff=89429&amp;oldid=prev"/>
		<updated>2018-06-28T18:42:35Z</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: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=Dev:Py/Scripts/Guidelines/Layouts&amp;diff=89428&amp;oldid=prev</id>
		<title>wiki&gt;Brecht: moved Dev:2.5/Py/Scripts/Guidelines/Layouts to Dev:Py/Scripts/Guidelines/Layouts: remove version namespace</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:Py/Scripts/Guidelines/Layouts&amp;diff=89428&amp;oldid=prev"/>
		<updated>2015-12-27T19:24:36Z</updated>

		<summary type="html">&lt;p&gt;moved &lt;a href=&quot;/Dev:2.5/Py/Scripts/Guidelines/Layouts&quot; class=&quot;mw-redirect&quot; title=&quot;Dev:2.5/Py/Scripts/Guidelines/Layouts&quot;&gt;Dev:2.5/Py/Scripts/Guidelines/Layouts&lt;/a&gt; to &lt;a href=&quot;/Dev:Py/Scripts/Guidelines/Layouts&quot; title=&quot;Dev:Py/Scripts/Guidelines/Layouts&quot;&gt;Dev:Py/Scripts/Guidelines/Layouts&lt;/a&gt;: remove version namespace&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Why Code Guidelines? ==&lt;br /&gt;
&lt;br /&gt;
- Layout files are new in 2.5x, so it's the right time to write and keep them clean.&lt;br /&gt;
&lt;br /&gt;
- Modifying the layout is also interesting for artists. Keep the code as readable as possible is important for them.&lt;br /&gt;
Also coders who don't work on these files should be able to learn the code as fast as possible.&lt;br /&gt;
&lt;br /&gt;
== Which scripts? ==&lt;br /&gt;
These guidelines are for every official python script which use buttons inside of blenders interface. So, all button files inside of release/ui. And other scripts (for Render integration...like Povray in release/io) which are bundled with Blender.&lt;br /&gt;
&lt;br /&gt;
== Assignments ==&lt;br /&gt;
Keep assignement names consistent:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;quot;row&amp;quot; for a row layout&lt;br /&gt;
&amp;quot;col&amp;quot; for a column layout&lt;br /&gt;
&amp;quot;flow&amp;quot; for a column_flow layout. &lt;br /&gt;
&lt;br /&gt;
Please also use these names for split layouts. For example col = split.column().&lt;br /&gt;
&lt;br /&gt;
Use &amp;quot;sub&amp;quot; for sublayouts, &lt;br /&gt;
and if you need more subsub etc. &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example Code ==&lt;br /&gt;
&lt;br /&gt;
Some examples how it should look.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== The Basic Code of each panel ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
class MATERIAL_PT_material(MaterialButtonsPanel):&lt;br /&gt;
	bl_label = &amp;quot;Shading&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	def draw(self, context):&lt;br /&gt;
		layout = self.layout &lt;br /&gt;
&lt;br /&gt;
		mat = context.material&lt;br /&gt;
		ob = context.object&lt;br /&gt;
		slot = context.material_slot&lt;br /&gt;
		space = context.space_data&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First define the layout.&lt;br /&gt;
&lt;br /&gt;
Empty line.&lt;br /&gt;
&lt;br /&gt;
Define all context you need for the panel. Use short and easy assignement names.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Layout Split Code ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
		split = layout.split()&lt;br /&gt;
	&lt;br /&gt;
		col = split.column()&lt;br /&gt;
		col.prop(mat, &amp;quot;alpha&amp;quot;, slider=True)&lt;br /&gt;
		col.prop(mat, &amp;quot;ambient&amp;quot;, slider=True)&lt;br /&gt;
		col.prop(mat, &amp;quot;emit&amp;quot;)&lt;br /&gt;
		col.prop(mat, &amp;quot;translucency&amp;quot;, slider=True)&lt;br /&gt;
				&lt;br /&gt;
		col = split.column()&lt;br /&gt;
		col.prop(mat, &amp;quot;z_transparency&amp;quot;)&lt;br /&gt;
		col.prop(mat, &amp;quot;shadeless&amp;quot;)	&lt;br /&gt;
		col.prop(mat, &amp;quot;tangent_shading&amp;quot;)&lt;br /&gt;
		col.prop(mat, &amp;quot;cubic&amp;quot;, slider=True)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you need a sublayout because of align, greying out or something else,&lt;br /&gt;
use sub as assignement name:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
                sub = col.column(align=True)&lt;br /&gt;
                sub.prop(mat, &amp;quot;bla&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First define the split.&lt;br /&gt;
&lt;br /&gt;
Empty line.&lt;br /&gt;
&lt;br /&gt;
Now pack every column in 1 block, this improves the readability.&lt;br /&gt;
Sub layout blocks can be separated as well if this improves the readability. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Greying out ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#For greying out first define the active/enabled condition, then put the buttons there:&lt;br /&gt;
&lt;br /&gt;
#Right:&lt;br /&gt;
sub = col.column()&lt;br /&gt;
sub.active = tex.distance_metric == 'MINKOVSKY'&lt;br /&gt;
sub.prop(tex, &amp;quot;minkovsky_exponent&amp;quot;, text=&amp;quot;Exponent&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
#Wrong:&lt;br /&gt;
sub = col.column()&lt;br /&gt;
sub.prop(tex, &amp;quot;minkovsky_exponent&amp;quot;, text=&amp;quot;Exponent&amp;quot;)&lt;br /&gt;
sub.active = tex.distance_metric == 'MINKOVSKY'&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Script]]&lt;/div&gt;</summary>
		<author><name>wiki&gt;Brecht</name></author>
		
	</entry>
</feed>