From 25bbfc7a8e976bb7d49e73a35fdad79e70a54311 Mon Sep 17 00:00:00 2001 From: ysiew Date: Tue, 8 Jun 2021 16:31:59 -0700 Subject: [PATCH 1/2] fixed issue where draw overrides were not taken into account when determining visiblity --- lib/mayaUsd/utils/util.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/mayaUsd/utils/util.cpp b/lib/mayaUsd/utils/util.cpp index 913c09c8a0..a29dd331c3 100644 --- a/lib/mayaUsd/utils/util.cpp +++ b/lib/mayaUsd/utils/util.cpp @@ -619,6 +619,18 @@ bool UsdMayaUtil::isRenderable(const MObject& object) } } + MDagPath dagPath; + stat = mFn.getPath(dagPath); + CHECK_MSTATUS_AND_RETURN(stat, false); + if (!dagPath.isVisible()) { + return false; + } + + const MDAGDrawOverrideInfo drawOverrideInfo = dagPath.getDrawOverrideInfo(); + if (drawOverrideInfo.fOverrideEnabled && drawOverrideInfo.fDisplayType == MDAGDrawOverrideInfo::kDisplayTypeTemplate) { + return false; + } + // this shape is renderable return true; } From a1c4ecc1652dc2699b33cd45125bfea8f90f8e85 Mon Sep 17 00:00:00 2001 From: ysiew Date: Fri, 11 Jun 2021 15:39:38 -0700 Subject: [PATCH 2/2] clang-formaty --- lib/mayaUsd/utils/util.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/mayaUsd/utils/util.cpp b/lib/mayaUsd/utils/util.cpp index a29dd331c3..901e785d64 100644 --- a/lib/mayaUsd/utils/util.cpp +++ b/lib/mayaUsd/utils/util.cpp @@ -627,7 +627,8 @@ bool UsdMayaUtil::isRenderable(const MObject& object) } const MDAGDrawOverrideInfo drawOverrideInfo = dagPath.getDrawOverrideInfo(); - if (drawOverrideInfo.fOverrideEnabled && drawOverrideInfo.fDisplayType == MDAGDrawOverrideInfo::kDisplayTypeTemplate) { + if (drawOverrideInfo.fOverrideEnabled + && drawOverrideInfo.fDisplayType == MDAGDrawOverrideInfo::kDisplayTypeTemplate) { return false; }