Maya Forum
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya topics.
Showing results for 
Show  only  | Search instead for 
Did you mean: 

UV custom shelf stretched icons 2018.6.0.8394

Message 1 of 10
250 Views, 9 Replies

UV custom shelf stretched icons 2018.6.0.8394

I'm curious if this issue happens for other people with maya 2018 or newer

If I add tools to the custom UV shelf they appear fine to start with. Then after I restart maya they are stretched from then onwards (you have to check custom shelf first under view, then ctrl+shift+click items to add them to that shelf)

I will attach photos


Message 2 of 10
in reply to: MayaNZ01

Yep - I have this exact same problem with my custom shelf in the UV editor. Bump.
Message 3 of 10
in reply to: paul

Are you also using 2018?

Message 4 of 10
in reply to: MayaNZ01

I am using 2022.4 and it's still present.
Message 5 of 10
in reply to: MayaNZ01

Here's a chunk of the uvShelf_Custom.mel script which represents one button.

The 'width' value being 35 when 'flexibleWidthValue' is 32 seems odd to me, but I don't know the MEL well enough to know if that's the problem, or what to change to fix it.

        -enableCommandRepeat 1
        -flexibleWidthType 3
        -flexibleWidthValue 32
        -enable 1
        -width 35
        -height 22
        -manage 1
        -visible 1
        -preventOverride 0
        -annotation "Rotate the positions of the selected components by a specified number of degrees" 
        -enableBackground 0
        -backgroundColor 0 0 0 
        -highlightColor 0.321569 0.521569 0.65098 
        -align "center" 
        -label "Rotate" 
        -labelOffset 0
        -rotation 0
        -flipX 0
        -flipY 0
        -useAlpha 1
        -overlayLabelColor 0.8 0.8 0.8 
        -overlayLabelBackColor 0 0 0 0.5 
        -image "polyRotateUVCCW.png" 
        -image1 "polyRotateUVCCW.png" 
        -style "iconOnly" 
        -marginWidth 1
        -marginHeight 1
        -command "RotateUVs" 
        -sourceType "mel" 
        -commandRepeatable 1
        -flat 1


Message 6 of 10
in reply to: paul

So I looked up the MEL command document for shelfButton and had a read of the definitions.

I was able to make my custom UV shelf buttons square again by changing the flexibleWidthType to 2, and setting the flexibleWidthValue to a size the same as the height value.

This is the definition for flexibleWidthType:
"This flag is used to have the shelf button have a wider or thinner width. The valid values are: Standard = 1, Custom = 2, Automatic = 3. The Standard type will resize, keeping the aspect ratio, to 32x32 pixels. The Automatic type will adjust the button width to make sure wide images are used properly. The Custom type will allow the user to choose the desired width for the icon. Default value is 3."

And flexibleWidthValue:
"This flag is only useful when the Custom flexibleWidthType is chosen. The value is a width in pixels."

Doing this will allow you to get your square icons back, but then there will be a big gap between the icons. This is due the -width value, which is the width of the control (not the button icon). So just change your width value to one or two pixels larger than flexibleWidthValue.

NOTE: you can change this script with Maya open, but make sure you have your UV editor closed when you change the script, otherwise Maya will just overwrite any changes you make with the current values it's using.
Message 7 of 10
in reply to: MayaNZ01

Here is a link to the doc:

I just used find and replace in Notepad++ to adjust the values for every button on my shelf.
Message 8 of 10
in reply to: MayaNZ01

Thanks for the quick fix, I did check the UV shelf with notepad++ previously but didn't change anything as nothing stood out. I do wonder if it's fixed in 2023, as it is strange default behavior and must have been an issue for years. I guess not many people use or know about the custom UV shelf as it's hidden by default


I do want to mark your answer as the solution but also feel like that will stop devs from seeing it. If anyone has 2023 I'm curious if this is still the default behavior



Message 9 of 10
in reply to: MayaNZ01

No worries. From memory when I tried 2023 it was still an issue. I went back to 2022 because of some weird custom vertex normal issues in 2023 which I have reported but not heard back about.

I remember that the issue cropped up for me when I first got my 4k monitor, and so was then running Maya with screens of different resolutions (second screen 1920x1080). It was like when I moved my UV editor from my main screen to the second screen and it attempted to adjust the scale, it just broke it.
Wondering if maybe a similar thing triggered it for you?
Message 10 of 10
in reply to: paul

I think I have a similar setup, one monitor is 3840 x 2160

the other is just 1080p I think. I never had a second monitor of the same resolution and have only just found out about a custom UV shelf so can't test that, but it is most likely the cause



Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums