Changeset View
Changeset View
Standalone View
Standalone View
source/blender/modifiers/intern/MOD_uvproject.c
| Show First 20 Lines • Show All 129 Lines • ▼ Show 20 Lines | if (umd->projectors[i] != NULL) { | ||||
| projectors[num_projectors++].ob = umd->projectors[i]; | projectors[num_projectors++].ob = umd->projectors[i]; | ||||
| } | } | ||||
| } | } | ||||
| if (num_projectors == 0) { | if (num_projectors == 0) { | ||||
| return mesh; | return mesh; | ||||
| } | } | ||||
| /* make sure there are UV Maps available */ | /* Create a new layer if no UV Maps are available (e.g. if a preceeding modifier could not | ||||
| * preserve it). */ | |||||
| if (!CustomData_has_layer(&mesh->ldata, CD_MLOOPUV)) { | if (!CustomData_has_layer(&mesh->ldata, CD_MLOOPUV)) { | ||||
| return mesh; | CustomData_add_layer_named( | ||||
| &mesh->ldata, CD_MLOOPUV, CD_DEFAULT, NULL, mesh->totloop, umd->uvlayer_name); | |||||
| } | } | ||||
| /* make sure we're using an existing layer */ | /* make sure we're using an existing layer */ | ||||
| CustomData_validate_layer_name(&mesh->ldata, CD_MLOOPUV, umd->uvlayer_name, uvname); | CustomData_validate_layer_name(&mesh->ldata, CD_MLOOPUV, umd->uvlayer_name, uvname); | ||||
| /* calculate a projection matrix and normal for each projector */ | /* calculate a projection matrix and normal for each projector */ | ||||
| for (i = 0; i < num_projectors; i++) { | for (i = 0; i < num_projectors; i++) { | ||||
| float tmpmat[4][4]; | float tmpmat[4][4]; | ||||
| ▲ Show 20 Lines • Show All 240 Lines • Show Last 20 Lines | |||||