Fix T80651: Material tab disappears

Always return true if the object can have materials. Even if there are
not currently any materials assigned to the object.
This commit is contained in:
Sebastian Parborg 2020-09-10 14:49:47 +02:00
parent 3679f899fb
commit 0f0e7239f0
Notes: blender-bot 2023-02-14 05:16:25 +01:00
Referenced by issue #80651, Material tab disappears
1 changed files with 3 additions and 4 deletions

View File

@ -333,11 +333,10 @@ static bool buttons_context_path_material(ButsContextPath *path)
if (ob && OB_TYPE_SUPPORT_MATERIAL(ob->type)) {
ma = BKE_object_material_get(ob, ob->actcol);
if (ma == NULL) {
return false;
if (ma != NULL) {
RNA_id_pointer_create(&ma->id, &path->ptr[path->len]);
path->len++;
}
RNA_id_pointer_create(&ma->id, &path->ptr[path->len]);
path->len++;
return true;
}
}