[Bf-blender-cvs] [4b30ee773ce] master: Fix T101316: workbench texture mode not working with geometry nodes

Jacques Lucke noreply at git.blender.org
Thu Oct 20 17:34:56 CEST 2022


Commit: 4b30ee773ce7f5e423830195e49ca06763ba230a
Author: Jacques Lucke
Date:   Thu Oct 20 17:34:22 2022 +0200
Branches: master
https://developer.blender.org/rB4b30ee773ce7f5e423830195e49ca06763ba230a

Fix T101316: workbench texture mode not working with geometry nodes

The `ED_object_get_active_image` is used from the renderer which deals with
evaluated objects. This means the material api for evaluated objects has
to be used.

===================================================================

M	source/blender/editors/uvedit/uvedit_ops.c

===================================================================

diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c
index 5e2d9097abd..b65f4889347 100644
--- a/source/blender/editors/uvedit/uvedit_ops.c
+++ b/source/blender/editors/uvedit/uvedit_ops.c
@@ -37,6 +37,7 @@
 #include "BKE_node.h"
 
 #include "DEG_depsgraph.h"
+#include "DEG_depsgraph_query.h"
 
 #include "ED_image.h"
 #include "ED_mesh.h"
@@ -113,7 +114,8 @@ bool ED_object_get_active_image(Object *ob,
                                 bNode **r_node,
                                 bNodeTree **r_ntree)
 {
-  Material *ma = BKE_object_material_get(ob, mat_nr);
+  Material *ma = DEG_is_evaluated_object(ob) ? BKE_object_material_get_eval(ob, mat_nr) :
+                                               BKE_object_material_get(ob, mat_nr);
   bNodeTree *ntree = (ma && ma->use_nodes) ? ma->nodetree : NULL;
   bNode *node = (ntree) ? nodeGetActiveTexture(ntree) : NULL;



More information about the Bf-blender-cvs mailing list