Fix T51637: Mesh Tools - Noise Button Crashes.

Logic behind which mtext to use from material was broken here... Though
ultimately that whole tool could probably be deprecated or reworked!
This commit is contained in:
Bastien Montagne 2017-05-27 14:46:14 +02:00
parent 7df5ed14b1
commit 275e2fb0ff

@ -5235,8 +5235,10 @@ static int edbm_noise_exec(bContext *C, wmOperator *op)
else {
BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) {
if (BM_elem_flag_test(eve, BM_ELEM_SELECT)) {
float tin, dum;
externtex(ma->mtex[0], eve->co, &tin, &dum, &dum, &dum, &dum, 0, NULL, false, false);
float tin = 0.0f, dum;
if (ma->mtex[ma->texact] != NULL) {
externtex(ma->mtex[ma->texact], eve->co, &tin, &dum, &dum, &dum, &dum, 0, NULL, false, false);
}
eve->co[2] += fac * tin;
}
}