﻿<?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%3ADoc%2FCode_Style%2FConfiguration</id>
	<title>Dev:Doc/Code Style/Configuration - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=Dev%3ADoc%2FCode_Style%2FConfiguration"/>
	<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:Doc/Code_Style/Configuration&amp;action=history"/>
	<updated>2026-11-04T02:10:28Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=Dev:Doc/Code_Style/Configuration&amp;diff=135855&amp;oldid=prev</id>
		<title>Yamyam: 1版 をインポートしました</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:Doc/Code_Style/Configuration&amp;diff=135855&amp;oldid=prev"/>
		<updated>2018-06-28T20:48:34Z</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日 (木) 20:48時点における版&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:Doc/Code_Style/Configuration&amp;diff=135854&amp;oldid=prev</id>
		<title>wiki&gt;Mont29: /* QtCreator */</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:Doc/Code_Style/Configuration&amp;diff=135854&amp;oldid=prev"/>
		<updated>2018-04-10T08:16:02Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;QtCreator&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Configuring Software to use Blenders Code Style =&lt;br /&gt;
&lt;br /&gt;
This page is to help you quickly setup your development environment to edit Blender&amp;#039;s source, this is more important for some environments then others.&lt;br /&gt;
&lt;br /&gt;
{{Note|Warning|{{Warning/Important}}&lt;br /&gt;
General warning about formatting tools since some of them can be used to automate formatting source code into Blender style &amp;#039;&amp;#039;(or at least a close approximation).&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Tools like this should &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; be applied globally to Blender&amp;#039;s source-code.&lt;br /&gt;
&lt;br /&gt;
Typically the best way to use them is to select smaller blocks of code and format them - making sure they don&amp;#039;t cause any problems.&lt;br /&gt;
&lt;br /&gt;
For &amp;#039;whole-file&amp;#039; formatting utilities - apply to a copy of the source and then manually copy useful changes across with a differencing tool (Meld for example).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== IDE ==&lt;br /&gt;
&lt;br /&gt;
=== Eclipse ===&lt;br /&gt;
&lt;br /&gt;
Tested with 4.3&lt;br /&gt;
&lt;br /&gt;
Eclipse can format code in the menu: Source -&amp;gt; Format (Shift+Ctrl+F)&lt;br /&gt;
&lt;br /&gt;
; Configure C/C++ Code Style&lt;br /&gt;
&lt;br /&gt;
This isn&amp;#039;t essential for developing with eclipse but it can be handy to use sometimes to auto-format.&lt;br /&gt;
&lt;br /&gt;
All options here are available as an XML below.&lt;br /&gt;
&lt;br /&gt;
Open preferences: (Menu) Window -&amp;gt; Preferences&lt;br /&gt;
&lt;br /&gt;
Go to C/C++ -&amp;gt; Code Style, Press New (create based on K&amp;amp;R)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;tableNormal&amp;quot;&amp;gt;&lt;br /&gt;
* Indentation&lt;br /&gt;
** Enable &amp;quot;Statements within &amp;#039;switch body&amp;#039;&amp;quot;&lt;br /&gt;
* Braces (everything should be set to &amp;#039;Same Line&amp;#039;)&lt;br /&gt;
** Set &amp;#039;Function declarations to&amp;#039; to &amp;#039;New Line&amp;#039;&lt;br /&gt;
** Set &amp;#039;Block in Case Statements&amp;#039; to &amp;#039;New Line&amp;#039;&lt;br /&gt;
* White Space&lt;br /&gt;
** Expressions&lt;br /&gt;
*** Initializer list&lt;br /&gt;
**** Disable &amp;#039;After Opening Brace&amp;#039;&lt;br /&gt;
**** Disable &amp;#039;Before Closing Brace&amp;#039;&lt;br /&gt;
*** Type casts&lt;br /&gt;
**** Disable &amp;#039;After Closing perebrgesis&amp;#039;&lt;br /&gt;
* Control Statements&lt;br /&gt;
** Enable &amp;quot;Insert new line before &amp;#039;else&amp;#039; statement&amp;quot;&lt;br /&gt;
** Disable &amp;quot;Keep &amp;#039;then&amp;#039; statements on same line&amp;quot;&lt;br /&gt;
** Disable &amp;quot;Keep &amp;#039;else&amp;#039; statements on same line&amp;quot;&lt;br /&gt;
* Line Wrapping&lt;br /&gt;
** Set &amp;#039;Max line width&amp;#039; to 120&lt;br /&gt;
** Expressions&lt;br /&gt;
*** Initializer list&lt;br /&gt;
**** Set &amp;#039;Line Wrap Policy&amp;#039; to &amp;#039;Wrap all elements, every Element on new line&amp;#039;&lt;br /&gt;
**** Set &amp;#039;Indentation Policy&amp;#039; to Indent by 1.&lt;br /&gt;
* Comments&lt;br /&gt;
** Enable &amp;#039;Preserve white space between code and line comments if possible&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or you can load this into eclipse direct.&lt;br /&gt;
&lt;br /&gt;
[http://wiki.blender.org/uploads/3/35/Blender_Eclipse_4_3_C_CPP_code_style.xml Blender_Eclipse_4_3_C_CPP_code_style.xml]&lt;br /&gt;
&lt;br /&gt;
=== KDevelop ===&lt;br /&gt;
&amp;#039;&amp;#039;Tested with version 4.6&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
In the following menus...&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Settings -&amp;gt; Configure Editor&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&amp;lt;div class=&amp;quot;tableNormal&amp;quot;&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;Appearance&amp;#039;&amp;#039;&lt;br /&gt;
** &amp;#039;&amp;#039;Borders&amp;#039;&amp;#039;&lt;br /&gt;
*** Enable &amp;#039;Show Line Numbers&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;Editing&amp;#039;&amp;#039;&lt;br /&gt;
** &amp;#039;&amp;#039;General&amp;#039;&amp;#039;&lt;br /&gt;
*** Enable &amp;#039;Show static word wrap marker&amp;#039;&lt;br /&gt;
*** Set &amp;#039;Wrap words at&amp;#039; to 120&lt;br /&gt;
** Indentation&lt;br /&gt;
*** Set Indent Using to &amp;#039;Tabulators&amp;#039;&lt;br /&gt;
*** Set &amp;#039;Tab width&amp;#039; to 4&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== MSVC ===&lt;br /&gt;
&amp;#039;&amp;#039;Tested with Microsoft VisualStudio 2008&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
====Basic Setup====&lt;br /&gt;
&lt;br /&gt;
Go to: Tools --&amp;gt; Options&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;tableNormal&amp;quot;&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;Text Editor -&amp;gt; C/C++ -&amp;gt; General&amp;#039;&amp;#039;&lt;br /&gt;
** Activate &amp;#039;Line Numbers&amp;#039; (On by Default)&lt;br /&gt;
* &amp;#039;&amp;#039;Text Editor -&amp;gt; C/C++ -&amp;gt; Tabs&amp;#039;&amp;#039;&lt;br /&gt;
** &amp;#039;Tab Size&amp;#039; Set to 4&lt;br /&gt;
** Activate &amp;#039;Keep Tabs&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Show Guideline as 120 Chars====&lt;br /&gt;
&lt;br /&gt;
This one is a bit hacky in MSVC, since it is NOT supported by default, but can be reached&lt;br /&gt;
easily over the Registry:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;tableNormal&amp;quot;&amp;gt;&lt;br /&gt;
* Close MSVC if opened&lt;br /&gt;
* Open your Registry&lt;br /&gt;
* Navigate to the following key:&lt;br /&gt;
** MSVC 2008: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\Text Editor&lt;br /&gt;
** MSVC 2008 Express: HKEY_CURRENT_USER\Software\Microsoft\VCExpress\9.0\Text Editor&lt;br /&gt;
* Add a String Value called &amp;quot;Guides&amp;quot;&lt;br /&gt;
* Set the Value to: RGB(128,0,0) 120&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now your MSVC shows at 120 chars a red line.&lt;br /&gt;
&lt;br /&gt;
=== Xcode ===&lt;br /&gt;
&amp;quot;Tested with Xcode 4.6.2 (4H1003)&lt;br /&gt;
&lt;br /&gt;
Go to: Xcode --&amp;gt; Preferences&lt;br /&gt;
&lt;br /&gt;
Unfortunately Xcode doesn&amp;#039;t have any &amp;quot;auto code formatting&amp;quot; tool, so it needs to be very carefully in using of code-style.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;tableNormal&amp;quot;&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;Text Editing -&amp;gt; Editing&amp;#039;&amp;#039;&lt;br /&gt;
** &amp;#039;Page guide at column&amp;#039; set to 120&lt;br /&gt;
** &amp;#039;&amp;#039;Automatically trim trailing whitespace&amp;#039;&amp;#039; set checked&lt;br /&gt;
** &amp;#039;&amp;#039;Including whitespace-only lines&amp;#039;&amp;#039; set checked (this prevent &amp;quot;lines with spaces&amp;quot; in code)&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;Text Editing -&amp;gt; Indentation&amp;#039;&amp;#039;&lt;br /&gt;
** &amp;#039;Prefer indent using&amp;#039; set to Tabs&lt;br /&gt;
** &amp;#039;Tab width&amp;#039; set to 4 spaces&lt;br /&gt;
** &amp;#039;Indent width&amp;#039; set to 4 spaces&lt;br /&gt;
** &amp;#039;Tab key&amp;#039; set to &amp;#039;Inserts tab character&amp;#039; &lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== NetBeans ===&lt;br /&gt;
&amp;#039;&amp;#039;Tested with Netbeans 8.0&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Netbeans can format selected code in the menu: Source -&amp;gt; Format (Alt+Shift+F)&lt;br /&gt;
&lt;br /&gt;
Go to: Tools --&amp;gt; Options&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;tableNormal&amp;quot;&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;Editor -&amp;gt; General...&amp;#039;&amp;#039;&lt;br /&gt;
** Disable &amp;#039;Enable Camel Case Navigation&amp;#039; (my personal preference)&lt;br /&gt;
* &amp;#039;&amp;#039;Editor -&amp;gt; Folding...&amp;#039;&amp;#039;&lt;br /&gt;
** Disable &amp;#039;Code Folding&amp;#039; (my personal preference)&lt;br /&gt;
* &amp;#039;&amp;#039;Editor -&amp;gt; Formatting...&amp;#039;&amp;#039;&lt;br /&gt;
** Disable &amp;#039;Extend Tabs to Spaces&lt;br /&gt;
** &amp;#039;Tab Size&amp;#039; Set to 4&lt;br /&gt;
** &amp;#039;Right Margin&amp;#039; Set to 120&lt;br /&gt;
* &amp;#039;&amp;#039;Editor -&amp;gt; Formatting -&amp;gt; C Language...&amp;#039;&amp;#039;&lt;br /&gt;
** Enable &amp;#039;Keep Extra Spaces&amp;#039;&lt;br /&gt;
** Brace Placement, Function Declaration, Set to &amp;#039;New Line&amp;#039;&lt;br /&gt;
** Enable &amp;#039;New Line, &amp;quot;else&amp;quot;&amp;#039;&lt;br /&gt;
** Disable Other Spaces, After Type Cast&lt;br /&gt;
* &amp;#039;&amp;#039;Editor -&amp;gt; Code Completion...&amp;#039;&amp;#039;&lt;br /&gt;
** Enable &amp;#039;Case Sensitive Code Completion&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== QtCreator ===&lt;br /&gt;
&lt;br /&gt;
Tested with QtCreator 2.5.81&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Note: QtCreator has no way to format existing source.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Open the Options dialog &amp;#039;&amp;#039;&amp;#039;Tools -&amp;gt; Options&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;tableNormal&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;#039;&amp;#039;&amp;#039;Text Editor...&amp;#039;&amp;#039;&amp;#039; (main section)&lt;br /&gt;
*&amp;#039;&amp;#039;Behavior...&amp;#039;&amp;#039;&lt;br /&gt;
** Tab Policy (set to &amp;#039;Tabs Only&amp;#039;)&lt;br /&gt;
** Tab size (set to 4)&lt;br /&gt;
** Align continuation lines: (Set to &amp;#039;With Spaces&amp;#039;)&lt;br /&gt;
** Clean whitespace (enable)&lt;br /&gt;
*** &amp;#039;In entire document&amp;#039; (disable) &lt;br /&gt;
*** &amp;#039;Clean indentation&amp;#039; (disable)&lt;br /&gt;
* &amp;#039;&amp;#039;Display&lt;br /&gt;
** Display Right margin at column (Enable and set to 120)&lt;br /&gt;
** Highlight current line (Enable - personal preference)&lt;br /&gt;
** Visualize whitespace (Enable - personal preference)&lt;br /&gt;
&lt;br /&gt;
; &amp;#039;&amp;#039;&amp;#039;C++&amp;#039;&amp;#039;&amp;#039; (main section)&lt;br /&gt;
&amp;#039;&amp;#039;Note this duplicates some options above...&amp;#039;&amp;#039;&lt;br /&gt;
* Code Style&lt;br /&gt;
** &amp;#039;&amp;#039;General...&amp;#039;&amp;#039;&lt;br /&gt;
*** Tab Policy (set to &amp;#039;Tabs Only&amp;#039;)&lt;br /&gt;
*** Tab size (set to 4)&lt;br /&gt;
*** Align continuation lines: (Set to &amp;#039;With Spaces&amp;#039;)&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;quot;switch&amp;quot;, indent within switch -...&amp;#039;&amp;#039;&lt;br /&gt;
*** &amp;quot;case&amp;quot; or &amp;quot;default&amp;quot; (enable)&lt;br /&gt;
** &amp;#039;&amp;#039;Alignment...&amp;#039;&amp;#039;&lt;br /&gt;
*** &amp;quot;Align after assignment&amp;quot; (enable)&lt;br /&gt;
*** &amp;quot;Add extra padding to conditions if they would align to next line&amp;quot; (disable)&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Note, since there are not that many settings - saving an XML to load into QtCtreator isn&amp;#039;t so useful.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
== Editors ==&lt;br /&gt;
&lt;br /&gt;
=== Emacs ===&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=== VIM ===&lt;br /&gt;
&lt;br /&gt;
Example ~/.vimrc&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=vim&amp;gt;&lt;br /&gt;
&amp;quot; --- Extra Visual Info ---&lt;br /&gt;
:syn on                      &amp;quot; Syntax highlighting&lt;br /&gt;
:set spell                   &amp;quot; spell checking (if you like)&lt;br /&gt;
set showmatch                &amp;quot; When a bracket is inserted, briefly jump to a matching one&lt;br /&gt;
set incsearch                &amp;quot; Incremental search&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot; --- Tab settings ---&lt;br /&gt;
set tabstop=4&lt;br /&gt;
set shiftwidth=4&lt;br /&gt;
&amp;quot; Expand tabs for Python coding only (C/C++ in blender uses tabs)&lt;br /&gt;
&amp;quot; set expandtab&lt;br /&gt;
set smarttab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot; ---- indenting ----&lt;br /&gt;
set autoindent &amp;quot; auto indent&lt;br /&gt;
set smartindent &amp;quot; smart indent&lt;br /&gt;
set ci &amp;quot; C/C++ indents&lt;br /&gt;
set cin &amp;quot; -&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot; --- Column/Row Stuff ---&lt;br /&gt;
set cul                      &amp;quot; Highlight the current line&lt;br /&gt;
:set number                  &amp;quot; Show Line Numbers&lt;br /&gt;
:set lines=40 columns=120    &amp;quot; Window Size&lt;br /&gt;
:set colorcolumn=120         &amp;quot; Right Margin&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
set scrolloff=3              &amp;quot; Scroll when cursor gets within 3 characters of top/bottom edge&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot; --- Extra Functionality Helpers ---&lt;br /&gt;
set autochdir                &amp;quot; cd into buffer editing&lt;br /&gt;
&lt;br /&gt;
filetype plugin on&lt;br /&gt;
filetype indent on           &amp;quot; Indent&lt;br /&gt;
&lt;br /&gt;
&amp;quot; auto-complete&lt;br /&gt;
set ofu=syntaxcomplete#Complete&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Formatting Tools ==&lt;br /&gt;
&lt;br /&gt;
=== AStyle ===&lt;br /&gt;
Command line formatter, http://astyle.sourceforge.net/astyle.html&lt;br /&gt;
&lt;br /&gt;
This command is not exact but a close approximation of blenders style guide.&lt;br /&gt;
noticeably, multi-line-if statements are formatted differently.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
astyle --style=stroustrup \&lt;br /&gt;
       --pad-oper \&lt;br /&gt;
       --indent=tab \&lt;br /&gt;
       --indent-switches \&lt;br /&gt;
       --align-pointer=name \&lt;br /&gt;
       --break-closing-brackets \&lt;br /&gt;
       --unpad-paren \&lt;br /&gt;
       --pad-header \&lt;br /&gt;
        --recursive &amp;quot;*.c&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Uncrustify ===&lt;br /&gt;
&lt;br /&gt;
The uncrustify configuration file us now included in [[Dev:Doc/Tools/Blender_Tools_Repo|Blender&amp;#039;s tools repo]]:&lt;br /&gt;
&lt;br /&gt;
Example use:&lt;br /&gt;
&lt;br /&gt;
 uncrustify -c ./source/tools/utils/uncrustify.cfg --no-backup --replace source/blender/blenlib/intern/path_util.c&lt;br /&gt;
&lt;br /&gt;
This shell script runs uncrustify but removes minor whitespace cleanups which significantly reduces noise in the diffs.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;uncrustify_clean.sh&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
 ./source/tools/utils/uncrustify_clean.sh source/blender/blenlib/intern/path_util.c&lt;/div&gt;</summary>
		<author><name>wiki&gt;Mont29</name></author>
		
	</entry>
</feed>