forked from bartvdbraak/blender
* tablet pressure changing opacity while painting didnt work
* pixels with <= the current opacity are not painted onto, speeds up painting especially with low spacing. (only when airbrush is disabled) * use qsort rather then own crufty sorting function * grouped projection painting functions together.
This commit is contained in:
parent
69298b7b76
commit
4251912b54
@ -964,9 +964,13 @@ static CustomDataLayer *customData_add_layer__internal(CustomData *data,
|
|||||||
if(index > 0 && data->layers[index-1].type == type) {
|
if(index > 0 && data->layers[index-1].type == type) {
|
||||||
data->layers[index].active = data->layers[index-1].active;
|
data->layers[index].active = data->layers[index-1].active;
|
||||||
data->layers[index].active_rnd = data->layers[index-1].active_rnd;
|
data->layers[index].active_rnd = data->layers[index-1].active_rnd;
|
||||||
|
data->layers[index].active_clone = data->layers[index-1].active_clone;
|
||||||
|
data->layers[index].active_mask = data->layers[index-1].active_mask;
|
||||||
} else {
|
} else {
|
||||||
data->layers[index].active = 0;
|
data->layers[index].active = 0;
|
||||||
data->layers[index].active_rnd = 0;
|
data->layers[index].active_rnd = 0;
|
||||||
|
data->layers[index].active_clone = 0;
|
||||||
|
data->layers[index].active_mask = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
customData_update_offsets(data);
|
customData_update_offsets(data);
|
||||||
@ -1026,6 +1030,8 @@ int CustomData_free_layer(CustomData *data, int type, int totelem, int index)
|
|||||||
for (; i < data->totlayer && data->layers[i].type == type; i++) {
|
for (; i < data->totlayer && data->layers[i].type == type; i++) {
|
||||||
data->layers[i].active--;
|
data->layers[i].active--;
|
||||||
data->layers[i].active_rnd--;
|
data->layers[i].active_rnd--;
|
||||||
|
data->layers[i].active_clone--;
|
||||||
|
data->layers[i].active_mask--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -722,10 +722,10 @@ static void delete_customdata_layer(void *data1, void *data2)
|
|||||||
Mesh *me= (Mesh*)data1;
|
Mesh *me= (Mesh*)data1;
|
||||||
CustomData *data= (G.obedit)? &G.editMesh->fdata: &me->fdata;
|
CustomData *data= (G.obedit)? &G.editMesh->fdata: &me->fdata;
|
||||||
CustomDataLayer *layer= (CustomDataLayer*)data2;
|
CustomDataLayer *layer= (CustomDataLayer*)data2;
|
||||||
void *actlayerdata, *rndlayerdata, *layerdata=layer->data;
|
void *actlayerdata, *rndlayerdata, *clonelayerdata, *masklayerdata, *layerdata=layer->data;
|
||||||
int type= layer->type;
|
int type= layer->type;
|
||||||
int index= CustomData_get_layer_index(data, type);
|
int index= CustomData_get_layer_index(data, type);
|
||||||
int i, actindex, rndindex;
|
int i, actindex, rndindex, cloneindex, maskindex;
|
||||||
|
|
||||||
/*ok, deleting a non-active layer needs to preserve the active layer indices.
|
/*ok, deleting a non-active layer needs to preserve the active layer indices.
|
||||||
to do this, we store a pointer to the .data member of both layer and the active layer,
|
to do this, we store a pointer to the .data member of both layer and the active layer,
|
||||||
@ -736,6 +736,8 @@ static void delete_customdata_layer(void *data1, void *data2)
|
|||||||
layer. */
|
layer. */
|
||||||
actlayerdata = data->layers[CustomData_get_active_layer_index(data, type)].data;
|
actlayerdata = data->layers[CustomData_get_active_layer_index(data, type)].data;
|
||||||
rndlayerdata = data->layers[CustomData_get_render_layer_index(data, type)].data;
|
rndlayerdata = data->layers[CustomData_get_render_layer_index(data, type)].data;
|
||||||
|
clonelayerdata = data->layers[CustomData_get_clone_layer_index(data, type)].data;
|
||||||
|
masklayerdata = data->layers[CustomData_get_mask_layer_index(data, type)].data;
|
||||||
CustomData_set_layer_active(data, type, layer - &data->layers[index]);
|
CustomData_set_layer_active(data, type, layer - &data->layers[index]);
|
||||||
|
|
||||||
/* Multires is handled seperately because the display data is separate
|
/* Multires is handled seperately because the display data is separate
|
||||||
@ -787,6 +789,33 @@ static void delete_customdata_layer(void *data1, void *data2)
|
|||||||
CustomData_set_layer_render(data, type, rndindex);
|
CustomData_set_layer_render(data, type, rndindex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (clonelayerdata != layerdata) {
|
||||||
|
/*find index. . .*/
|
||||||
|
cloneindex = CustomData_get_layer_index(data, type);
|
||||||
|
for (i=cloneindex; i<data->totlayer; i++) {
|
||||||
|
if (data->layers[i].data == clonelayerdata) {
|
||||||
|
cloneindex = i - cloneindex;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*set index. . .*/
|
||||||
|
CustomData_set_layer_clone(data, type, cloneindex);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (masklayerdata != layerdata) {
|
||||||
|
/*find index. . .*/
|
||||||
|
maskindex = CustomData_get_layer_index(data, type);
|
||||||
|
for (i=maskindex; i<data->totlayer; i++) {
|
||||||
|
if (data->layers[i].data == masklayerdata) {
|
||||||
|
maskindex = i - maskindex;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*set index. . .*/
|
||||||
|
CustomData_set_layer_mask(data, type, maskindex);
|
||||||
|
}
|
||||||
|
|
||||||
DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA);
|
DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA);
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user