Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/customdata.cc
| Show First 20 Lines • Show All 3,428 Lines • ▼ Show 20 Lines | int CustomData_get_n_offset(const CustomData *data, int type, int n) | ||||
| int layer_index = CustomData_get_layer_index_n(data, type, n); | int layer_index = CustomData_get_layer_index_n(data, type, n); | ||||
| if (layer_index == -1) { | if (layer_index == -1) { | ||||
| return -1; | return -1; | ||||
| } | } | ||||
| return data->layers[layer_index].offset; | return data->layers[layer_index].offset; | ||||
| } | } | ||||
| bool CustomData_set_layer_name(const CustomData *data, int type, int n, const char *name) | void CustomData_set_layer_name_index(CustomData *data, int index, const char *name) | ||||
| { | |||||
| BLI_strncpy(data->layers[index].name, name, sizeof(data->layers[index].name)); | |||||
| CustomData_set_layer_unique_name(data, index); | |||||
| } | |||||
| bool CustomData_set_layer_name(CustomData *data, int type, int n, const char *name) | |||||
| { | { | ||||
| /* get the layer index of the first layer of type */ | /* get the layer index of the first layer of type */ | ||||
| const int layer_index = CustomData_get_layer_index_n(data, type, n); | const int layer_index = CustomData_get_layer_index_n(data, type, n); | ||||
| if ((layer_index == -1) || !name) { | if ((layer_index == -1) || !name) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| BLI_strncpy(data->layers[layer_index].name, name, sizeof(data->layers[layer_index].name)); | CustomData_set_layer_name_index(data, layer_index,name); | ||||
| return true; | return true; | ||||
| } | } | ||||
| const char *CustomData_get_layer_name(const CustomData *data, int type, int n) | const char *CustomData_get_layer_name(const CustomData *data, int type, int n) | ||||
| { | { | ||||
| const int layer_index = CustomData_get_layer_index_n(data, type, n); | const int layer_index = CustomData_get_layer_index_n(data, type, n); | ||||
| ▲ Show 20 Lines • Show All 1,992 Lines • Show Last 20 Lines | |||||