Community
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Stop prompting to save an empty scene

Stop prompting to save an empty scene

(Copied from original User Voice forum)

 

"If I open Maya and then go to file > open, Maya prompts me to save the empty scene it created when it opened.
It also auto-saves blank scenes if I leave it open for a while. "

24 Comments
ajoss13
Participant

File "C:\Program Files\Autodesk\Maya2018\scripts\others\saveChanges.mel":

change

"if (`file -q -mf`)"

to

"if (`file -q -mf` && size(`ls -geometry`))"

Tbh I'm just commenting out this function in my patches.

If user working on some production scene - he's usually saving at regular intervals.

If user is not saving his scene - that's his problem.

That dialog is just another annoyance that I would just remove completely.

 

trevor.adams
Alumni
Status changed to: Under Review

Definitely time to set this to "Under Review" status and have our team take a deeper look - thanks for all the votes.

_wOLVERINe_
Enthusiast

 

The problem is the following...

 

As Maya starts, it starts without loading plugins. At this point, it has its own idea  what a 'fresh new scene' is and that  whatever state it's in now, is an empty state (clearly).. So at this point if you would do File > Open, Maya wont give you the Save dialog when you're in an empty scene. However, then plugins get loaded and add their own default nodes to the scene. As soon as that happens, Maya flags the scene as "Dirty". In which case, if you try to do a File >  Open, you get the Save scene dialog even though your scene is "empty".

 

Seeing as everyone  needs to load some kind of plugin in Maya (even default ones), you will always get this.

Unless Autodesk comes up with a way that forces developers to register "onNewScene" created nodes with some kind of "clean slate" manager.

 

Cheers,

  G!

NateLikesTea
Advocate

Another thought, I often run into this sequence:

 

I'll finish all my render settings, then save, then I'll start a batch render, and then go to open a different scene file, and I'll get a "save changes to scene?" dialog.  No changes were made since last save; I just selected Render > Batch Render

 

or similarly,

 

I'll finish editing a model, then save, then export a file (most often as an obj), and then go to open a different scene file, and I'll get the same "save changes to scene?" window.  Again, no changes were made since last save, I just selected File > Export.

 

hope that made sense...

NateLikesTea
Advocate

Another similar sequence I run into is this:

 

Save scene, tumble camera (default perspective camera), then go to open a difference scene file, and again, "save changes to scene?" dialog.

 

No changes were made to the scene, other than the persp camera's position... which I guess technically is a change to the scene, but can changes to the default persp camera's translation/rotation be ignored by Maya as a "change" to the scene?

_wOLVERINe_
Enthusiast
Maya sees those cameras as part of the scene, so any changes to them will make the scene 'dirty'. Many 3d packages see the 'viewport cameras' as part of the UI. You can't actually animate them and you won't see them in an outliner equivalent. So any changes to them won't make the scene dirty. You have to actually create a new camera to do work. That's just not how Maya works.
NateLikesTea
Advocate

Certainly... and I'm just wondering if that could be changed, or tweaked...

leeman
Contributor
ajoss13's suggestion:

File "C:\Program Files\Autodesk\Maya2018\scripts\others\saveChanges.mel":
change:
"if (`file -q -mf`)"
to
"if (`file -q -mf` && size(`ls -geometry`))"

seems to work well with Maya 2019.

Glad to have a solution to this annoyance.
MrMeireles
Enthusiast

Thanks, ajoss13, for presenting a solution!

File "C:\Program Files\Autodesk\Maya2018\scripts\others\saveChanges.mel":

change

"if (`file -q -mf`)"

to

"if (`file -q -mf` && size(`ls -geometry`))"

 


BenediZ
Collaborator

Thanks, can you tell, what the script makes?

It's checking if there is any geometry and if not it let's quit without dialogue?

(but it's not checking for other nodes? would be important just to know...)

ajoss13
Participant

Querying if there are any geometry in scene at all.
You can also use any other flags with `ls` command, it's totally up to you:
http://help.autodesk.com/cloudhelp/2019/CHS/Maya-Tech-Docs/Commands/ls.html

PS: To be honest, I have a set of patches for native Maya MEL scripts, and this request is completely disabled in my Maya. You don't need to know if you have any changes or not in your scene, just press Ctrl-S when you need, and that's it. (and set incremental save option for 'File-Save'). This dialog is completely redundant for professional work imho.

Alexx31
Advocate

Top voted as one of two most annoying every-day-issues of Maya

- it looks like a simple script could be a solution, already provided by your users for you

- "under review"

- again 5 months time

- today checking Maya 2019 update1

No change.

What's going on in your heads, Autodesk? Among all your experienced tool developers not anyone who could spend 1 hour to end this? That's IMHO also a desaster from a "PR" point of view.

You don't need satisfaction surveys, if you yet don't listen to this here. At least someone could explain, what's going on.

kevin.picott
Alumni

One of our regular regression tests involves checking various situations to ensure that "empty scenes" don't trigger the "Do you want to save" prompt, so rest assured that this issue never leaves our radar. The problem with simplistic approaches such as this script is that while they work well for some users there are many others for whom they would not work well. One of our primary credos is "Though shalt not lose data" so if the answer to the empty scene question is ambiguous, we have to ask; a small annoyance is trumped by a data loss if you exit without saving critical information.

We do provide a method for clearing the file modification state which you can hook into any custom plug-in code that creates or modifies nodes (assuming you know that it's a non-destructive change of course). The command used to check for an unmodified file can also be used to set the file to be unmodified, regardless of its current state.

file -modified off; // MEL

maya.cmds.file( modified=False ) # Python
ajoss13
Participant

Is it possible, maybe to add an option to Maya preferences, some checkbox, like "Ask to save changes"?
Should be a pretty simple fix.

BenediZ
Collaborator

@ajoss13 

I think the sense of this is NOT to loose safety.

The sense is to get rid of stressful warnings with an really empty scene.

This happens right when you open Maya. You want to open your project and the software is so "unsmart" to prompt you, to decide, if you want to keep the empty scene, which is 5 seconds old and you never worked with.

Maya could at least know, when it created a scene itself without anybody having touched it.

(Seems indeed strange, that it's so hard to implement it, but I am no programmer to judge about that.).

kevin.picott
Alumni

(Apologies for the delay - I've been on vacation the past 2 weeks.) I dug a bit deeper into this and found that our internal regression test that looks for the empty scene save request only runs by itself on startup, so it is never checking for things created by plug-ins that load later, as @_wOLVERINe_ described.  For example the "mtoa" plug-in is known to create changes in the scene when loaded. Unfortunately Maya itself cannot tell the difference between a change that really is required when you save the scene and one which is not; it relies on the plug-in to adjust the change state when appropriate. There should still be a potential for ensuring the state is clean on startup, after file-new, and after file-open though, even if they load or unload plug-ins. Thanks for bringing this up as an issue!

riki.babington
Observer

I hate when Maya does this, especially coming from years of 3ds Max not doing it

matbrady1
Explorer

Every time you click this Blender improves a little more.jpg

trevor.adams
Alumni
Status changed to: Accepted
 
leeman
Contributor

Glad this topic is getting some TLC.

 

Though plugins may be doing their own things to 'change the environment' of the scene... perhaps a 'brute force' approach might help. IE, if scene has no geometry (or whatever the user might consider relevant), don't ask for confirmation. Perhaps an option for users to indicate what conditions need to be 'unmet' to avoid the dialog, similar to the way users can specify what is shown in a panel.

ajoss13's suggestion is certainly helpful, though it would need to be set up manually for each new Maya version. Also, some users, like myself aren't that familiar with MEL, so this approach might not be implemented as often as could be beneficial to users.




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

Submit Idea  

Autodesk Design & Make Report