Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAYA-110276 - USD: curves drawing color is the exact same as the maya viewport Gray background #1998

Merged
merged 4 commits into from
Jan 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions lib/mayaUsd/render/vp2RenderDelegate/basisCurves.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -962,10 +962,9 @@ void HdVP2BasisCurves::_UpdateDrawItem(
}
}

// If color/opacity is not found, the 18% gray color will be used
// to match the default color of Hydra Storm.
// If color/opacity is not found, the default color of Maya curves will be used
if (colorArray.empty()) {
colorArray.push_back(GfVec3f(0.18f, 0.18f, 0.18f));
colorArray.push_back(drawScene.GetCurveDefaultColor());
colorInterpolation = HdInterpolationConstant;
}

Expand Down
18 changes: 18 additions & 0 deletions lib/mayaUsd/render/vp2RenderDelegate/proxyRenderDelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1480,6 +1480,24 @@ HdVP2SelectionStatus ProxyRenderDelegate::GetSelectionStatus(const SdfPath& path
//! \brief Query the wireframe color assigned to the proxy shape.
const MColor& ProxyRenderDelegate::GetWireframeColor() const { return _wireframeColor; }

GfVec3f ProxyRenderDelegate::GetCurveDefaultColor()
{
MDoubleArray curveColorResult;
{
std::lock_guard<std::mutex> _(_mayaCommandEngineMutex);
MGlobal::executeCommand(
"int $index = `displayColor -q -dormant \"curve\"`; colorIndex -q $index;",
curveColorResult);
}

if (curveColorResult.length() == 3) {
return GfVec3f(curveColorResult[0], curveColorResult[1], curveColorResult[2]);
} else {
// In case of an error, return the default navy-blue color
return GfVec3f(0.000f, 0.016f, 0.376f);
}
}

//! \brief
const MColor& ProxyRenderDelegate::GetSelectionHighlightColor(bool lead) const
{
Expand Down
5 changes: 5 additions & 0 deletions lib/mayaUsd/render/vp2RenderDelegate/proxyRenderDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ class ProxyRenderDelegate : public MHWRender::MPxSubSceneOverride
MAYAUSD_CORE_PUBLIC
const MColor& GetWireframeColor() const;

MAYAUSD_CORE_PUBLIC
GfVec3f GetCurveDefaultColor();

MAYAUSD_CORE_PUBLIC
const MColor& GetSelectionHighlightColor(bool lead) const;

Expand Down Expand Up @@ -287,6 +290,8 @@ class ProxyRenderDelegate : public MHWRender::MPxSubSceneOverride
#endif
MColor _wireframeColor; //!< Wireframe color assigned to the proxy shape

std::mutex _mayaCommandEngineMutex;

//! A collection of Rprims to prepare render data for specified reprs
std::unique_ptr<HdRprimCollection> _defaultCollection;

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.