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:
authorAras Pranckevicius <aras@nesnausk.org>2022-09-01 20:44:09 +0300
committerAras Pranckevicius <aras@nesnausk.org>2022-09-01 20:44:09 +0300
commit08894ac929cbad25219d107f7877b1300135fb60 (patch)
tree434d98a19022c131730891a3ae8d6c26aa36e2d5 /source/blender/io/wavefront_obj
parent82e3513a8d0fcfb3e7410b88a4ba5683bb45876b (diff)
parentf366d197db24cf611866a8d847b4022a6a46504e (diff)
Merge branch 'blender-v3.3-release'
Diffstat (limited to 'source/blender/io/wavefront_obj')
-rw-r--r--source/blender/io/wavefront_obj/importer/obj_import_mesh.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/io/wavefront_obj/importer/obj_import_mesh.cc b/source/blender/io/wavefront_obj/importer/obj_import_mesh.cc
index 7f7fda8d8f1..40a958919f1 100644
--- a/source/blender/io/wavefront_obj/importer/obj_import_mesh.cc
+++ b/source/blender/io/wavefront_obj/importer/obj_import_mesh.cc
@@ -302,6 +302,8 @@ static Material *get_or_create_material(Main *bmain,
const MTLMaterial &mtl = *materials.lookup_or_add(name, std::make_unique<MTLMaterial>());
Material *mat = BKE_material_add(bmain, name.c_str());
+ id_us_min(&mat->id);
+
ShaderNodetreeWrap mat_wrap{bmain, mtl, mat, relative_paths};
mat->use_nodes = true;
mat->nodetree = mat_wrap.get_nodetree();
@@ -325,6 +327,9 @@ void MeshFromGeometry::create_materials(Main *bmain,
}
BKE_object_material_assign_single_obdata(bmain, obj, mat, obj->totcol + 1);
}
+ if (obj->totcol > 0) {
+ obj->actcol = 1;
+ }
}
void MeshFromGeometry::create_normals(Mesh *mesh)