[Bf-blender-cvs] [b51bd859fd4] master: Fix: wrong rna pointer for material slot

Jacques Lucke noreply at git.blender.org
Thu May 20 12:16:59 CEST 2021


Commit: b51bd859fd4339e10b56c4b4d2d5807891153a12
Author: Jacques Lucke
Date:   Thu May 20 12:14:31 2021 +0200
Branches: master
https://developer.blender.org/rBb51bd859fd4339e10b56c4b4d2d5807891153a12

Fix: wrong rna pointer for material slot

This was missing from rB1a81d268a19f2f1402f408ad1dadf92c7a399607.

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

M	source/blender/editors/space_buttons/buttons_context.c

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

diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c
index 1699e704a4d..aeb2c04656e 100644
--- a/source/blender/editors/space_buttons/buttons_context.c
+++ b/source/blender/editors/space_buttons/buttons_context.c
@@ -975,7 +975,8 @@ int /*eContextResult*/ buttons_context(const bContext *C,
         if (matnr < 0) {
           matnr = 0;
         }
-        CTX_data_pointer_set(result, &ob->id, &RNA_MaterialSlot, &ob->mat[matnr]);
+        /* Keep aligned with rna_Object_material_slots_get. */
+        CTX_data_pointer_set(result, &ob->id, &RNA_MaterialSlot, POINTER_FROM_INT(matnr + 1));
       }
     }



More information about the Bf-blender-cvs mailing list