﻿<?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%2FArchitecture%2FCustom_Element_Data</id>
	<title>Dev:Source/Architecture/Custom Element Data - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=Dev%3ASource%2FArchitecture%2FCustom_Element_Data"/>
	<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:Source/Architecture/Custom_Element_Data&amp;action=history"/>
	<updated>2026-07-21T22:22:35Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=Dev:Source/Architecture/Custom_Element_Data&amp;diff=52540&amp;oldid=prev</id>
		<title>Yamyam: 1版 をインポートしました</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:Source/Architecture/Custom_Element_Data&amp;diff=52540&amp;oldid=prev"/>
		<updated>2018-06-28T17:50:23Z</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:50時点における版&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/Architecture/Custom_Element_Data&amp;diff=52539&amp;oldid=prev</id>
		<title>wiki&gt;DBugSlayer: /* Custom Data in EditMesh */ typo</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:Source/Architecture/Custom_Element_Data&amp;diff=52539&amp;oldid=prev"/>
		<updated>2011-04-13T03:48:10Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Custom Data in EditMesh: &lt;/span&gt; typo&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=Introduction=&lt;br /&gt;
This projects aims to allow adding of custom data to vertices, edges, faces, and&lt;br /&gt;
unify handling of data attached to them, like UV's and colors. This will be first&lt;br /&gt;
implemented for meshes, but should be general enough to also work for lattices,&lt;br /&gt;
NURBS, ..&lt;br /&gt;
&lt;br /&gt;
Below is the code documentation on the current implementation.&lt;br /&gt;
&lt;br /&gt;
[[User:Brecht|Brecht]]&lt;br /&gt;
&lt;br /&gt;
=Custom Element Data=&lt;br /&gt;
&lt;br /&gt;
The CustomData API  provides a generic way to manipulate per-element custom data in meshes. Each unit of custom data is called a layer. Each layer is identified by a type, which has a size and a set of data-handling functions associated with it.&lt;br /&gt;
&lt;br /&gt;
This makes it possible to add new data layers to meshes without making modifications all over the Blender code. Note that this API does not make it possible for external plugins or python scripts to define their own layer types. A special [[Dev:Source/Data System/ID Property|ID Property]] layer type could be implemented for that to work.&lt;br /&gt;
&lt;br /&gt;
The CustomData module was implemented by [[User:Artificer|Ben Batt]] for the [[User:Artificer/ModifierStackUpgrade|Modifier Stack Upgrade]], and later extended by  [[User:Brecht|Brecht Van Lommel]] for use beyond the the modifier stack and DerivedMesh. Much of the content has been taken from the modifier stack upgrade documentation.&lt;br /&gt;
&lt;br /&gt;
==Functionality==&lt;br /&gt;
&lt;br /&gt;
=====Storage=====&lt;br /&gt;
Custom Data may be stored in two ways. The first is in a separate array for each type of layer, which is used in most cases. In edit mode, the data is stored in a memory block per element. The API for the latter type of storage is more limited, as it is used only for one specific case.&lt;br /&gt;
&lt;br /&gt;
=====Adding Layers=====&lt;br /&gt;
When adding a layer, the arrays can be allocated or assigned in different ways:&lt;br /&gt;
* &amp;lt;code&amp;gt;Assign&amp;lt;/code&amp;gt;: assign a given pointer is used.&lt;br /&gt;
* &amp;lt;code&amp;gt;Calloc&amp;lt;/code&amp;gt;: allocate blank memory.&lt;br /&gt;
* &amp;lt;code&amp;gt;Default&amp;lt;/code&amp;gt;: allocate memory and set it to the default value.&lt;br /&gt;
* &amp;lt;code&amp;gt;Reference&amp;lt;/code&amp;gt;: assign a given pointer, but don''t free it.&lt;br /&gt;
* &amp;lt;code&amp;gt;Duplicate&amp;lt;/code&amp;gt;: duplicate the memory of a given pointer.&lt;br /&gt;
&lt;br /&gt;
Besides that there are also a number of flags that can be set:&lt;br /&gt;
* &amp;lt;code&amp;gt;No Copy&amp;lt;/code&amp;gt;: don't copy this layer, e.g. restricting the layers copied in the modifier stack.&lt;br /&gt;
* &amp;lt;code&amp;gt;No Free&amp;lt;/code&amp;gt;: don't free the array of this layer.&lt;br /&gt;
* &amp;lt;code&amp;gt;Temporary&amp;lt;/code&amp;gt;: for derivedmesh, layer is only temporary, and will be freed on derivedmesh release.&lt;br /&gt;
&lt;br /&gt;
=====Copying and Merging=====&lt;br /&gt;
The API provides a way to copy or merge an existing &amp;lt;code&amp;gt;CustomData&amp;lt;/code&amp;gt; struct into another, specifying a different layer size. The new layer data may be allocated with the same options as for adding layers. A mask is also provided that indicates which layer types should be or shouldn't be copied.&lt;br /&gt;
&lt;br /&gt;
=====Editing Custom Data=====&lt;br /&gt;
For array storage reading or writing the contents of a particular layer may be done directly on the array. For reading or writing in edit mode storage, a pointer to the data for an element is returned by the API. There are also functions for copying or interpolating the data from all layers from one collection of layers to another. See the function reference &lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
=====Custom Data in Mesh=====&lt;br /&gt;
The Mesh datablock uses the CustomData API to store all per-element layers, including the vertices, edges and faces themselfs. Adding, freeing, copying, and interpolating layers &amp;lt;i&amp;gt;must&amp;lt;/i&amp;gt; be done through the CustomData API.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
typedef struct Mesh {&lt;br /&gt;
   ...&lt;br /&gt;
    struct MFace *mface;&lt;br /&gt;
    struct MTFace *mtface;&lt;br /&gt;
    struct MVert *mvert;&lt;br /&gt;
    struct MEdge *medge;&lt;br /&gt;
    struct MDeformVert *dvert;&lt;br /&gt;
    struct MCol *mcol;&lt;br /&gt;
    struct MSticky *msticky;&lt;br /&gt;
   ...    &lt;br /&gt;
    struct CustomData vdata, edata, fdata;&lt;br /&gt;
    ...&lt;br /&gt;
} Mesh;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
A &amp;lt;code&amp;gt;CustomData&amp;lt;/code&amp;gt; struct for vertices, edges and faces contains a list of data layers. The Mesh struct contains duplicates of some of the pointers to the data, and these must be kept consistent with the pointers in the &amp;lt;code&amp;gt;CustomData&amp;lt;/code&amp;gt; struct at all times. Using &amp;lt;code&amp;gt;mesh_update_customdata_pointers&amp;lt;/code&amp;gt; these pointers can be updated to point to the data as stored in the &amp;lt;code&amp;gt;CustomData&amp;lt;/code&amp;gt; structs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Mesh_customdata.png|Mesh Custom Data Storage]]&lt;br /&gt;
&lt;br /&gt;
=====Custom Data in DerivedMesh=====&lt;br /&gt;
DerivedMesh also uses the CustomData API. All DerivedMesh backends stores the data associated with vertices, edges and faces in a &amp;lt;code&amp;gt;CustomData&amp;lt;/code&amp;gt; struct, but only the CDDerivedMesh backend stores the vertices, edges and faces themselves there.&lt;br /&gt;
&lt;br /&gt;
=====Custom Data in EditMesh=====&lt;br /&gt;
EditMesh stores its custom data in blocks per &amp;lt;code&amp;gt;EditVert&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;EditEdge&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EditFace&amp;lt;/code&amp;gt;. The special &amp;lt;code&amp;gt;CustomData_em&amp;lt;/code&amp;gt; functions must be used to work with custom data in edit mode.&lt;br /&gt;
&lt;br /&gt;
[[Image:Editmode_customdata.png|EditMesh Custom Data Storage]]&lt;br /&gt;
&lt;br /&gt;
==Internals==&lt;br /&gt;
=====CustomData structure=====&lt;br /&gt;
The CustomData structure stores a collection of custom data layers associated with a mesh element type.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
typedef struct CustomData {&lt;br /&gt;
    CustomDataLayer *layers;  /* CustomDataLayers, ordered by type */&lt;br /&gt;
    int totlayer, maxlayer;   /* number of layers, size of layers array */&lt;br /&gt;
    int totsize, pad;         /* in editmode, total size of all data layers */&lt;br /&gt;
} CustomData;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====CustomDataLayer structure=====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
typedef struct CustomDataLayer {&lt;br /&gt;
    int type;       /* type of data in layer */&lt;br /&gt;
    int offset;     /* in editmode, offset of layer in block */&lt;br /&gt;
    int flag;       /* general purpose flag */&lt;br /&gt;
    int active;     /* number of the active layer of this type */&lt;br /&gt;
    void *data;     /* layer data */&lt;br /&gt;
} CustomDataLayer;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Layer Type Info=====&lt;br /&gt;
The &amp;lt;code&amp;gt;CustomDataLayer.type&amp;lt;/code&amp;gt; field is passed to the &amp;lt;code&amp;gt;layerType_getInfo&amp;lt;/code&amp;gt; function, where it is used as an index into the &amp;lt;code&amp;gt;LAYERTYPEINFO&amp;lt;/code&amp;gt; array (an array of &amp;lt;code&amp;gt;LayerTypeInfo&amp;lt;/code&amp;gt; structures). It can hold any value of any of the defined types, such as &amp;lt;code&amp;gt;CD_MVERT&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;CD_MDEFORMVERT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;CD_MTFACE&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=====LayerTypeInfo structure=====&lt;br /&gt;
The &amp;lt;code&amp;gt;LayerTypeInfo&amp;lt;/code&amp;gt; structure holds information about a layer type, including its size and various functions which are used to access or modify it. The &amp;lt;code&amp;gt;LAYERTYPEINFO&amp;lt;/code&amp;gt; array is a static array of &amp;lt;code&amp;gt;LayerTypeInfo&amp;lt;/code&amp;gt; structures  indexed by type ID and accessed via &amp;lt;code&amp;gt;layerType_getInfo()&amp;lt;/code&amp;gt;. When a new layer type is added, a new entry must be added to this array, giving the size and data manipulation functions (if needed) for the new type.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
typedef struct LayerTypeInfo {&lt;br /&gt;
   int size; /* the memory size of one element of this layer's data */&lt;br /&gt;
&lt;br /&gt;
   /* a function to copy count elements of this layer's data&lt;br /&gt;
    * (deep copy if appropriate)&lt;br /&gt;
    * size should be the size of one element of this layer's data (e.g.&lt;br /&gt;
    * LayerTypeInfo.size)&lt;br /&gt;
    */&lt;br /&gt;
   void (*copy)(const void *source, void *dest, int count, int size);&lt;br /&gt;
&lt;br /&gt;
   /* a function to free any dynamically allocated components of this&lt;br /&gt;
    * layer's data (note the data pointer itself should not be freed)&lt;br /&gt;
    * size should be the size of one element of this layer's data (e.g.&lt;br /&gt;
    * LayerTypeInfo.size)&lt;br /&gt;
    */&lt;br /&gt;
   void (*free)(void *data, int count, int size);&lt;br /&gt;
   &lt;br /&gt;
   /* a function to interpolate between count source elements of this&lt;br /&gt;
    * layer's data and store the result in dest&lt;br /&gt;
    * if weights == NULL or sub_weights == NULL, they should default to 1&lt;br /&gt;
    *&lt;br /&gt;
    * weights gives the weight for each element in sources&lt;br /&gt;
    * sub_weights gives the sub-element weights for each element in sources&lt;br /&gt;
    *    (there should be (sub element count)^2 weights per element)&lt;br /&gt;
    * count gives the number of elements in sources&lt;br /&gt;
    */&lt;br /&gt;
   void (*interp)(void **sources, float *weights, float *sub_weights,&lt;br /&gt;
                  int count, void *dest);&lt;br /&gt;
&lt;br /&gt;
    /* a function to swap the data in corners of the element */&lt;br /&gt;
    void (*swap)(void *data, int *corner_indices);&lt;br /&gt;
&lt;br /&gt;
    /* a function to set a layer's data to default values. if NULL, the&lt;br /&gt;
       default is assumed to be all zeros */&lt;br /&gt;
    void (*set_default)(void *data, int count);&lt;br /&gt;
} LayerTypeInfo;&lt;br /&gt;
&lt;br /&gt;
const LayerTypeInfo LAYERTYPEINFO[LAYERTYPE_NUMTYPES] = {&lt;br /&gt;
   {sizeof(MVert), NULL, NULL, NULL, NULL, NULL},&lt;br /&gt;
   ...&lt;br /&gt;
    {sizeof(MDeformVert), &amp;quot;MDeformVert&amp;quot;, 1, layerCopy_mdeformvert,&lt;br /&gt;
     layerFree_mdeformvert, layerInterp_mdeformvert, NULL, NULL},&lt;br /&gt;
   ...&lt;br /&gt;
    {sizeof(MTFace), &amp;quot;MTFace&amp;quot;, 1, layerCopy_tface, NULL, layerInterp_tface,&lt;br /&gt;
     layerSwap_tface, layerDefault_tface},&lt;br /&gt;
   ...&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
const LayerTypeInfo *layerType_getInfo(int type);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Function Reference==&lt;br /&gt;
These functions provide a generic interface to a custom element data stack.&lt;br /&gt;
&lt;br /&gt;
======void CustomData_copy======&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
 void CustomData_copy(const CustomData *source, CustomData *dest,&lt;br /&gt;
                     CustomDataMask mask, int alloctype, int totelem);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initialises a CustomData object with the same layer setup as source, and totelem elements.&lt;br /&gt;
* Mask is a bitfield where (mask &amp;amp; (1 &amp;lt;&amp;lt; (layer type))) indicates if a layer should be copied or not.&lt;br /&gt;
* Alloctype must be one of the above.&lt;br /&gt;
&lt;br /&gt;
======void CustomData_merge======&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
 void CustomData_merge(const CustomData *source, CustomData *dest,&lt;br /&gt;
                      CustomDataMask mask, int alloctype, int totelem);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Same as the above, except that this will preserve existing layers, and only add the layers that were not there yet.&lt;br /&gt;
&lt;br /&gt;
======void CustomData_free======&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
 void CustomData_free(CustomData *data, int totelem);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Frees data associated with a CustomData object (doesn't free the object itself, though).&lt;br /&gt;
&lt;br /&gt;
======void CustomData_free_temporary======&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
 void CustomData_free_temporary(CustomData *data, int totelem);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Frees all layers with CD_FLAG_TEMPORARY.&lt;br /&gt;
&lt;br /&gt;
======void *CustomData_add_layer======&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
 void *CustomData_add_layer(CustomData *data, int type, int alloctype,&lt;br /&gt;
                           void *layer, int totelem);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a data layer of the given type to the CustomData object, optionally backed by an external data array. The different allocation types are as defined above.&lt;br /&gt;
* Returns the data of the layer.&lt;br /&gt;
* In editmode, use EM_add_data_layer instead of this function.&lt;br /&gt;
&lt;br /&gt;
======int CustomData_free_layer======&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
 int CustomData_free_layer(CustomData *data, int type, int totelem);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Frees the active or first data layer with the give type.&lt;br /&gt;
* Returns 1 on succes, 0 if no layer with the given type is found&lt;br /&gt;
* In editmode, use EM_free_data_layer instead of this function&lt;br /&gt;
&lt;br /&gt;
======void CustomData_free_layers======&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
 void CustomData_free_layers(CustomData *data, int type, int totelem);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Same as above, but free all layers with type.&lt;br /&gt;
&lt;br /&gt;
======int CustomData_has_layer======&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
 int CustomData_has_layer(const CustomData *data, int type);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Returns 1 if a layer with the specified type exists.&lt;br /&gt;
&lt;br /&gt;
======int CustomData_number_of_layers======&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
 int CustomData_number_of_layers(const CustomData *data, int type);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Returns the number of layers with this type.&lt;br /&gt;
&lt;br /&gt;
======void *CustomData_duplicate_referenced_layer======&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
 void *CustomData_duplicate_referenced_layer(CustomData *data, int type);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Duplicate data of a layer with flag CD_FLAG_NOFREE, and remove that flag.&lt;br /&gt;
&lt;br /&gt;
======void CustomData_set_only_copy======&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
 void CustomData_set_only_copy(const CustomData *data,&lt;br /&gt;
                              CustomDataMask mask);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set the CD_FLAG_NOCOPY flag in custom data layers where the mask is zero for the layer type, so only layer types specified by the mask will be copied.&lt;br /&gt;
&lt;br /&gt;
======void CustomData_copy_data======&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
 void CustomData_copy_data(const CustomData *source,&lt;br /&gt;
                          CustomData *dest, int source_index,&lt;br /&gt;
                          int dest_index, int count);&lt;br /&gt;
 void CustomData_em_copy_data(const CustomData *source,&lt;br /&gt;
                            CustomData *dest, void *src_block,&lt;br /&gt;
                            void **dest_block);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copies data from one CustomData object to another objects need not be compatible, each source layer is copied to the first dest layer of correct type (if there is none, the layer is skipped).&lt;br /&gt;
&lt;br /&gt;
======void CustomData_free_elem======&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
 void CustomData_free_elem(CustomData *data, int index, int count);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Frees count data elements on each layer starting at index in a CustomData object.&lt;br /&gt;
&lt;br /&gt;
======void CustomData_interp======&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
 void CustomData_interp(const CustomData *source, CustomData *dest,&lt;br /&gt;
                      int *src_indices, float *weights, float *sub_weights,&lt;br /&gt;
                      int count, int dest_index);&lt;br /&gt;
 void CustomData_em_interp(CustomData *data,  void **src_blocks,&lt;br /&gt;
                          float *weights, float *sub_weights, int count,&lt;br /&gt;
                          void *dest_block);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Interpolates data from one CustomData object to another.&lt;br /&gt;
*The objects need not be compatible, each source layer is interpolated to the first dest layer of the correct type (if there is none, the layer is skipped).&lt;br /&gt;
*If weights == NULL or sub_weights == NULL, they default to all 1's.&lt;br /&gt;
*src_indices gives the source elements to interpolate from.&lt;br /&gt;
*weights gives the weight for each source element.&lt;br /&gt;
*sub_weights is an array of matrices of weights for sub-elements (matrices should be source-&amp;gt;subElems * source-&amp;gt;subElems in size).&lt;br /&gt;
*count gives the number of source elements to interpolate from.&lt;br /&gt;
*dest_index gives the dest element to write the interpolated value to.&lt;br /&gt;
&lt;br /&gt;
======void *CustomData_get======&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
 void *CustomData_get(const CustomData *data, int index, int type);&lt;br /&gt;
 void *CustomData_em_get(const CustomData *data, void *block, int type);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets a pointer to the data element at index from the first or active layer of the specified type.&lt;br /&gt;
*Returns NULL if there is no layer of the specified type.&lt;br /&gt;
&lt;br /&gt;
======void *CustomData_get_layer======&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
 void *CustomData_get_layer(const CustomData *data, int type);&lt;br /&gt;
 void *CustomData_get_layer_n(const CustomData *data, int type, int n);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gets a pointer to the first/active or nth layer of the specified type.&lt;br /&gt;
*Returns NULL if there is no layer of the specified type.&lt;br /&gt;
&lt;br /&gt;
======void CustomData_set======&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
 void CustomData_set(const CustomData *data, int index, int type, void *source);&lt;br /&gt;
 void CustomData_em_set(struct CustomData *data, void *block, int type,&lt;br /&gt;
                       void *source);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copies the data from source to the data element at index in the first layer of the specified type.&lt;br /&gt;
*No effect if there is no layer of the specified type.&lt;br /&gt;
&lt;br /&gt;
======void CustomData_set_layer*======&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
 void *CustomData_set_layer(const CustomData *data, int type, void *ptr);&lt;br /&gt;
 void CustomData_set_layer_active(CustomData *data, int type, int n);&lt;br /&gt;
 void CustomData_set_layer_flag(CustomData *data, int type, int flag);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Set the pointer of to the first layer of type. the old data is not freed.&lt;br /&gt;
* Sets the nth layer of type as active.&lt;br /&gt;
* Adds flag to the layer flags.&lt;br /&gt;
&lt;br /&gt;
======void CustomData_to/from_em_block======&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
 void CustomData_to_em_block(const CustomData *source,&lt;br /&gt;
                            CustomData *dest, int index, void **block);&lt;br /&gt;
 void CustomData_from_em_block(const CustomData *source,&lt;br /&gt;
                              CustomData *dest, void *block, int index);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy to and from editmesh storage.&lt;br /&gt;
&lt;br /&gt;
[[Category:Script]]&lt;/div&gt;</summary>
		<author><name>wiki&gt;DBugSlayer</name></author>
		
	</entry>
</feed>