Fix #34978: for cycles, images displayed in the UV editor where coupled to the
active image texture node in the material, now this is removed and the image in the image editor is decoupled and not changed upon entering edit mode. This system caused more confusion then it's worth, changing or removing textures would modify the material but users would often not be aware of this.
This commit is contained in:
parent
d260ccb927
commit
ceb61eb14d
Notes:
blender-bot
2023-02-14 19:45:25 +01:00
Referenced by issue #34978, UV Image Editor overwrites Cycles materials
|
@ -398,16 +398,7 @@ static void image_refresh(const bContext *C, ScrArea *sa)
|
|||
int selected = !(scene->toolsettings->uv_flag & UV_SYNC_SELECTION); /* only selected active face? */
|
||||
|
||||
if (BKE_scene_use_new_shading_nodes(scene)) {
|
||||
/* new shading system, get image from material */
|
||||
BMFace *efa = BM_active_face_get(em->bm, sloppy, selected);
|
||||
|
||||
if (efa) {
|
||||
Image *node_ima;
|
||||
ED_object_get_active_image(obedit, efa->mat_nr + 1, &node_ima, NULL, NULL);
|
||||
|
||||
if (node_ima)
|
||||
sima->image = node_ima;
|
||||
}
|
||||
/* new shading system does not alter image */
|
||||
}
|
||||
else {
|
||||
/* old shading system, we set texface */
|
||||
|
|
|
@ -167,13 +167,12 @@ void ED_object_assign_active_image(Main *bmain, Object *ob, int mat_nr, Image *i
|
|||
|
||||
//#define USE_SWITCH_ASPECT
|
||||
|
||||
void ED_uvedit_assign_image(Main *bmain, Scene *scene, Object *obedit, Image *ima, Image *previma)
|
||||
void ED_uvedit_assign_image(Main *UNUSED(bmain), Scene *scene, Object *obedit, Image *ima, Image *previma)
|
||||
{
|
||||
BMEditMesh *em;
|
||||
BMIter iter;
|
||||
MTexPoly *tf;
|
||||
int update = 0;
|
||||
int sloppy = TRUE;
|
||||
int selected = !(scene->toolsettings->uv_flag & UV_SYNC_SELECTION);
|
||||
|
||||
/* skip assigning these procedural images... */
|
||||
|
@ -190,11 +189,7 @@ void ED_uvedit_assign_image(Main *bmain, Scene *scene, Object *obedit, Image *im
|
|||
}
|
||||
|
||||
if (BKE_scene_use_new_shading_nodes(scene)) {
|
||||
/* new shading system, assign image in material */
|
||||
BMFace *efa = BM_active_face_get(em->bm, sloppy, selected);
|
||||
|
||||
if (efa)
|
||||
ED_object_assign_active_image(bmain, obedit, efa->mat_nr + 1, ima);
|
||||
/* new shading system, do not assign anything */
|
||||
}
|
||||
else {
|
||||
BMFace *efa;
|
||||
|
|
Loading…
Reference in New Issue