﻿<?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%2FModifiers%2FAdding</id>
	<title>Dev:Source/Modifiers/Adding - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=Dev%3ASource%2FModifiers%2FAdding"/>
	<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:Source/Modifiers/Adding&amp;action=history"/>
	<updated>2026-05-14T13:01:03Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=Dev:Source/Modifiers/Adding&amp;diff=114203&amp;oldid=prev</id>
		<title>Yamyam: 1版 をインポートしました</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:Source/Modifiers/Adding&amp;diff=114203&amp;oldid=prev"/>
		<updated>2018-06-28T19:51:40Z</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:51時点における版&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/Modifiers/Adding&amp;diff=114202&amp;oldid=prev</id>
		<title>wiki&gt;Pkrime: added declaration after struct definition in  DNA_modifier_types.h</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:Source/Modifiers/Adding&amp;diff=114202&amp;oldid=prev"/>
		<updated>2013-08-21T09:48:11Z</updated>

		<summary type="html">&lt;p&gt;added declaration after struct definition in  DNA_modifier_types.h&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Notes on Adding a New Modifier =&lt;br /&gt;
== source/blender/makesdna/DNA_modifier_types.h ==&lt;br /&gt;
Add a new modifier name to the &amp;lt;tt&amp;gt;ModifierType&amp;lt;/tt&amp;gt; list, e.g. &amp;lt;tt&amp;gt;eModifierType_FooBar&amp;lt;/tt&amp;gt;. Make sure the new entry comes before &amp;lt;tt&amp;gt;NUM_MODIFIER_TYPES&amp;lt;/tt&amp;gt;, but does not modify the ordinal for any other modifier.&lt;br /&gt;
&lt;br /&gt;
I'm not sure that this is 100% required for every possible modifier, but usually you will want to add a new modifier struct to the end of the file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;C&amp;quot;&amp;gt;&lt;br /&gt;
typedef struct FooBarModifierData {&lt;br /&gt;
    ModifierData modifier;&lt;br /&gt;
    /* modifier-specific data goes here; remember to add pad if necessary! */&lt;br /&gt;
}FooBarModifierData;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is also a good place to declare flag enumerations and the like.&lt;br /&gt;
&lt;br /&gt;
== source/blender/makesrna/RNA_access.h ==&lt;br /&gt;
Add a new &amp;lt;tt&amp;gt;StructRNA&amp;lt;/tt&amp;gt; declaration, e.g. &amp;lt;tt&amp;gt;extern StructRNA RNA_FooBarModifier;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== source/blender/makesrna/intern/rna_modifier.c ==&lt;br /&gt;
Add the new modifier to the &amp;lt;tt&amp;gt;modifier_type_items&amp;lt;/tt&amp;gt; array. There are currently four categories it can go under: Modify, Generate, Deform, and Simulate. Entries within a category should be in alphabetical order.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;C&amp;quot;&amp;gt;&lt;br /&gt;
{eModifierType_FooBar, &amp;quot;FOO_BAR&amp;quot;, ICON_MODIFIER, &amp;quot;Foo Bar&amp;quot;, &amp;quot;&amp;quot;},&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add a RNA define funcion for the new modifier, rna_def_modifier functions  are in alphabetical order.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;C&amp;quot;&amp;gt;&lt;br /&gt;
static void rna_def_modifier_foobar(BlenderRNA *brna)&lt;br /&gt;
{&lt;br /&gt;
	StructRNA *srna;&lt;br /&gt;
	PropertyRNA *prop;&lt;br /&gt;
&lt;br /&gt;
	srna = RNA_def_struct(brna, &amp;quot;FooBarModifier&amp;quot;, &amp;quot;Modifier&amp;quot;);&lt;br /&gt;
	RNA_def_struct_ui_text(srna, &amp;quot;FooBar Modifier&amp;quot;, &amp;quot;It's a foo modifier&amp;quot;);&lt;br /&gt;
	RNA_def_struct_sdna(srna, &amp;quot;FooBarModifierData&amp;quot;);&lt;br /&gt;
	RNA_def_struct_ui_icon(srna, ICON_MODIFIER);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In function &amp;lt;tt&amp;gt;rna_Modifier_refine&amp;lt;/tt&amp;gt;, add a new case for the modifier struct:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;C&amp;quot;&amp;gt;&lt;br /&gt;
    case eModifierType_FooBar:&lt;br /&gt;
        return &amp;amp;RNA_FooBarModifier;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== source/blender/modifiers/MOD_modifiertypes.h ==&lt;br /&gt;
Add a new ModifierTypeInfo declaration, e.g. &amp;lt;tt&amp;gt;extern ModifierTypeInfo modifierType_FooBar;&amp;lt;/tt&amp;gt;&lt;br /&gt;
== source/blender/modifiers/intern/MOD_util.c ==&lt;br /&gt;
Add a new &amp;lt;tt&amp;gt;INIT_TYPE&amp;lt;/tt&amp;gt; line, e.g. &amp;lt;tt&amp;gt;INIT_TYPE(FooBar);&amp;lt;/tt&amp;gt;.&lt;br /&gt;
== source/blender/modifiers/intern/MOD_foobar.c ==&lt;br /&gt;
Add a new source file to contain your modifier's code, e.g. &amp;lt;tt&amp;gt;MOD_foobar.c&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This source file must contain at least the &amp;lt;tt&amp;gt;ModifierTypeInfo&amp;lt;/tt&amp;gt; definition for your modifier:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;C&amp;quot;&amp;gt;&lt;br /&gt;
ModifierTypeInfo modifierType_FooBar = {&lt;br /&gt;
	/* name */              &amp;quot;Foo Bar&amp;quot;,&lt;br /&gt;
	/* structName */        &amp;quot;FooBarModifierData&amp;quot;,&lt;br /&gt;
	/* structSize */        sizeof(FooBarModifierData),&lt;br /&gt;
	/* type */              eModifierTypeType_Constructive,&lt;br /&gt;
	/* flags */             eModifierTypeFlag_AcceptsMesh,&lt;br /&gt;
&lt;br /&gt;
	/* copyData */          NULL,&lt;br /&gt;
	/* deformVerts */       NULL,&lt;br /&gt;
	/* deformMatrices */    NULL,&lt;br /&gt;
	/* deformVertsEM */     NULL,&lt;br /&gt;
	/* deformMatricesEM */  NULL,&lt;br /&gt;
	/* applyModifier */     applyModifier,&lt;br /&gt;
	/* applyModifierEM */   NULL,&lt;br /&gt;
	/* initData */          NULL,&lt;br /&gt;
	/* requiredDataMask */  NULL,&lt;br /&gt;
	/* freeData */          NULL,&lt;br /&gt;
	/* isDisabled */        NULL,&lt;br /&gt;
	/* updateDepgraph */    NULL,&lt;br /&gt;
	/* dependsOnTime */     NULL,&lt;br /&gt;
	/* dependsOnNormals */  NULL,&lt;br /&gt;
	/* foreachObjectLink */ NULL,&lt;br /&gt;
	/* foreachIDLink */     NULL,&lt;br /&gt;
	/* foreachTexLink */    NULL,&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Most of the function pointers can be set to &amp;lt;tt&amp;gt;NULL&amp;lt;/tt&amp;gt; if you don't need it. You probably do want to set the &amp;lt;tt&amp;gt;applyModifier&amp;lt;/tt&amp;gt; function pointer though, in order to output a new &amp;lt;tt&amp;gt;DerivedMesh&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== source/blender/modifiers/CMakeLists.txt ==&lt;br /&gt;
Add the new file to the &amp;lt;tt&amp;gt;SRC&amp;lt;/tt&amp;gt; variable, e.g. &amp;lt;tt&amp;gt;intern/MOD_foobar.c&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== release/scripts/startup/bl_ui/properties_data_modifier.py ==&lt;br /&gt;
Add a new method to the &amp;lt;tt&amp;gt;DATA_PT_modifiers&amp;lt;/tt&amp;gt; class:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
    def FOOBAR(self, layout, ob, md):&lt;br /&gt;
        pass&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>wiki&gt;Pkrime</name></author>
		
	</entry>
</feed>