Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Max: User's setting for scene unit scale #6097

Merged
moonyuet merged 9 commits intodevelopfrom
enhancement/OP-7596_3dsmax-unit-scale-issue-for-FBX
Jan 3, 2024
Merged

Max: User's setting for scene unit scale #6097
moonyuet merged 9 commits intodevelopfrom
enhancement/OP-7596_3dsmax-unit-scale-issue-for-FBX

Conversation

@moonyuet
Copy link
Copy Markdown
Member

@moonyuet moonyuet commented Jan 2, 2024

Changelog Description

Options for users to set the default scene unit scale for their scenes.
AYON
image
image

Legacy OP
image
image

Additional info

Fbx extractor is refactored regarding to the implementation for the related unit scale parameters.

Testing notes:

Legacy OP

  1. Enable Set Unit Scale
  2. Choose what to set as default unit scale for scene
  3. Launch Max, it should be set accordingly to what you set in OP settings
    AYON
  4. Build the addons with this branch
  5. Install the Max and Openpype addons which is built from this branch
  6. Repeat the steps of "Legacy OP" above.

@ynbot
Copy link
Copy Markdown
Contributor

ynbot commented Jan 2, 2024

Task linked: OP-7596 3dsmax: unit scale issue for FBX

@ynbot ynbot added host: 3dsmax Autodesk 3dsmax type: enhancement Enhancements to existing functionality size/S Denotes a PR changes 100-499 lines, ignoring general files labels Jan 2, 2024
@moonyuet moonyuet requested a review from Minkiu January 2, 2024 11:14
@moonyuet moonyuet added target: OpenPype target: AYON type: refactor Structural changes not affecting functionality labels Jan 2, 2024
Copy link
Copy Markdown
Contributor

@Minkiu Minkiu left a comment

Choose a reason for hiding this comment

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

Haven't tested it, but code looks good.

Copy link
Copy Markdown
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.

Well in short, doesnt work for me...

Tested just in legacy OP and max 2024 I first tested the default Inches setting and then metric millimeters but neither worked well.

The max scene still showing generic measureless units and not the one set in OP Settings.

Also the Set Units Scale menu action doesnt work at all.

image

What I have expected: when set in OP Settings some unit type that the workfile adopts it immedeatelly when created and/or if needed on already saved workfile to be able to use menu action set units scale to properly set the units according to OP Settings.

Right now it does not do any of these?

@moonyuet
Copy link
Copy Markdown
Member Author

moonyuet commented Jan 3, 2024

Well in short, doesnt work for me...

Tested just in legacy OP and max 2024 I first tested the default Inches setting and then metric millimeters but neither worked well.

The max scene still showing generic measureless units and not the one set in OP Settings.

Also the Set Units Scale menu action doesnt work at all.

image What I have expected: when set in OP Settings some `unit type` that the workfile adopts it immedeatelly when created and/or if needed on already saved workfile to be able to use menu action `set units scale` to properly set the units according to OP Settings.

Right now it does not do any of these?

Have you checked if it aligns with the unit scale setting in OP by clicking System unit setup?
image
I just find out the issue and it seems it doesn't align with the unit scale, will fix it right away

@moonyuet moonyuet requested a review from LiborBatek January 3, 2024 09:42
@moonyuet
Copy link
Copy Markdown
Member Author

moonyuet commented Jan 3, 2024

@LiborBatek the latest commit would use the metric types for unit scale and it is set accordingly with the project settings.
image

@LiborBatek
Copy link
Copy Markdown
Member

LiborBatek commented Jan 3, 2024

@LiborBatek the latest commit would use the metric types for unit scale and it is set accordingly with the project settings.

Will that change count also for other unit systems too? like US etc?

Only metric system being supported right now.

Copy link
Copy Markdown
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.

Right now, Set Unit Scale in the OP Settings correctly used when triggering action from OP Menu Set Unit Scale.

image

Note: Right now the OP Settings not being propagated on initial host launch which would be also preffered, but this PR do what it should in general.

@moonyuet
Copy link
Copy Markdown
Member Author

moonyuet commented Jan 3, 2024

Right now, Set Unit Scale in the OP Settings correctly used when triggering action from OP Menu Set Unit Scale.

image Note: Right now the OP Settings not being propagated on initial host launch which would be also preffered, but this PR do what it should in general.

I am creating an issue for this and keep it as record. The #postSystemStartup callback is still not working as expected (like what it does in the past) so currently we can't propagate the setting during the launch.
See: https://www.scriptspot.com/forums/3ds-max/general-scripting/callback-postsystemstartup-not-working
https://discourse.techart.online/t/maxscript-scripted-material-plugins-and-callbacks/2055

@antirotor would you mind take a glance at the code to see anything needs specific change? Thanks!

Copy link
Copy Markdown
Member

@antirotor antirotor left a comment

Choose a reason for hiding this comment

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

Code concerning units changes looks good, but I have slight objection against changes in the event system within this PR - if I read it correctly, the changes have nothing to do with the actual unit scale issue. If the automatic change of units during the startup cannot be done because some issue with events, I wouldn't include these changes here at all and move them to separate issue/PR

@moonyuet moonyuet requested a review from antirotor January 3, 2024 15:20
@moonyuet
Copy link
Copy Markdown
Member Author

moonyuet commented Jan 3, 2024

Code concerning units changes looks good, but I have slight objection against changes in the event system within this PR - if I read it correctly, the changes have nothing to do with the actual unit scale issue. If the automatic change of units during the startup cannot be done because some issue with events, I wouldn't include these changes here at all and move them to separate issue/PR

I have restored the code for event system, and we can wait to refactor it when the postSystemStartup callback has been fixed.

@moonyuet moonyuet requested a review from LiborBatek January 3, 2024 15:51
Copy link
Copy Markdown
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 have tested this time in AYON mode and all went good and without any issues!

image

@moonyuet moonyuet merged commit 8501da4 into develop Jan 3, 2024
@moonyuet moonyuet deleted the enhancement/OP-7596_3dsmax-unit-scale-issue-for-FBX branch January 3, 2024 16:16
@ynbot ynbot added this to the next-patch milestone Jan 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

host: 3dsmax Autodesk 3dsmax size/S Denotes a PR changes 100-499 lines, ignoring general files target: AYON target: OpenPype type: enhancement Enhancements to existing functionality type: refactor Structural changes not affecting functionality

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants