﻿<?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%3APhonybone%2FArchive%2FModular_particle_system%2FParticle_properties</id>
	<title>利用者:Phonybone/Archive/Modular particle system/Particle properties - 版の履歴</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%3APhonybone%2FArchive%2FModular_particle_system%2FParticle_properties"/>
	<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:Phonybone/Archive/Modular_particle_system/Particle_properties&amp;action=history"/>
	<updated>2026-07-30T14:18:44Z</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:Phonybone/Archive/Modular_particle_system/Particle_properties&amp;diff=97657&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:Phonybone/Archive/Modular_particle_system/Particle_properties&amp;diff=97657&amp;oldid=prev"/>
		<updated>2018-06-28T19:37:27Z</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:37時点における版&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:Phonybone/Archive/Modular_particle_system/Particle_properties&amp;diff=97656&amp;oldid=prev</id>
		<title>wiki&gt;Phonybone: moved User:Phonybone/Modular particle system/Particle properties to User:Phonybone/Archive/Modular particle system/Particle properties</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:Phonybone/Archive/Modular_particle_system/Particle_properties&amp;diff=97656&amp;oldid=prev"/>
		<updated>2012-10-25T10:58:11Z</updated>

		<summary type="html">&lt;p&gt;moved &lt;a href=&quot;/%E5%88%A9%E7%94%A8%E8%80%85:Phonybone/Modular_particle_system/Particle_properties&quot; class=&quot;mw-redirect&quot; title=&quot;利用者:Phonybone/Modular particle system/Particle properties&quot;&gt;User:Phonybone/Modular particle system/Particle properties&lt;/a&gt; to &lt;a href=&quot;/%E5%88%A9%E7%94%A8%E8%80%85:Phonybone/Archive/Modular_particle_system/Particle_properties&quot; title=&quot;利用者:Phonybone/Archive/Modular particle system/Particle properties&quot;&gt;User:Phonybone/Archive/Modular particle system/Particle properties&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Page/Header|2.5|User:Phonybone/Modular_particle_system/System_vs_Settings|User:Phonybone/Modular_particle_system/Buffer_Management}}&lt;br /&gt;
&lt;br /&gt;
= Particle Properties =&lt;br /&gt;
The data making up each particle should only be allocated when necessary. Some properties like location and velocity are used in almost all modules, but for things like color, temperature, boids information, etc. a custom data registration mechanism must be implemented.&lt;br /&gt;
&lt;br /&gt;
The base ParticleData struct only contains a few variables needed by the generic particle system's &amp;quot;business logic&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
typedef struct ParticleData {&lt;br /&gt;
    float birthtime;&lt;br /&gt;
    ...                  /* TODO what data does the system always need? */&lt;br /&gt;
} ParticleData;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The particle settings store a list of descriptions of the currently available particle properties:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
typedef struct ParticleProperty {&lt;br /&gt;
    char name[32];       /* name of the property used as ID */&lt;br /&gt;
    int size;            /* size in bytes to correctly allocate the buffers */&lt;br /&gt;
    int offset;          /* offset of this property in the buffer */&lt;br /&gt;
} ParticleProperty;&lt;br /&gt;
&lt;br /&gt;
typedef struct ParticleSettings {&lt;br /&gt;
    ...&lt;br /&gt;
    ParticleProperty *properties; /* Array of registered properties */&lt;br /&gt;
    int num_properties;           /* Number of registered properties */&lt;br /&gt;
    int totpropsize;              /* Accumulated size of all properties */&lt;br /&gt;
    ...&lt;br /&gt;
} ParticleSettings;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{WikiTask/Todo|''How can the RNA for particle properties be created? Should they include some runtime type information? Would it be feasible to use a StructRNA at registration to determine the property size, etc. and do checks on this if it already exists?''}}&lt;br /&gt;
&lt;br /&gt;
{{WikiTask/Todo|''In its raw form, this kind of type-less buffer would force the module writers to do pointer arithmetic and explicit casts from &amp;lt;code&amp;gt;void*&amp;lt;/code&amp;gt; to the actual data type of the property all the time, which would easily lead to bugs and corrupt particle buffers. To avoid this, a convenient way of assigning particle data to typed pointers can be implemented. The module would simply store a couple of typed pointer pointers in a list and hand it over to a particle system function, which then assigns the correct address. Make an example!''}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The particle buffer is allocated using the accumulated size of ParticleData + the registered properties:&lt;br /&gt;
&lt;br /&gt;
{{Note|Chunks|For simplicity the following example does not use the [[#Buffer Managment|chunk principle]] yet.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
typedef struct ParticleSystem {&lt;br /&gt;
    ...&lt;br /&gt;
    ParticleSettings *part;  /* Settings pointer */&lt;br /&gt;
    ParticleData *particles; /* Main particle buffer */&lt;br /&gt;
    ...&lt;br /&gt;
} ParticleSystem;&lt;br /&gt;
...&lt;br /&gt;
void psys_allocate_particles(ParticleSystem *psys, int totpart)&lt;br /&gt;
{&lt;br /&gt;
    ...&lt;br /&gt;
    MEM_callocN(psys-&amp;gt;particles, (sizeof(ParticleData) + part-&amp;gt;totpropsize) * totpart);&lt;br /&gt;
    ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Page/Footer|User:Phonybone/Modular_particle_system/System_vs_Settings|User:Phonybone/Modular_particle_system/Buffer_Management}}&lt;/div&gt;</summary>
		<author><name>wiki&gt;Phonybone</name></author>
		
	</entry>
</feed>