Cleanup: make functions for setting clone/stencil layer more consistent
This was missing in rBf1beb3b3f60be45854285935d6bfcedf839b317c. Differential Revision: https://developer.blender.org/D14991
This commit is contained in:
parent
af7502dd9b
commit
8e02b0d5d4
|
@ -2599,18 +2599,24 @@ void CustomData_set_layer_render_index(CustomData *data, int type, int n)
|
|||
|
||||
void CustomData_set_layer_clone_index(CustomData *data, int type, int n)
|
||||
{
|
||||
const int layer_index = data->typemap[type];
|
||||
BLI_assert(customdata_typemap_is_valid(data));
|
||||
|
||||
for (int i = 0; i < data->totlayer; i++) {
|
||||
if (data->layers[i].type == type) {
|
||||
data->layers[i].active_clone = n - i;
|
||||
data->layers[i].active_clone = n - layer_index;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CustomData_set_layer_stencil_index(CustomData *data, int type, int n)
|
||||
{
|
||||
const int layer_index = data->typemap[type];
|
||||
BLI_assert(customdata_typemap_is_valid(data));
|
||||
|
||||
for (int i = 0; i < data->totlayer; i++) {
|
||||
if (data->layers[i].type == type) {
|
||||
data->layers[i].active_mask = n - i;
|
||||
data->layers[i].active_mask = n - layer_index;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue