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:
authorMichael Kowalski <makowalski@nvidia.com>2022-10-06 17:33:43 +0300
committerMichael Kowalski <makowalski@nvidia.com>2022-10-06 17:33:43 +0300
commit8703e17ace01fe2fdac1d8fc8fe3f607a589c0ca (patch)
treea8aad4509ba87ad54202bf0dadffea6504fb651d
parent689e6a1be750b5904fa97ed4208bc0a942827712 (diff)
USD import: fixed compiler warnings.tmp_usd_import_unbound_mtls
Removed unused function and assignment in a conditional expression.
-rw-r--r--source/blender/io/usd/intern/usd_reader_mesh.cc14
-rw-r--r--source/blender/io/usd/intern/usd_reader_stage.cc4
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