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-114297 MAYA-114300 Job context UI #1842

Merged
merged 2 commits into from
Dec 3, 2021

Conversation

JGamache-autodesk
Copy link
Collaborator

Add a job context dropdown called "Plug-in Configuration:" in both
import and export dialogs when in USD mode.

This dropdown will be populated with the available job contexts.

Selecting on the the job context will populate the UI with the settings
provided by the job context, and these settings will be made read-only.

Add a job context dropdown called "Plug-in Configuration:" in both
import and export dialogs when in USD mode.

This dropdown will be populated with the available job contexts.

Selecting on the the job context will populate the UI with the settings
provided by the job context, and these settings will be made read-only.
@JGamache-autodesk JGamache-autodesk added adsk Related to Autodesk plugin import-export Related to Import and/or Export labels Nov 17, 2021
@@ -245,7 +245,7 @@ MStatus MayaUSDExportCommand::doIt(const MArgList& args)

// Read all of the dictionary args first.
const VtDictionary userArgs = UsdMayaUtil::GetDictionaryFromArgDatabase(
argData, UsdMayaJobExportArgs::GetDefaultDictionary());
argData, UsdMayaJobExportArgs::GetGuideDictionary());
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This function works best if the dictionary passed contains fully typed values. The "Default" dictionary has a tendency to contain empty vectors for args that take a list, and this does not provide enough information about what goes into the list (especially chaserArgs where the contents are themselves vectors). The newly introduced "Guide" dictionary provides all the information for proper parsing.

const auto _string = VtValue(std::string());
const auto _stringVector = VtValue(std::vector<VtValue>({ _string }));
const auto _stringTriplet = VtValue(std::vector<VtValue>({ _string, _string, _string }));
const auto _stringTripletVector = VtValue(std::vector<VtValue>({ _stringTriplet }));
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The value is not important. Only the type.

} else if (value.IsHolding<int>()) {
return std::make_pair(true, std::to_string(value.Get<int>()));
} else if (value.IsHolding<float>()) {
return std::make_pair(true, std::to_string(value.Get<float>()));
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We have int and float values in the args: startTime, endTime, frameStride, so we need a way to unparse them.

@@ -15,25 +15,29 @@
// limitations under the License.
//

proc mayaUsdTranslatorExport_SetCheckbox(string $arg, string $widget) {
proc mayaUsdTranslatorExport_SetCheckbox(string $arg, int $enable, string $widget) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

All the setters take an extra argument to enable the field or not depending if the value was set from a regular argument, or from an argument provided by a job context.

plugin/adsk/scripts/mayaUsdTranslatorExport.mel Outdated Show resolved Hide resolved
@@ -61,7 +61,29 @@ REGISTER_EXPORT_JOB_CONTEXT_FCT(Thierry, "Thierry", "Exports for Thierry rendere

REGISTER_EXPORT_JOB_CONTEXT_FCT(SceneGrinder, "Scene Grinder", "Exports to Scene Grinder")
{
return VtDictionary();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For testing interactively in Maya. Provide a few interesting values to make sure the fields are correctly updated and disabled.

plugin/adsk/scripts/mayaUsdTranslatorExport.mel Outdated Show resolved Hide resolved
plugin/adsk/scripts/mayaUsdTranslatorExport.mel Outdated Show resolved Hide resolved
plugin/adsk/scripts/mayaUsdTranslatorImport.mel Outdated Show resolved Hide resolved
plugin/adsk/scripts/mayaUsdTranslatorExport.mel Outdated Show resolved Hide resolved
@JGamache-autodesk JGamache-autodesk added the ready-for-merge Development process is finished, PR is ready for merge label Dec 2, 2021
Copy link
Collaborator

@seando-adsk seando-adsk left a comment

Choose a reason for hiding this comment

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

Awesome, thanks for doing the localization work.

@kxl-adsk kxl-adsk merged commit 2bf98c7 into dev Dec 3, 2021
@kxl-adsk kxl-adsk deleted the t_gamaj/MAYA-114300/job_context_ui branch December 3, 2021 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adsk Related to Autodesk plugin import-export Related to Import and/or Export ready-for-merge Development process is finished, PR is ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants