From 49620aeb28eeda811dce2abee060610066448ffc Mon Sep 17 00:00:00 2001 From: "ADS\\lanierd" Date: Tue, 17 Sep 2024 11:57:00 +0200 Subject: [PATCH] HYDRA-1043 : Fix Bifrost graphs can't be displayed in Hydra viewport --- lib/mayaHydra/hydraExtensions/mixedUtils.cpp | 4 +++- .../hydraExtensions/sceneIndex/mayaHydraSceneIndex.cpp | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/mayaHydra/hydraExtensions/mixedUtils.cpp b/lib/mayaHydra/hydraExtensions/mixedUtils.cpp index 741eee16c..2832e1ba4 100644 --- a/lib/mayaHydra/hydraExtensions/mixedUtils.cpp +++ b/lib/mayaHydra/hydraExtensions/mixedUtils.cpp @@ -80,7 +80,9 @@ SdfPath DagPathToSdfPath( std::string name = dagPath.fullPathName().asChar(); if ( name.empty() ) { MFnDependencyNode dep(dagPath.node()); - TF_WARN("Empty fullpath name for DAG object : %s of type : %s", dep.name().asChar(), dep.typeName().asChar()); + if (dep.name().length() || dep.typeName().length()){ + TF_WARN("Empty fullpath name for DAG object : %s of type : %s", dep.name().asChar(), dep.typeName().asChar()); + } return SdfPath(); } SanitizeNameForSdfPath(name, stripNamespaces); diff --git a/lib/mayaHydra/hydraExtensions/sceneIndex/mayaHydraSceneIndex.cpp b/lib/mayaHydra/hydraExtensions/sceneIndex/mayaHydraSceneIndex.cpp index 41ae0967c..e6981876e 100644 --- a/lib/mayaHydra/hydraExtensions/sceneIndex/mayaHydraSceneIndex.cpp +++ b/lib/mayaHydra/hydraExtensions/sceneIndex/mayaHydraSceneIndex.cpp @@ -232,8 +232,11 @@ namespace { template<> inline SdfPath maybePrepend( const MRenderItem& ri, const SdfPath& inPath ) { - // Prepend Maya path, for organisation and readability. + // Prepend Maya path, for organization and readability. auto sdfDagPath = DagPathToSdfPath(ri.sourceDagPath(), false, false).MakeRelativePath(SdfPath::AbsoluteRootPath()); + if (sdfDagPath.IsEmpty()){ + return inPath; + } return sdfDagPath.AppendPath(inPath); }