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-104401 Add/Clear Reference menu op's #503

Merged
merged 2 commits into from
May 20, 2020

Conversation

fowlertADSK
Copy link
Contributor

Added "Add Reference" and "Clear All References" menu items to the Outliner popup menu for UFE objects. This is just a quick initial implementation, a separate Issue will be logged by Design to cover a more complete/advanced workflow.

string $result[] = `fileDialog2
-fileMode 1
-caption "Add Reference to USD Prim"
-fileFilter "USD Files (*.usd *.usda *.usdc);;*.usd;;*.usda;;*.usdc"`;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's my understanding that .usdz should not be in the list of files that can be referenced, so just adding the other three here..

{}

void undo() override {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not currently providing an Undo for clearing all references.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it because it's technically difficult, or because you're waiting for design to think about it? Perhaps we should add a separate JIRA entry for this one, so that it doesn't fall through the cracks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Bit of both actually. The request here was for something pretty basic, really just enough to get started with testing how the final design should look/work. If I'd seen a really obvious way of dealing with it then I would have added it, but it doesn't look like there is a straight forward get'er for the complete list of references to be stored (and then put back as part of Undo).

SelectUSDFileForAddReference();
)";

const char* clearAllReferencesConfirmScript = R"(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For the file dialog to choose a reference and a confirm box when clearing I'm just adding a quick and dirty MEL script as a string. Design has been thinking about what are final design should look like, but this should be good enough to start iterating with them on it.

@kxl-adsk kxl-adsk added ufe-usd Related to UFE-USD plugin in Maya-Usd workflows Related to in-context workflows labels May 19, 2020
{}

void undo() override {

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it because it's technically difficult, or because you're waiting for design to think about it? Perhaps we should add a separate JIRA entry for this one, so that it doesn't fall through the cracks.

@ppt-adsk
Copy link
Collaborator

Once we get ClearAllReferences undo implemented, it would be good to add an automated test for this code.

Comment on lines 204 to 206
UsdPrim fPrim;
SdfReference fSdfRef;
const std::string fFilePath;
Copy link
Collaborator

Choose a reason for hiding this comment

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

All new code should use coding standard, member variables should have _

@kxl-adsk kxl-adsk merged commit b0a4fd4 into dev May 20, 2020
@kxl-adsk kxl-adsk deleted the fowlert/MAYA-104401/add_references_op branch May 20, 2020 00:19
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.

None yet

4 participants