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

[al] Mark outTime attribute dirty to force updating Maya bbox; fix incorrect time code for bbox #2251

Merged
Merged
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
3 changes: 2 additions & 1 deletion plugin/al/lib/AL_USDMaya/AL/usdmaya/nodes/ProxyShape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1605,6 +1605,7 @@ MStatus ProxyShape::compute(const MPlug& plug, MDataBlock& dataBlock)
m_requestedRedraw = true;
MTime currentTime;
if (plug == outTime()) {
MHWRender::MRenderer::setGeometryDrawDirty(thisMObject());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that you don't call MayaUsdProxyShapeBase and that the implementation of the two compute() methods has drifted relatively far apart.

  • I believe that MayaUsdProxyShapeBase::compute is already doing the right thing by testing if the computed plug is timeAttr, assuming that plug must be computed in order to compute outTimeAttr. Is my understanding correct?
  • What workflow can be tested to verify that the Maya bbox is correctly updated? Can we write an automated test that will catch this?
  • Is there anything in MayaUsdProxyShapeBase::compute that you should copy here? There is some code to support changing which purposes the proxy shape is displaying which could be relevant to you.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@williamkrick , those are good questions, I am pretty sure there must be good reasons to be implemented in that way in the first place, however I don't think I am the right person to give you an answer :-(

return computeOutputTime(plug, dataBlock, currentTime);
} else if (plug == outStageData()) {
MStatus status = computeOutputTime(MPlug(plug.node(), outTime()), dataBlock, currentTime);
Expand Down Expand Up @@ -1734,7 +1735,7 @@ void ProxyShape::CacheEmptyBoundingBox(MBoundingBox& cachedBBox)
//----------------------------------------------------------------------------------------------------------------------
UsdTimeCode ProxyShape::GetOutputTime(MDataBlock dataBlock) const
{
return UsdTimeCode(inputDoubleValue(dataBlock, outTime()));
return MayaUsdProxyShapeBase::GetOutputTime(dataBlock);
}

//----------------------------------------------------------------------------------------------------------------------
Expand Down