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

Fix bbox computation for purposes, add test. #1170

Merged
merged 2 commits into from
Feb 19, 2021

Conversation

ppt-adsk
Copy link
Collaborator

No description provided.

@@ -75,7 +75,9 @@ Ufe::BBox3d UsdObject3d::boundingBox() const
// as the time.

auto bbox = UsdGeomImageable(fPrim).ComputeUntransformedBound(
getTime(sceneItem()->path()), UsdGeomTokens->default_);
getTime(sceneItem()->path()), UsdGeomTokens->default_,
UsdGeomTokens->guide, UsdGeomTokens->proxy, UsdGeomTokens->render

Choose a reason for hiding this comment

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

On the proxy shape, we have toggles that control what will be rendered. I wonder if we shouldn't be respecting it here because purpose helps you manage complexity and including everything when computing bounding box may be simply too expensive.

@@ -333,6 +334,54 @@ UsdTimeCode getTime(const Ufe::Path& path)
return proxyShape->getTime();
}

TfTokenVector getProxyShapePurposes(const Ufe::Path& path)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy-pasted and adapted from getTime(). Arguably, getTime() itself has duplication from the stage map, and all calls to nameToDagPath() in the existing code base should be examined for performance and centralized. This is out of scope for the current branch.

@@ -30,6 +30,10 @@ def assertVectorAlmostEqual(testCase, a, b, places=7):
for va, vb in zip(a, b):
testCase.assertAlmostEqual(va, vb, places)

def assertVectorNotAlmostEqual(testCase, a, b, places=7):
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thought I would need this, ended up not using it, but left it in, as it's useful.

@kxl-adsk kxl-adsk added the ufe-usd Related to UFE-USD plugin in Maya-Usd label Feb 16, 2021
@ppt-adsk ppt-adsk requested a review from kxl-adsk February 19, 2021 14:05
@ppt-adsk ppt-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Feb 19, 2021
@kxl-adsk kxl-adsk merged commit 21e847e into dev Feb 19, 2021
@kxl-adsk kxl-adsk deleted the tremblp/MAYA-109740/fix_purpose_bbox branch February 19, 2021 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge Development process is finished, PR is ready for merge ufe-usd Related to UFE-USD plugin in Maya-Usd
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants