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-104134 Add .usdz extension to the identifyFile function #396

Merged
merged 2 commits into from
Apr 2, 2020

Conversation

fowlertADSK
Copy link
Contributor

Add .usdz extension to the identifyFile function, which is used to determine if it is a supported file when doing a drag'n drop onto Maya.

…s used to determine if it is a supported file when doing a drag'n drop onto Maya.
@fowlertADSK
Copy link
Contributor Author

I enabled .usdz import here: #313
That worked fine when using the file dialog because .usdz was made part of the file filter.

When a user drops a .usdz file on top of Maya to import it, Maya will call all the translators to see if they identify the file as something they understand. This function was still parsing the file string to get the extension and then comparing against .usd/.usda/.usdc and not .usdz.

The pxr plugin has this exact code so it will also not import a .usdz when you try to drop it on Maya either. I can add the exact same line there, or we can leave it as a mayaUSD only thing if we want.

@ppt-adsk
Copy link
Collaborator

The pxr plugin has this exact code so it will also not import a .usdz when you try to drop it on Maya either. I can add the exact same line there, or we can leave it as a mayaUSD only thing if we want.

Is this something that can be factored out easily into the mayaUsd/lib core and used across multiple plugins, or is it a bit more involved?

@fowlertADSK
Copy link
Contributor Author

The pxr plugin has this exact code so it will also not import a .usdz when you try to drop it on Maya either. I can add the exact same line there, or we can leave it as a mayaUSD only thing if we want.

Is this something that can be factored out easily into the mayaUsd/lib core and used across multiple plugins, or is it a bit more involved?

It could be. Right now the common code that is used by multiple plugins are the "job" classes down in the lib but this code is up in the translators. The translators, defined in each plugin, set things like the default options or what extensions they can support, but they all derive directly from MPxFileTranslator.

For the commands I'm actually creating a new base command class that the others derive from so they can customize just the things that are different. We could do that here as well but I have not planned for that refactoring yet.

@kxl-adsk kxl-adsk added the import-export Related to Import and/or Export label Mar 31, 2020
Copy link
Contributor

@mattyjams mattyjams left a comment

Choose a reason for hiding this comment

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

Good catch @fowlertADSK! Looks good to me!

If it's not too much trouble, it would be great to add this for the Pixar plugin also:
https://github.com/Autodesk/maya-usd/blob/dev/plugin/pxr/maya/lib/usdMaya/importTranslator.cpp#L122

@fowlertADSK
Copy link
Contributor Author

Good catch @fowlertADSK! Looks good to me!

If it's not too much trouble, it would be great to add this for the Pixar plugin also:
https://github.com/Autodesk/maya-usd/blob/dev/plugin/pxr/maya/lib/usdMaya/importTranslator.cpp#L122

Done.

@kxl-adsk kxl-adsk merged commit d61d8ae into dev Apr 2, 2020
@kxl-adsk kxl-adsk deleted the fowlert/MAYA-104134/add_usdz_to_identifyFile branch April 2, 2020 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
import-export Related to Import and/or Export
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants