Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2022-05-24 16:13:20 +0300
committerJulian Eisel <julian@blender.org>2022-05-24 16:22:18 +0300
commitbc3dbf109c67fe2bced477774abdef7a53d66081 (patch)
tree54500aac1a409cb5f4cce9460b2905150b97de3d /source/blender/editors/object
parent463077a3d59df3de8a8fdc218c06c38116829f3e (diff)
Fix T95706: Material asset not applied if appended and then linked
8f79fa9c6780 was an attempt to fix this already, but it didn't quite work. Problem was that the tooltip was messing with the drop-box and operator properties, setting the name property for its own internal logic. This name property would then be used rather than the session UUID to query the material, which gave the wrong material (linking can result in multiple IDs of the same type with the same name). A followup commit will further sanitize this.
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r--source/blender/editors/object/object_relations.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index 6b1eb84341f..111f3b6bf92 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -2594,9 +2594,7 @@ void OBJECT_OT_make_single_user(wmOperatorType *ot)
/** \name Drop Named Material on Object Operator
* \{ */
-char *ED_object_ot_drop_named_material_tooltip(bContext *C,
- PointerRNA *properties,
- const int mval[2])
+char *ED_object_ot_drop_named_material_tooltip(bContext *C, const char *name, const int mval[2])
{
int mat_slot = 0;
Object *ob = ED_view3d_give_material_slot_under_cursor(C, mval, &mat_slot);
@@ -2605,9 +2603,6 @@ char *ED_object_ot_drop_named_material_tooltip(bContext *C,
}
mat_slot = max_ii(mat_slot, 1);
- char name[MAX_ID_NAME - 2];
- RNA_string_get(properties, "name", name);
-
Material *prev_mat = BKE_object_material_get(ob, mat_slot);
char *result;