[Bf-blender-cvs] [f93cd1b8eb0] usd-importer-T81257-merge: USD Import: remove variant selection mask.

makowalski noreply at git.blender.org
Tue Jun 22 04:13:35 CEST 2021


Commit: f93cd1b8eb034a87434c5d5f62a07a20f0a59c69
Author: makowalski
Date:   Mon Jun 21 19:53:08 2021 -0400
Branches: usd-importer-T81257-merge
https://developer.blender.org/rBf93cd1b8eb034a87434c5d5f62a07a20f0a59c69

USD Import: remove variant selection mask.

Removed logic to process variant selection in
Prim Path Mask, as this code needs to be
extended to handle variants specified in child prims.
This functionality can be added back once it's
fully developed.  Also, now printing warning message
if the Prim Path Mask doesn't specify a valid prim.

===================================================================

M	source/blender/io/usd/intern/usd_reader_stage.cc

===================================================================

diff --git a/source/blender/io/usd/intern/usd_reader_stage.cc b/source/blender/io/usd/intern/usd_reader_stage.cc
index 420d6de970a..b7547b612a0 100644
--- a/source/blender/io/usd/intern/usd_reader_stage.cc
+++ b/source/blender/io/usd/intern/usd_reader_stage.cc
@@ -293,18 +293,13 @@ void USDStageReader::collect_readers(Main *bmain,
   std::string prim_path_mask(params.prim_path_mask);
 
   if (!prim_path_mask.empty()) {
-    pxr::SdfPath path = pxr::SdfPath(prim_path_mask);
-    pxr::UsdPrim prim = stage_->GetPrimAtPath(path.StripAllVariantSelections());
+    pxr::UsdPrim prim = stage_->GetPrimAtPath(pxr::SdfPath(prim_path_mask));
     if (prim.IsValid()) {
       root = prim;
-      if (path.ContainsPrimVariantSelection()) {
-        // TODO(makowalski): This will not work properly with setting variants on child prims
-        while (path.ContainsPrimVariantSelection()) {
-          std::pair<std::string, std::string> variantSelection = path.GetVariantSelection();
-          root.GetVariantSet(variantSelection.first).SetVariantSelection(variantSelection.second);
-          path = path.GetParentPath();
-        }
-      }
+    }
+    else {
+      std::cerr << "WARNING: Prim Path Mask " << prim_path_mask
+                << " does not specify a valid prim.\n";
     }
   }



More information about the Bf-blender-cvs mailing list