﻿<?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%3ASource%2FData_Structures%2FDNAStructs</id>
	<title>Dev:Source/Data Structures/DNAStructs - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=Dev%3ASource%2FData_Structures%2FDNAStructs"/>
	<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:Source/Data_Structures/DNAStructs&amp;action=history"/>
	<updated>2026-06-15T10:35:58Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=Dev:Source/Data_Structures/DNAStructs&amp;diff=42342&amp;oldid=prev</id>
		<title>Yamyam: 1版 をインポートしました</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:Source/Data_Structures/DNAStructs&amp;diff=42342&amp;oldid=prev"/>
		<updated>2018-06-28T17:45:30Z</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:45時点における版&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:Source/Data_Structures/DNAStructs&amp;diff=42341&amp;oldid=prev</id>
		<title>wiki&gt;Venomgfx: veriables &gt; variables</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:Source/Data_Structures/DNAStructs&amp;diff=42341&amp;oldid=prev"/>
		<updated>2012-03-21T06:22:58Z</updated>

		<summary type="html">&lt;p&gt;veriables &amp;gt; variables&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= DNAStructs =&lt;br /&gt;
&lt;br /&gt;
{{Warning/Working/Development| Needs to be merged with [[Dev:Source/Architecture/SDNA_Notes]] }}&lt;br /&gt;
&lt;br /&gt;
The following excerpt functions as basis for DNA Struct documentation.&lt;br /&gt;
&lt;br /&gt;
from &amp;lt;code&amp;gt;source/blender/makesdna/intern/dna_genfile.c&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
(&amp;lt;code&amp;gt;source/blender/blenloader/intern/genfile.c&amp;lt;/code&amp;gt; in pre-blender2.5)&lt;br /&gt;
&lt;br /&gt;
* please note: no builtin security to detect input of double structs&lt;br /&gt;
* if you want a struct not to be in DNA file: add two hash marks above it (#[enter]#[enter]) ''FIXME''&lt;br /&gt;
&lt;br /&gt;
Structure DNA data is added to each blender file and to each executable, this to detect&lt;br /&gt;
in &amp;lt;code&amp;gt;.blend&amp;lt;/code&amp;gt; files new variables in structs, changed array sizes, etc. It's also used for&lt;br /&gt;
converting endian and pointer size (32-64 bits)&lt;br /&gt;
As an extra, Python uses a call to detect run-time the contents of a blender struct.&lt;br /&gt;
&lt;br /&gt;
Create a structDNA: only needed when one of the input include (&amp;lt;code&amp;gt;.h&amp;lt;/code&amp;gt;) files change.&amp;lt;BR/&amp;gt;&lt;br /&gt;
File Syntax:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SDNA (4 bytes) (magic number)&lt;br /&gt;
NAME (4 bytes)&lt;br /&gt;
[nr] (4 bytes) amount of names (int)&lt;br /&gt;
[string]&lt;br /&gt;
[string]&lt;br /&gt;
...&lt;br /&gt;
...&lt;br /&gt;
TYPE (4 bytes)&lt;br /&gt;
[nr] amount of types (int)&lt;br /&gt;
[string]&lt;br /&gt;
[string]&lt;br /&gt;
...&lt;br /&gt;
...&lt;br /&gt;
TLEN (4 bytes)&lt;br /&gt;
[len] (short) the lengths of types&lt;br /&gt;
[len]&lt;br /&gt;
...&lt;br /&gt;
...&lt;br /&gt;
STRC (4 bytes)&lt;br /&gt;
[nr] amount of structs (int)&lt;br /&gt;
[typenr][nr_of_elems] [typenr][namenr] [typenr][namenr] ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Remember to read/write integer and short aligned'''&lt;br /&gt;
&lt;br /&gt;
While writing a file, the names of a struct is indicated with a type number, to be found with:&lt;br /&gt;
: &amp;lt;code&amp;gt;type= findstruct_nr(SDNA ''', char ''')&amp;lt;/code&amp;gt;&lt;br /&gt;
The value of &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; corresponds with the the index within the structs array.&lt;br /&gt;
&lt;br /&gt;
For the moment: the complete DNA file is included in a &amp;lt;code&amp;gt;.blend&amp;lt;/code&amp;gt; file. For the future we can think of smarter methods, like only included the used structs. Only needed to keep a file short though...&lt;br /&gt;
&lt;br /&gt;
'''ALLOWED AND TESTED CHANGES IN STRUCTS:'''&lt;br /&gt;
* Type change (a char to float will be divided by 255).&lt;br /&gt;
* Location within a struct (everthing can be randomly mixed up).&lt;br /&gt;
* Struct within struct (within struct etc), this is recursive.&lt;br /&gt;
* Adding new elements, will be default initialized zero.&lt;br /&gt;
* Removing elements.&lt;br /&gt;
* Change of array sizes.&lt;br /&gt;
* Change of a pointer type: When the name doesn't change the contents is copied.&lt;br /&gt;
&lt;br /&gt;
'''NOT YET:'''&lt;br /&gt;
* array (&amp;lt;code&amp;gt;vec[3]&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;float&amp;lt;/code&amp;gt; struct (&amp;lt;code&amp;gt;vec3f&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
'''DONE:'''&lt;br /&gt;
* Endian compatibility&lt;br /&gt;
* Pointer conversion (32-64 bits)&lt;br /&gt;
&lt;br /&gt;
'''IMPORTANT:'''&lt;br /&gt;
* Do not use &amp;lt;code&amp;gt;#define&amp;lt;/code&amp;gt;s in structs for array lengths, this cannot be read by the dna functions.&lt;br /&gt;
* Do not use &amp;lt;code&amp;gt;#if 0 ... #endif&amp;lt;/code&amp;gt; to remove elements from structs, this cannot be read by the dna functions.&lt;br /&gt;
* Other preprocessor directives may also be unsupported.&lt;br /&gt;
* Typedefs in struct declarations appear to be unsupported.&lt;br /&gt;
* Do not use &amp;lt;code&amp;gt;uint&amp;lt;/code&amp;gt;, but &amp;lt;code&amp;gt;unsigned int&amp;lt;/code&amp;gt; instead, &amp;lt;code&amp;gt;ushort&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ulong&amp;lt;/code&amp;gt; are allowed.&lt;br /&gt;
* Only use a &amp;lt;code&amp;gt;long&amp;lt;/code&amp;gt; in Blender if you want this to be the size of a pointer. So it is 32 bits or 64 bits, dependant at the CPU architecture.&lt;br /&gt;
* &amp;lt;code&amp;gt;chars&amp;lt;/code&amp;gt; are always unsigned.&lt;br /&gt;
* When storing pointers, always put the * next to the variable and not the type (i.e. void *x, not void* x). If you do, you will get a message that makesdna couldn't find whatever structure you did that in.&lt;br /&gt;
* Aligment of variables has to be done in such a way, that any system does not create 'padding' (gaps) in structures. So make sure that:&lt;br /&gt;
** short: 2 aligned&lt;br /&gt;
** int: 4 aligned&lt;br /&gt;
** float: 4 aligned&lt;br /&gt;
** double: 8 aligned&lt;br /&gt;
** long: 8 aligned&lt;br /&gt;
** struct: 8 aligned&lt;br /&gt;
* The &amp;lt;code&amp;gt;sdna&amp;lt;/code&amp;gt; functions have several error prints builtin, always check Blender running from a console.&lt;br /&gt;
&lt;br /&gt;
-- [[User:JesterKing|NathanLetwory]] - 21 May 2004&lt;/div&gt;</summary>
		<author><name>wiki&gt;Venomgfx</name></author>
		
	</entry>
</feed>