Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/paint_image_proj.c
| Show First 20 Lines • Show All 5,705 Lines • ▼ Show 20 Lines | if (!is_bi && BKE_scene_use_new_shading_nodes(scene)) { | ||||
| ntreeUpdateTree(CTX_data_main(C), ntree); | ntreeUpdateTree(CTX_data_main(C), ntree); | ||||
| } | } | ||||
| else { | else { | ||||
| MTex *mtex = BKE_texture_mtex_add_id(&ma->id, -1); | MTex *mtex = BKE_texture_mtex_add_id(&ma->id, -1); | ||||
| /* successful creation of mtex layer, now create set */ | /* successful creation of mtex layer, now create set */ | ||||
| if (mtex) { | if (mtex) { | ||||
| int type = MAP_COL; | int type = MAP_COL; | ||||
| int type_id = 0; | char imagename_buff[MAX_ID_NAME - 2]; | ||||
| const char *imagename = DATA_("Diffuse Color"); | |||||
| if (op) { | if (op) { | ||||
| int i; | |||||
| type = RNA_enum_get(op->ptr, "type"); | type = RNA_enum_get(op->ptr, "type"); | ||||
| RNA_string_get(op->ptr, "name", imagename_buff); | |||||
| for (i = 0; i < ARRAY_SIZE(layer_type_items); i++) { | imagename = imagename_buff; | ||||
| if (layer_type_items[i].value == type) { | |||||
| type_id = i; | |||||
| break; | |||||
| } | |||||
| } | |||||
| } | } | ||||
| mtex->tex = BKE_texture_add(bmain, DATA_(layer_type_items[type_id].name)); | mtex->tex = BKE_texture_add(bmain, imagename); | ||||
| mtex->mapto = type; | mtex->mapto = type; | ||||
| if (mtex->tex) { | if (mtex->tex) { | ||||
| ima = mtex->tex->ima = proj_paint_image_create(op, bmain); | ima = mtex->tex->ima = proj_paint_image_create(op, bmain); | ||||
| } | } | ||||
| WM_event_add_notifier(C, NC_TEXTURE | NA_ADDED, mtex->tex); | WM_event_add_notifier(C, NC_TEXTURE | NA_ADDED, mtex->tex); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 211 Lines • Show Last 20 Lines | |||||