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-109190 : Fix camera frame for instance proxies. #1082

Merged
merged 1 commit into from
Jan 15, 2021
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
29 changes: 18 additions & 11 deletions lib/mayaUsd/ufe/UsdTransform3dMayaXformStack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,17 +136,6 @@ createTransform3d(const Ufe::SceneItem::Ptr& item, NextTransform3dFn nextTransfo
}
#endif

// According to USD docs, editing scene description via instance proxies and their properties is
// not allowed.
// https://graphics.pixar.com/usd/docs/api/_usd__page__scenegraph_instancing.html#Usd_ScenegraphInstancing_InstanceProxies
if (usdItem->prim().IsInstanceProxy()) {
MGlobal::displayError(
MString("Authoring to the descendant of an instance [")
+ MString(usdItem->prim().GetName().GetString().c_str()) + MString("] is not allowed. ")
+ MString("Please mark 'instanceable=false' to author edits to instance proxies."));
return nullptr;
}

// If the prim isn't transformable, can't create a Transform3d interface
// for it.
UsdGeomXformable xformSchema(usdItem->prim());
Expand Down Expand Up @@ -744,6 +733,24 @@ Ufe::Transform3d::Ptr UsdTransform3dMayaXformStackHandler::editTransform3d(
#endif
) const
{
// MAYA-109190: Moved the IsInstanceProxy() check here since it was causing the
// camera framing not properly be applied.
//
// HS January 15, 2021: After speaking with Pierre, there is a more robust solution to move this
// check entirely from here.

// According to USD docs, editing scene description via instance proxies and their properties is
// not allowed.
// https://graphics.pixar.com/usd/docs/api/_usd__page__scenegraph_instancing.html#Usd_ScenegraphInstancing_InstanceProxies
UsdSceneItem::Ptr usdItem = std::dynamic_pointer_cast<UsdSceneItem>(item);
if (usdItem->prim().IsInstanceProxy()) {
MGlobal::displayError(
MString("Authoring to the descendant of an instance [")
+ MString(usdItem->prim().GetName().GetString().c_str()) + MString("] is not allowed. ")
+ MString("Please mark 'instanceable=false' to author edits to instance proxies."));
return nullptr;
}

return createTransform3d(item, [&]() {
return _nextHandler->editTransform3d(
item
Expand Down