Repository navigation
Conversation
…Render) In a batch maya session, `displayRGBColor` is unavailable and `colorIndex` returns nothing, so color queries emitted warnings such as: Warning: line 1: displayRGBColor is unavailable in batch mode Warning: Failed to obtain selection highlight color for 'mesh' objects Warning: Failed to obtain display color polymeshDormant. Warning: Failed to obtain default color Skip these queries when maya is not interactive and return the default colors directly, the same ones that were returned on failure.
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The new batch-mode behavior lacks regression coverage.
1 open finding
What changed in this PR
Prevents unsupported Maya display-color queries during non-interactive rendering.
Changes:
- Detects whether Maya is interactive.
- Returns existing fallback colors in batch mode.
| File | Description |
|---|---|
lib/mayaUsd/render/vp2RenderDelegate/proxyRenderDelegate.cpp |
Skips display-color commands outside interactive Maya. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| // warning and `colorIndex` command returns nothing. | ||
| bool _CanQueryDisplayColors() | ||
| { | ||
| static const bool isMayaInteractive = MGlobal::mayaState() == MGlobal::kInteractive; |
| { | ||
| static const GfVec3f kDefaultColor(0.000f, 0.016f, 0.376f); | ||
|
|
||
| if (!_CanQueryDisplayColors()) { |
Collaborator
There was a problem hiding this comment.
the early return also hides the "unsupported class" warnings in batch mode. In GetDefaultColor and GetSelectionHighlightColor, the new check runs before the className dispatch. In batch mode, an unsupported prim type now returns silently instead of reaching this warning:
line 2128
TF_WARN(
"ProxyRenderDelegate::GetDefaultColor - unsupported class: '%s'",
className.IsEmpty() ? "empty" : className.GetString().c_str());
return kDefaultColor;
}
| return className.IsEmpty() ? kDefaultLeadColor : kDefaultActiveColor; | ||
| #else | ||
| if (!_CanQueryDisplayColors()) { | ||
| return className.IsEmpty() ? kDefaultLeadColor : kDefaultActiveColor; |
Collaborator
There was a problem hiding this comment.
Same here, hides warning at line 2267
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

In a batch maya session, the
displayRGBColorcommand is unavailable and thecolorIndexcommand returns nothing, so when usingmaya.cmds.ogsRender, color queries emitted warnings such as:Skip these queries when Maya is not interactive and return the default colors directly, the same ones that were returned on failure.