SallyUIscale4K

Plugins SallyUIscale4K

Sally Whitemane

Well-known member
Featured Contributor
Messages
272
Reactions
1,047
Points
93
Patreon
sallyw
Sally Whitemane submitted a new resource:

SallyUIscale4K - Fix UI scale on 4K monitors and allow 8K UI scaling

For high resolution monitors only! 4K (3840x2160) or higher!

A quickly 'hacked' together Plugin to mainly fix the not scaling bottom left bar in VAM.
It also makes VAM assume 4K is the default for UI scale 1.0 and allows UI scaling up to 8K.
There may or may not be other UI elements affected by the scaling - this is provided 'as is' - working and tested only in 3840x2160 desktop mode!

Comparison:
View attachment 101671

I got annoyed about having to run VAM in 1080p all the time due to the bad UI scaling - so I made this and maybe others find it useful.
Disclaimer: I have no clue how the internals of VAM actually work - it is complicated - this is just a quick and dirty workaround I made for myself and decided to share.

Read more about this resource...
 
Last edited:
Sally Whitemane updated SallyUIscale4K with a new update entry:

Version 2

  • added option to set the screen resolution
  • added checks to prevent unreachable UI with a resolution height lower than 2160 in case:
    • VAM was started with a low resolution > load Plugin in deactivated state​
    • User tries to activate Plugin with a low resolution > refuse​
    • User lowers resolution > deactivate​

Read the rest of this update entry...
 
If the UI clips into 3D objects enable 'Draw UI On Top' in VAM under [User Preferences] > [Misc]-tab.
By default this is enabled. Example image with it disabled:
Enable Draw UI On Top to avoid UI clipping.jpg
 
Sally Whitemane updated SallyUIscale4K with a new update entry:

Version 4

Convenience Update that adds keyboard shortcuts:

Control + Home -> Toggle active
Control + left/right -> change UI scale
Control + up/down -> change FoV (Field of View)
Control + page up -> set 3840x2160 resolution
Control + page down -> set 1920x1080 resolution

Users of older Versions - remember to update your session Plugin defaults to V4.

5K or higher resolution monitor?
The page up 3840x2160 resolution is hardcoded, but can be modified easily.
Use 7zip to extract the source code, edit...

Read the rest of this update entry...
 
Is there a way to make this work for ultra widescreen resolutions?
What is the native resolution of your ultra widescreen monitor?

I already expected this question to come from users with the now very popular ultrawide monitors.
Looking into it - but I'm not yet sure I can test it if it's above my 3840x2160 resolution.
 
What is the native resolution of your ultra widescreen monitor?

I already expected this question to come from users with the now very popular ultrawide monitors.
Looking into it - but I'm not yet sure I can test it if it's above my 3840x2160 resolution.
Mine is 3440 x 1440

Thanks in advance!
 
Sally Whitemane updated SallyUIscale4K with a new update entry:

Version 5

This update mainly adds support for new resolutions and is more experimental.
The popular 2560x1440 and 3440x1440 resolutions now work.
  • Minimum resolution height to activate is now 1440 (was 2160).
  • All resolutions below 1440p are not supported. Use the build-in VAM UI Scale slider for them!
  • 21:9 resolutions supported: 3440x1440, 3840x1600
  • 16:9 resolutions supported: 2560x1440, 3200x1800, 3840x2160
  • 16:10 resolutions...

Read the rest of this update entry...
 
Sally Whitemane updated SallyUIscale4K with a new update entry:

Version 6

  • replaced bottom left toolbar text with field of view and frames per second
  • increased the original VAM UI scale slider maximum from 2x to 4x to allow 8K UI with original VAM scaling, Plugin must be in enabled/loaded, but deactivated state for this, removing the Plugin will reset this to the default 2x
  • activated hidden "Toggle Monitor"-mode button on toolbar, the button will stay visible when removing the Plugin will
View attachment 130439...

Read the rest of this update entry...
 
Sally Whitemane updated SallyUIscale4K with a new update entry:

Version 7

TLDR: Now lets you save and auto reload your UI scale.

long version:
Once this button has been clicked once, every time the plugin activates (like a in a new VAM session) it should now reload your UI scale. The blue message log will show SallyUIscale4K successfully loaded user default to confirm. If you never use it, it behaves like the previous version and no plugin-data will be saved.

Don't forget to update session plugin defaults.
[ATTACH type="full"...

Read the rest of this update entry...
 
@sickskywalker
I cannot attach files via private message - so I'll post this new version here.
Tested only briefly. In case I messed up, I will delete the attached file and fix it later.

It can now save the UI offset and bar position.
Re-save your desired settings once in the new version.
If it finds only the UI scale saved from version 7, but not the new data, it will restore only that with a different message in the blue log.
 

Attachments

  • Sally.SallyUIscale4K.8.var
    6 KB · Views: 0
This is a must have plugin for anyone with a monitor that has a big resolution!

Wondering though if it's possible to "change" the default FoV of 40 into a custom value automatically when VaM launches.
I find myself using a FoV of 52 allot and would love this tiny process (pressing ctrl+arrowkeys) to be automated, since I almost always use the same value.
 
Wondering though if it's possible to "change" the default FoV of 40 into a custom value automatically when VaM launches.
That's very simple to do. Maybe I will add it as option to override it at some time.
I am bit careful with making another FOV the default because scenes expect it to be 40.
Some scenes or other plugin take control of the FOV too.

Meanwhile you can add it yourself:
1. Use a packing tool like WinRar or 7Zip and open <your VaM path>\AddonPackages\Sally.SallyUIscale4K.8.var > navigate to Custom\Scripts\Sally\SallyUIscale4k\ and extract UIscale4K.cs, keep the pack tool open
2. Open UIscale4K.cs in a text editor and paste this line in the Start() function:
C#:
void Start()
{
    try
    {
        SuperController.singleton.monitorCameraFOV = 52.0f; // paste this line
        stopWatch.Start();
3. Save and copy it back into the .var-file so the original file will be overwritten
When loading into the main menu it will still show 40. It does not update there. Opening any scene will show FOV 52 then.

I find myself using a FoV of 52 allot
As desktop only user I know what you mean. That's usually what I end up using too.
 
That's very simple to do. Maybe I will add it as option to override it at some time.
I am bit careful with making another FOV the default because scenes expect it to be 40.
Some scenes or other plugin take control of the FOV too.

Meanwhile you can add it yourself:
1. Use a packing tool like WinRar or 7Zip and open <your VaM path>\AddonPackages\Sally.SallyUIscale4K.8.var > navigate to Custom\Scripts\Sally\SallyUIscale4k\ and extract UIscale4K.cs, keep the pack tool open
2. Open UIscale4K.cs in a text editor and paste this line in the Start() function:
C#:
void Start()
{
    try
    {
        SuperController.singleton.monitorCameraFOV = 52.0f; // paste this line
        stopWatch.Start();
3. Save and copy it back into the .var-file so the original file will be overwritten
When loading into the main menu it will still show 40. It does not update there. Opening any scene will show FOV 52 then.


As desktop only user I know what you mean. That's usually what I end up using too.
Many many thanks!
 
hi sally, I ran into a weird issue, where when vam first start up , the plugin works as intended, but when i load into a new scene, it always reset to the 1080p resolution, I have to ctrl+home to 4k every new scene, is there a debug log i can send you?
 
when i load into a new scene, it always reset to the 1080p resolution
Yeah, that should not happen. Does it happen for every scene or a specific one?
I have to ctrl+home to 4k every new scene
Just checking, does '4k' mean you have a 3840x2160 monitor and you also start VAM in that native resolution?

I suspect that it triggers a "safeguard" for some reason:
There a check that verifies that the resolution-height is at least 1440 pixels. If that's not the case it falls back to 1080p.
This 1440 minimum requirement is defined via in
C#:
private const int MIN_ACTIVE_HEIGHT = 1440;
code near the start.
I think this "safeguard" was mostly there for users that do not read the manual and don't know about the ctrl + home shortcut ... they could end up with an "overscaled" UI that they can no longer control and reset unless they restart VAM.

We can chat on the VAM-Discord on the weekend to figure this out. My username there is 'SallyW'. Unfortunately I don't have the time on weekdays due to long exhausting workhours.

I've only basic logging the the release versions that prints to VAM's blue message board ... it's easy to add a bunch of extra log-lines in the code. I can send you a modified version then that should help to narrow it down ... or if you want try your luck yourself ... you can extract to code from the .var file with 7zip for example to <VAM>\Custom\Script\ and try to poke around in it by adding lines like:
C#:
SuperController.LogMessage("my log message");
Then load your modified Plugin from there instead of the .var file.
 
Yeah, that should not happen. Does it happen for every scene or a specific one?

Just checking, does '4k' mean you have a 3840x2160 monitor and you also start VAM in that native resolution?

I suspect that it triggers a "safeguard" for some reason:
There a check that verifies that the resolution-height is at least 1440 pixels. If that's not the case it falls back to 1080p.
This 1440 minimum requirement is defined via in
C#:
private const int MIN_ACTIVE_HEIGHT = 1440;
code near the start.
I think this "safeguard" was mostly there for users that do not read the manual and don't know about the ctrl + home shortcut ... they could end up with an "overscaled" UI that they can no longer control and reset unless they restart VAM.

We can chat on the VAM-Discord on the weekend to figure this out. My username there is 'SallyW'. Unfortunately I don't have the time on weekdays due to long exhausting workhours.

I've only basic logging the the release versions that prints to VAM's blue message board ... it's easy to add a bunch of extra log-lines in the code. I can send you a modified version then that should help to narrow it down ... or if you want try your luck yourself ... you can extract to code from the .var file with 7zip for example to <VAM>\Custom\Script\ and try to poke around in it by adding lines like:
C#:
SuperController.LogMessage("my log message");
Then load your modified Plugin from there instead of the .var file.
thanks sally, will try to remove the safeguard and see if anything changes, and yes its every scene
 
actually i did some testing myself, i seem to found the culprit,
whenever this plugin is in my session plugin, e very scene causes the 4k ui scale to reset
 
actually i did some testing myself, i seem to found the culprit
I was able to replicate a plugin conflict where BodyLanguage causes the bottom left toolbar to reset it's scale. The remaining part of the UI stays at the 4K UI scale for me. Was it the same for you @ouroborolapse ? Like this:
Clipboard_10-18-2024_02.jpg

Don't think this is intentional by @CheesyFX and some sort of side effect from calling some UI / Canvas / MonitorUI related functions in his code. But that plugin is to complex for me to dig myself through it. Meanwhile I found a dirty workaround by caching and restoring that toolbar position ... but I don't like it because it adds code to Update() and anything in there is extra work for the CPU.

Cannot attach .var here anymore - added a modified SallyUIscale4K version to this Discord post:
https://discord.com/channels/363274293112602636/505398213675581453/1297006696677380179
 
I was able to replicate a plugin conflict where BodyLanguage causes the bottom left toolbar to reset it's scale. The remaining part of the UI stays at the 4K UI scale for me. Was it the same for you @ouroborolapse ? Like this:
View attachment 420790
Don't think this is intentional by @CheesyFX and some sort of side effect from calling some UI / Canvas / MonitorUI related functions in his code. But that plugin is to complex for me to dig myself through it. Meanwhile I found a dirty workaround by caching and restoring that toolbar position ... but I don't like it because it adds code to Update() and anything in there is extra work for the CPU.

Cannot attach .var here anymore - added a modified SallyUIscale4K version to this Discord post:
https://discord.com/channels/363274293112602636/505398213675581453/1297006696677380179
No, I did this intentionally. It's a workaround I introduced some versions ago to make our plugins somewhat compatible. If I didn't do that the pose buttons on the right wouldn't be visible when using your plugin. The reset is performed every time BodyLanguage initializes. So if you don't care about not seeing my buttons reload the UI scale plugin after BL is already there.

Maybe you have a better idea how we can have both? Scale the UI without affecting my buttons (which are on a canvas that is child of the lower left F1-bar).
 
Last edited:
Ideas:
On your side: Maybe you can leave the bar itself untouched and scale every built-in child instead. Take care not to catch my canvas as well.
On my side: It's some time since I looked up your code, but you rescale the bar every time the user changes settings, right? Because otherwise I could just check once if the scale is not the default and apply a counter transform to my canvas. I don't want to check it every frame though. Similarly, I don't want to search for your plugin to add a callback to the respective settings because yours could be added later on. So I had to keep searching every frame too, as long it's not there.
 
Last edited:
I was able to replicate a plugin conflict where BodyLanguage causes the bottom left toolbar to reset it's scale. The remaining part of the UI stays at the 4K UI scale for me. Was it the same for you @ouroborolapse ? Like this:
View attachment 420790
Don't think this is intentional by @CheesyFX and some sort of side effect from calling some UI / Canvas / MonitorUI related functions in his code. But that plugin is to complex for me to dig myself through it. Meanwhile I found a dirty workaround by caching and restoring that toolbar position ... but I don't like it because it adds code to Update() and anything in there is extra work for the CPU.

Cannot attach .var here anymore - added a modified SallyUIscale4K version to this Discord post:
https://discord.com/channels/363274293112602636/505398213675581453/1297006696677380179
yeah its precisely what happened
 
Back
Top Bottom