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

Reset Unit Scale default to False in ayon setting and Popup menu before the reset #31

Merged
merged 10 commits into from
Jan 27, 2025

Conversation

moonyuet
Copy link
Member

Changelog Description

Resolve #30
This PR is to set the reset unit scale default value to False and also add popup window to alter user for the change of the unit scale.

Additional review information

n/a

Testing notes:

  1. Install and Build 3dsmax addon
  2. Check ayon+settings://max/unit_scale_settings
  3. It should be False
  4. Enable it
  5. Launch Max
  6. There would be popup menu to ask you if you want to reset unit scale.

@moonyuet moonyuet added type: bug Something isn't working sponsored This is directly sponsored by a client or community member labels Jan 24, 2025
@moonyuet moonyuet requested review from BigRoy and LiborBatek January 24, 2025 09:36
@moonyuet moonyuet self-assigned this Jan 24, 2025
Copy link
Member

@LiborBatek LiborBatek left a comment

Choose a reason for hiding this comment

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

Following the testing steps, it is correctly disabled as defaults within addons setting:

Screenshot 2025-01-24 114825

but once enabled Im getting this error just right away after 3dsmax launch:

Screenshot 2025-01-24 115121

@moonyuet moonyuet requested a review from LiborBatek January 24, 2025 10:55
Copy link
Member

@LiborBatek LiborBatek left a comment

Choose a reason for hiding this comment

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

Once setting Set Unit Scale enabled then popup win been shown

Screenshot 2025-01-24 132103

but first issue is that it shows up on pretty every occasion no matter if units been correct or not:

e.g. when creating new scene via CTRL+N and also been set to correct units.

Screenshot 2025-01-24 132137

Besides its unnecessary its very annoying to face it each time...some logic need to be on place and show up only when mismatch of scene units happening...

@LiborBatek
Copy link
Member

LiborBatek commented Jan 24, 2025

speaking of new scene...it should probably just force setting the prefered units without any popup win showing....imho, simply following studio preferences (when Set unit Scale been enabled in AYON)

Speaking of that pop up message. maybe there should be info note similar to this:

Scene units do not match studio/project preferences. Would you like to set your scene unit scale to 'cm` ?

@moonyuet moonyuet requested a review from LiborBatek January 24, 2025 12:55
@moonyuet
Copy link
Member Author

moonyuet commented Jan 24, 2025

speaking of new scene...it should probably just force setting the prefered units without any popup win showing....imho, simply following studio preferences (when Set unit Scale been enabled in AYON)

Speaking of that pop up message. maybe there should be info note similar to this:

Scene units do not match studio/project preferences. Would you like to set your scene unit scale to 'cm` ?

The updated commit should only show the popup when you hit the set unit scale from the AYON plugins

Copy link
Member

@LiborBatek LiborBatek left a comment

Choose a reason for hiding this comment

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

Tested again...and my findings so far:

  1. when Set unit Scale enabled in the addons setting then it forces the unit scale automatically when launched via launcher for very first time (without notification at all) > would be better to first inform the user via that info message first and let him choose what happens next

  2. when changing context via Ayon > Workfiles then it does not apply any Set unit scale at all neither telling user that units are mismatching if true (in my case yes) > again I would rather expect to showing popup of unit scale mismatch and offer set scale action to user then doing nothing...a bit useless atm

  3. when using AYON menu and trigger the action Set unit scale I can finally see the popup which is not looking the best (speaking of formatting)
    Screenshot 2025-01-24 163842

and also doesnt make much sense at this moment to show such info as user triggered by himself so its a bit useless to say something about different units been used then studio prefs.

In general it should copy the way when in maya host and mismatch of FPS > first inform user if any mismatch present and offer set scale command to fix it if preferable by user.

As we have it right now (Set unit scale action) , it basically dont let user to choose or inform him when its needed... and just perfom it after launch from the launcher app or do nothing when its actually needed (when changing context and approach scene with mismatched units)

@moonyuet
Copy link
Member Author

Tested again...and my findings so far:

  1. when Set unit Scale enabled in the addons setting then it forces the unit scale automatically when launched via launcher for very first time (without notification at all) > would be better to first inform the user via that info message first and let him choose what happens next
  2. when changing context via Ayon > Workfiles then it does not apply any Set unit scale at all neither telling user that units are mismatching if true (in my case yes) > again I would rather expect to showing popup of unit scale mismatch and offer set scale action to user then doing nothing...a bit useless atm
  3. when using AYON menu and trigger the action Set unit scale I can finally see the popup which is not looking the best (speaking of formatting)
    Screenshot 2025-01-24 163842

and also doesnt make much sense at this moment to show such info as user triggered by himself so its a bit useless to say something about different units been used then studio prefs.

In general it should copy the way when in maya host and mismatch of FPS > first inform user if any mismatch present and offer set scale command to fix it if preferable by user.

As we have it right now (Set unit scale action) , it basically dont let user to choose or inform him when its needed... and just perfom it after launch from the launcher app or do nothing when its actually needed (when changing context and approach scene with mismatched units)

I have updated the commit to fix it and you would notice this dialog when you enable scene unit scale.
image

@moonyuet moonyuet requested a review from LiborBatek January 27, 2025 05:16
Copy link
Member

@LiborBatek LiborBatek left a comment

Choose a reason for hiding this comment

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

I do get nice little warning message as when FPS is not matching which I like!

Screenshot 2025-01-27 100933

But it seems that the logic when to show it fails, as it does not matter if correct or wrong units been set within a workfile it always pops up this message.

Need to be addressed so it triggers only when valid occasion...

…cale accordingly to the scene unit scale in the ayon setting
@moonyuet moonyuet requested a review from LiborBatek January 27, 2025 09:54
Copy link
Member

@LiborBatek LiborBatek left a comment

Choose a reason for hiding this comment

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

After another testing round I have came across these:

  1. Works well when launching from launcher (task) and detects properly if aligned or not with settings
  2. Works when changing context via Ayon>Workfiles ok and detects properly again
  3. When been in the same context and switching workfile version with units mismatch is not working aka not detected properly. Its a bit of edge case tho....as having different unit scale between version does not happen usually.

e.g. something like this:

shot_020_lighting_workfile_v025 having setcm
shot_020_lighting_workfile_v026 having set mm

Should be addressed too if possible.

@moonyuet moonyuet requested review from LiborBatek and BigRoy January 27, 2025 14:14
client/ayon_max/api/lib.py Outdated Show resolved Hide resolved
client/ayon_max/api/lib.py Outdated Show resolved Hide resolved
client/ayon_max/api/lib.py Outdated Show resolved Hide resolved
client/ayon_max/api/lib.py Outdated Show resolved Hide resolved
client/ayon_max/api/lib.py Outdated Show resolved Hide resolved
client/ayon_max/api/lib.py Outdated Show resolved Hide resolved
@moonyuet moonyuet requested a review from BigRoy January 27, 2025 14:46
Copy link
Contributor

@BigRoy BigRoy left a comment

Choose a reason for hiding this comment

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

Didn't test but changes look good to me.

Copy link
Member

@LiborBatek LiborBatek left a comment

Choose a reason for hiding this comment

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

Now it works under all circumstances e.g when launched from the launcher, when switching to different context and going from workfile to workfile within the same context. So all good!

One last note:
there are only metric units and not the US standards like feet and inches. So we should include those too I guess? Even tho there is a plethora of combinations/ configs to be honest....
image

ideas?

@moonyuet moonyuet merged commit 8f715e0 into develop Jan 27, 2025
1 check passed
@moonyuet moonyuet deleted the bugfix/AY-7356_scale-issue branch January 27, 2025 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sponsored This is directly sponsored by a client or community member type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AY-7356_scale issue
3 participants