Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/customdata.cc
| Show First 20 Lines • Show All 2,203 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| for (int i = 0; i < data->totlayer; i++) { | for (int i = 0; i < data->totlayer; i++) { | ||||
| CustomDataLayer *layer = &data->layers[i]; | CustomDataLayer *layer = &data->layers[i]; | ||||
| const LayerTypeInfo *typeInfo; | const LayerTypeInfo *typeInfo; | ||||
| if (layer->flag & CD_FLAG_NOFREE) { | if (layer->flag & CD_FLAG_NOFREE) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| typeInfo = layerType_getInfo(layer->type); | typeInfo = layerType_getInfo(layer->type); | ||||
| layer->data = MEM_reallocN(layer->data, (size_t)totelem * typeInfo->size); | /* Use calloc to avoid the need to manually initialize new data in layers. | ||||
| * Useful for types like #MDeformVert which contain a pointer. */ | |||||
| layer->data = MEM_recallocN(layer->data, (size_t)totelem * typeInfo->size); | |||||
| } | } | ||||
| } | } | ||||
| void CustomData_copy(const struct CustomData *source, | void CustomData_copy(const struct CustomData *source, | ||||
| struct CustomData *dest, | struct CustomData *dest, | ||||
| CustomDataMask mask, | CustomDataMask mask, | ||||
| eCDAllocType alloctype, | eCDAllocType alloctype, | ||||
| int totelem) | int totelem) | ||||
| ▲ Show 20 Lines • Show All 3,015 Lines • Show Last 20 Lines | |||||