diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/io/usd/intern/usd_reader_mesh.cc | 14 | ||||
-rw-r--r-- | source/blender/io/usd/intern/usd_reader_stage.cc | 4 |
2 files changed, 2 insertions, 16 deletions
diff --git a/source/blender/io/usd/intern/usd_reader_mesh.cc b/source/blender/io/usd/intern/usd_reader_mesh.cc index 3dbdd5d486b..3f7d51e3e76 100644 --- a/source/blender/io/usd/intern/usd_reader_mesh.cc +++ b/source/blender/io/usd/intern/usd_reader_mesh.cc @@ -48,20 +48,6 @@ static const pxr::TfToken normalsPrimvar("normals", pxr::TfToken::Immortal); } // namespace usdtokens namespace utils { -/* Very similar to #blender::io::alembic::utils. */ -static void build_mat_map(const Main *bmain, std::map<std::string, Material *> *r_mat_map) -{ - if (r_mat_map == nullptr) { - return; - } - - Material *material = static_cast<Material *>(bmain->materials.first); - - for (; material; material = static_cast<Material *>(material->id.next)) { - /* We have to do this because the stored material name is coming directly from USD. */ - (*r_mat_map)[pxr::TfMakeValidIdentifier(material->id.name + 2)] = material; - } -} static pxr::UsdShadeMaterial compute_bound_material(const pxr::UsdPrim &prim) { diff --git a/source/blender/io/usd/intern/usd_reader_stage.cc b/source/blender/io/usd/intern/usd_reader_stage.cc index 0533cbbffee..aaa14dad51b 100644 --- a/source/blender/io/usd/intern/usd_reader_stage.cc +++ b/source/blender/io/usd/intern/usd_reader_stage.cc @@ -332,8 +332,8 @@ void USDStageReader::import_all_materials(Main *bmain) } /* Add the material now. */ - if (blend_mtl = mtl_reader.add_material(usd_mtl)) { - + blend_mtl = mtl_reader.add_material(usd_mtl); + if (blend_mtl) { if (params_.mtl_name_collision_mode == USD_MTL_NAME_COLLISION_MAKE_UNIQUE) { /* Record the name of the Blender material we created for the USD material * with the given path, so we don't import the material again if the |