-
Notifications
You must be signed in to change notification settings - Fork 203
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
EMSUSD-1030 - Persist the default prim selection if its available #3705
EMSUSD-1030 - Persist the default prim selection if its available #3705
Conversation
int $count = 1; | ||
for($item in $allItems){ | ||
string $labelText = `menuItem -query -label $item`; | ||
if($labelText == $defaultPrimName){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Select the prim as default prim if it's in the candidates' list.
for($item in $allItems){ | ||
string $labelText = `menuItem -query -label $item`; | ||
if($labelText == $defaultPrimName){ | ||
optionMenuGrp -e -select $count exportDefaultPrim; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here you could use optionMenuGrp -e -value $defaultPrimName exportDefaultPrim;
to set the menu item by value. Then you don't need to keep track of the count.
You could even just wrap that command in a catchQuiet
then you don't even need to check if its in the menus. It will just silently fail if its not present anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh thanks! That should be a much better way to do it
…lliu-adsk/EMSUSD-1030/persist_default_prim
No description provided.