Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/paint_canvas.cc
| Show First 20 Lines • Show All 74 Lines • ▼ Show 20 Lines | case PAINT_CANVAS_SOURCE_COLOR_ATTRIBUTE: | ||||
| return -1; | return -1; | ||||
| case PAINT_CANVAS_SOURCE_IMAGE: { | case PAINT_CANVAS_SOURCE_IMAGE: { | ||||
| /* Use active uv map of the object. */ | /* Use active uv map of the object. */ | ||||
| if (ob->type != OB_MESH) { | if (ob->type != OB_MESH) { | ||||
| return -1; | return -1; | ||||
| } | } | ||||
| const Mesh *mesh = static_cast<Mesh *>(ob->data); | const Mesh *mesh = static_cast<Mesh *>(ob->data); | ||||
| return CustomData_get_active_layer_index(&mesh->ldata, CD_MLOOPUV); | return CustomData_get_active_layer_index(&mesh->ldata, CD_PROP_FLOAT2); | ||||
| } | } | ||||
| case PAINT_CANVAS_SOURCE_MATERIAL: { | case PAINT_CANVAS_SOURCE_MATERIAL: { | ||||
| /* Use uv map of the canvas. */ | /* Use uv map of the canvas. */ | ||||
| TexPaintSlot *slot = get_active_slot(ob); | TexPaintSlot *slot = get_active_slot(ob); | ||||
| if (slot == nullptr) { | if (slot == nullptr) { | ||||
| break; | break; | ||||
| } | } | ||||
| if (ob->type != OB_MESH) { | if (ob->type != OB_MESH) { | ||||
| return -1; | return -1; | ||||
| } | } | ||||
| if (slot->uvname == nullptr) { | if (slot->uvname == nullptr) { | ||||
| return -1; | return -1; | ||||
| } | } | ||||
| const Mesh *mesh = static_cast<Mesh *>(ob->data); | const Mesh *mesh = static_cast<Mesh *>(ob->data); | ||||
| return CustomData_get_named_layer_index(&mesh->ldata, CD_MLOOPUV, slot->uvname); | return CustomData_get_named_layer_index(&mesh->ldata, CD_PROP_FLOAT2, slot->uvname); | ||||
| } | } | ||||
| } | } | ||||
| return -1; | return -1; | ||||
| } | } | ||||
| char *BKE_paint_canvas_key_get(struct PaintModeSettings *settings, struct Object *ob) | char *BKE_paint_canvas_key_get(struct PaintModeSettings *settings, struct Object *ob) | ||||
| { | { | ||||
| std::stringstream ss; | std::stringstream ss; | ||||
| Show All 23 Lines | |||||