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

Max: reset scene and clear undo buffer when starting new scene #493

Conversation

moonyuet
Copy link
Member

@moonyuet moonyuet commented May 8, 2024

Changelog Description

When user load assets and then start the new scene by File -> New -> New All, the scene isn't reset correctly. This PR is to fix this bug so that user can get nice and clean scene after starting new scene.

Additional info

n/a

Testing notes:

  1. Launch Max
  2. Load Asset
  3. start the new scene by File -> New -> New All
  4. Scene should be reset correctly

@moonyuet moonyuet requested a review from BigRoy May 8, 2024 14:22
@BigRoy
Copy link
Collaborator

BigRoy commented May 8, 2024

When user load assets and then start the new scene by File -> New -> New All, the scene isn't reset correctly.

For sake of the PR description - could you add to the descriptioin what in particular "failed" to reset correctly? What was the actual issue? Etc. It's also unclear why the changes here 'solve' this issue that lacks description currently.

@moonyuet
Copy link
Member Author

moonyuet commented May 8, 2024

When user load assets and then start the new scene by File -> New -> New All, the scene isn't reset correctly.

For sake of the PR description - could you add to the descriptioin what in particular "failed" to reset correctly? What was the actual issue? Etc. It's also unclear why the changes here 'solve' this issue that lacks description currently.

You can try to replicate issue by the following steps in the develop branch.

  1. Launch Max
  2. Load Asset with AYON loader
  3. File -> New -> New All
  4. Once you start the new scene, the viewport still shows up the loaded objects but obviously they are no longer at the scene.

You may find this video helpful to demonstrate the bug.
https://github.com/ynput/ayon-core/assets/64118225/f581d886-c1bd-4385-8bcc-3ee98640f5eb

@BigRoy
Copy link
Collaborator

BigRoy commented May 8, 2024

4. Once you start the new scene, the viewport still shows up the loaded objects but obviously they are no longer at the scene.

Thanks - this line ☝️ should be in the PR description since it explains the actual issue at hand and also should be used in the testing notes to describe what should be checked for.

WHY was this bug there to begin with? I'd expect any DCC that a new scene should clear the scene and not bug out as oddly as this. This makes me curious as to what the difference is between a Max "new scene" and a "reset"? Is this really related to the AYON load logic? Or even if you just create a regular cube does the geometry persist somehow after "new scene"? I feel like we're now obfuscating some other bug.

@moonyuet
Copy link
Member Author

moonyuet commented May 8, 2024

  1. Once you start the new scene, the viewport still shows up the loaded objects but obviously they are no longer at the scene.

Thanks - this line ☝️ should be in the PR description since it explains the actual issue at hand and also should be used in the testing notes to describe what should be checked for.

WHY was this bug there to begin with? I'd expect any DCC that a new scene should clear the scene and not bug out as oddly as this. This makes me curious as to what the difference is between a Max "new scene" and a "reset"? Is this really related to the AYON load logic? Or even if you just create a regular cube does the geometry persist somehow after "new scene"? I feel like we're now obfuscating some other bug.

I know it's weird, but this is somehow related to the part of the maxscript nature.
I actually take a look at the maxscript docs for fixing this issue: https://help.autodesk.com/view/MAXDEV/2023/ENU/?guid=GUID-92E4150E-0AD4-430C-A852-783A45276D23

I have added the condition for checking unsaved change to avoid some possible errors encountered.

@BigRoy
Copy link
Collaborator

BigRoy commented May 8, 2024

I know it's weird, but this is somehow related to the part of the maxscript nature.
I actually take a look at the maxscript docs for fixing this issue: https://help.autodesk.com/view/MAXDEV/2023/ENU/?guid=GUID-92E4150E-0AD4-430C-A852-783A45276D23

But in your screen recording you're not using any scripting to perform the new file logic? You're literally using their menu entries. 🤯 Haha - I really know too little about 3DsMax.

@moonyuet
Copy link
Member Author

moonyuet commented May 8, 2024

I know it's weird, but this is somehow related to the part of the maxscript nature.
I actually take a look at the maxscript docs for fixing this issue: https://help.autodesk.com/view/MAXDEV/2023/ENU/?guid=GUID-92E4150E-0AD4-430C-A852-783A45276D23

But in your screen recording you're not using any scripting to perform the new file logic? You're literally using their menu entries. 🤯 Haha - I really know too little about 3DsMax.

I just click to have new scene and it shows up the viewport issue. And it only happened when you have modified scene, and you want to start new scene without saving the modified one.

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.

Did test it and it correctly sets the New Clean Scene properly.

@moonyuet moonyuet merged commit c133c97 into develop May 16, 2024
1 check passed
@moonyuet moonyuet deleted the bugfix/the_scene_isn't_reset_correctly_when_starting_new_scene_after_loading_objects branch May 16, 2024 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants