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

Revise some of the renaming restrictions rules #639

Merged

Conversation

HamedSabri-adsk
Copy link
Contributor

No description provided.

@HamedSabri-adsk HamedSabri-adsk added core Related to core library workflows Related to in-context workflows labels Jul 9, 2020
throw std::runtime_error(err.c_str());
}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

MAYA-105175: Removed renaming restriction around external references.

@@ -30,6 +30,8 @@ class UsdAttribute;
class UsdPrim;
class UsdGeomCamera;
class UsdLuxDistantLight;
class UsdPrimCompositionQuery;
class UsdPrimCompositionQueryArc;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Forward declare UsdPrimCompositionQuery. UsdPrimCompositionQueryArc classes.

They are useful for interrogating of prims for composition arcs.

}
}

return found;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

MAYA-103973: Renaming certain prims crashes Maya

@ppt-adsk The logic here checks to see if a node has really any specs to contribute to the final composite prim. I am not sure 100% if this is the correct way of handling this case but that's the only way I found for now.

Please see my post on usd-interest around this:
https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/usd-interest/vweEUkTr6NY/MTYURcHfAgAJ

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ppt-adsk all existing rename tests cases should pass with this change.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I can't say I have any further experience... Logic sounds reasonable to me.

@HamedSabri-adsk HamedSabri-adsk added ufe-usd Related to UFE-USD plugin in Maya-Usd and removed core Related to core library labels Jul 9, 2020
@HamedSabri-adsk HamedSabri-adsk requested a review from ppt-adsk July 9, 2020 12:48
Copy link
Collaborator

@ppt-adsk ppt-adsk left a comment

Choose a reason for hiding this comment

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

Looks good, as far as I can tell. I would have liked to see a test demonstrating the impact of this fix, i.e. before your fix the test would fail, and after your fix it would pass.

@@ -60,6 +60,14 @@ UsdUndoRenameCommand::UsdUndoRenameCommand(const UsdSceneItem::Ptr& srcItem, con
{
const UsdPrim& prim = _stage->GetPrimAtPath(_ufeSrcItem->prim().GetPath());

// eraly check to see if a particular node has any specs to contribute
Copy link
Collaborator

Choose a reason for hiding this comment

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

"eraly" --> "Early"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks good, as far as I can tell. I would have liked to see a test demonstrating the impact of this fix, i.e. before your fix the test would fail, and after your fix it would pass.

That's me being lazy! Please see 7fafef6

Fyi, The sample usda file comes from Christopher in this issue ticket:
#330

@@ -60,6 +60,14 @@ UsdUndoRenameCommand::UsdUndoRenameCommand(const UsdSceneItem::Ptr& srcItem, con
{
const UsdPrim& prim = _stage->GetPrimAtPath(_ufeSrcItem->prim().GetPath());

// eraly check to see if a particular node has any specs to contribute
// to the final composed prim.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would be good to mention how that can happen (e.g. reference).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

addressed in 7fafef6


UsdPrimCompositionQuery query(prim);

for (const auto& compQuaryArc : query.GetCompositionArcs()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

"compQuaryArc" --> "compQueryArc"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

addressed in 7fafef6

}
}

return found;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I can't say I have any further experience... Logic sounds reasonable to me.

@@ -275,6 +275,7 @@ def testRenameRestrictionOtherLayerOpinions(self):
newName = 'Ball_35_Renamed'
cmds.rename(newName)

@unittest.skip("Restriction around renaming external references has been removed.")
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should remove this test, if it's no longer useful. If we ever need to go back to it, it'll be in git.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

addressed in 7fafef6

@kxl-adsk kxl-adsk merged commit e5b5886 into dev Jul 10, 2020
@kxl-adsk kxl-adsk deleted the sabrih/MAYA-105176/renaming_referenced_prim_crashes_maya branch July 10, 2020 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ufe-usd Related to UFE-USD plugin in Maya-Usd workflows Related to in-context workflows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants