﻿<?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%2FNamingConvention</id>
	<title>Dev:2.5/Source/Architecture/NamingConvention - 版の履歴</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%2FNamingConvention"/>
	<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:2.5/Source/Architecture/NamingConvention&amp;action=history"/>
	<updated>2026-06-08T06:15:56Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=Dev:2.5/Source/Architecture/NamingConvention&amp;diff=56590&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/NamingConvention&amp;diff=56590&amp;oldid=prev"/>
		<updated>2018-06-28T17:52:37Z</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日 (木) 17:52時点における版&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/NamingConvention&amp;diff=56589&amp;oldid=prev</id>
		<title>wiki&gt;Ideasman42: Better code style docs elsewhere.</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:2.5/Source/Architecture/NamingConvention&amp;diff=56589&amp;oldid=prev"/>
		<updated>2016-02-06T07:43:55Z</updated>

		<summary type="html">&lt;p&gt;Better code style docs elsewhere.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Function name conventions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A function should be named with subject first, then the verb: &lt;br /&gt;
        &amp;lt;prefix&amp;gt;_&amp;lt;what it is&amp;gt;_&amp;lt;what it does&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prefix is the &amp;quot;module&amp;quot;, and can be upper or lower case, if it's&lt;br /&gt;
upper case, means exported outside its own module (the API), with lower&lt;br /&gt;
case it's a local module only, for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
        void WM_screen_activate()&lt;br /&gt;
&lt;br /&gt;
        void wm_check()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If a function is only used inside a C file, it should be made static. It then doesn't have to follow the prefix rule, depending on clarity...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
        static void wm_window_close()&lt;br /&gt;
        static int query_qual()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Struct name conventions ==&lt;br /&gt;
&lt;br /&gt;
The same prefix and order rule can apply to exported struct names, but with the openGL&lt;br /&gt;
convention, to have them clearly distinguished from function names. for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
        struct wmWindowManager {&lt;br /&gt;
        };&lt;br /&gt;
&lt;br /&gt;
        struct uiBlock {&lt;br /&gt;
        };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Structs on global (kernel) level can get a 'b' prefix:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
        struct bContext {&lt;br /&gt;
        };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But that's not enforced really... (see DNA structs)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== #define name conventions ==&lt;br /&gt;
&lt;br /&gt;
Defines are always fully capitalized, and have prefix to show origin:&lt;br /&gt;
&lt;br /&gt;
        WM_NOTE_WINDOW_REDRAW&lt;br /&gt;
&lt;br /&gt;
to prevent prefixes to become confusingly long, special ones are fine too, like for keymap defines:&lt;br /&gt;
&lt;br /&gt;
        KM_ALT&lt;br /&gt;
        KM_PRESS&lt;br /&gt;
&lt;br /&gt;
== Operator definitions ==&lt;br /&gt;
&lt;br /&gt;
For Operator definitions it's important to find out where they are located. Here an extra OT is added in the name, to indicate &amp;quot;Operator Type&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        WM_OT_window_duplicate&lt;br /&gt;
        ED_SCR_OT_cursor_type&lt;br /&gt;
        ED_UI_OT_button_activate&lt;br /&gt;
&lt;br /&gt;
Since these are names saved in operator stacks (macros) it's important to make them nice and future proof.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variables ==&lt;br /&gt;
&lt;br /&gt;
* Variable names are lower case only, also in structs&lt;br /&gt;
* Names are minimal 2 characters, unless it's a counter in a loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Script]]&lt;/div&gt;</summary>
		<author><name>wiki&gt;Ideasman42</name></author>
		
	</entry>
</feed>