Search Unity

  1. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  2. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Participate with students all over the world and build projects to teach people. Join now!
    Dismiss Notice
  5. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Undo history and saving

Discussion in 'Improved Prefabs' started by plindberg, Jun 20, 2018.

  1. plindberg

    plindberg

    Joined:
    Nov 25, 2016
    Posts:
    17
    First of all, first impressions with the prefab system: Awesome! Great job.

    After fiddling around a bit in the beta build i noticed that you cannot undo a change that was made to a prefab inside of edit mode if you have exited edit mode. I think it would be great if you could, and it will probably prevent many time-consuming mistakes from happening, especially considering the auto-save option.

    Also, since you don't see the prefab in it's 'natural environment', so to speak, it can be hard to know if the changes you've made are the changes you want to save. Perhaps add a way to 'preview' the changes by displaying the prefab in the scene from which you came (before you have to save).

    Thanks!
     
    Deeeds and cirocontinisio like this.
  2. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    7,320
    When you change a prefab, and have the auto update selected, the changes are seen in the scene. You can undo if it isn’t right.
     
    cirocontinisio likes this.
  3. plindberg

    plindberg

    Joined:
    Nov 25, 2016
    Posts:
    17
    Only in the prefab edit scene. You can't undo after exiting that.
     
    Deeeds likes this.
  4. plindberg

    plindberg

    Joined:
    Nov 25, 2016
    Posts:
    17
    Bumping this because I think it's a significant issue. It's seriously unintuitive that you can not undo the changes after you have exited prefab mode. I am certain this will cause time-consuming issues, especially when less technical minded people go in and experiment with a prefab, because it is not obvious that leaving prefab mode is an irreversible action. It used to be obvious before, when you had to press a very explicit "Apply" button, but it is not now.
     
    Ethan_VisualVocal and Deeeds like this.
  5. Schmunkee

    Schmunkee

    Unity Technologies

    Joined:
    Sep 4, 2013
    Posts:
    2
    Hey, thanks for bringing this up.

    Currently, there are issues with letting the undo stack be Prefab Mode-Scene agnostic. Mainly the fact that you could potentially undo things without noticing that you undo them. Say, you're in Prefab Mode and you accidentally undo some changes you made in a Scene before entering Prefab Mode.

    That said, we agree that the current undo implementation isn't ideal either.
     
    plindberg likes this.
  6. M_R

    M_R

    Joined:
    Apr 15, 2015
    Posts:
    284
    what about:
    - if you exit prefab mode and undo, it undoes whatever you did since entering prefab mode, as if it were a single action
    or:
    - entering/exiting prefab mode are undoable actions themselves (like changing selection), so: enter prefab mode -> undo -> you are in the scene: exit prefab mode -> undo -> return to prefab mode -> you can undo things done in it
     
    dadude123 likes this.
  7. Deeeds

    Deeeds

    Joined:
    Mar 15, 2018
    Posts:
    739
    This. 1000x this!

    There's an example in symbols within all good design software, too. That does either this, or steps back in this manner without reopening the symbol editing mode.

    @Schmunkee As to this fear:

    "Mainly the fact that you could potentially undo things without noticing that you undo them."

    The easiest (and possibly the best) way around this is to zoom the Scene view to the object that's having the current Undo operation applied to it. ie. coded use of the "F" key shortcut, on Undo activation, along with scrolling of the Hierarchy to the selected object upon which this occurring, and Shift+Command+Z for Redo, so the user can cycle between them, to see what's being redone and undone.

    When someone needs Undo, they need it. Really need it! Please make it work well.
     
    StunAustralia likes this.
  8. SteenLund

    SteenLund

    Unity Technologies

    Joined:
    Jan 20, 2011
    Posts:
    319
    @M_R

    It is exactly one of those two solutions we are considering, but leaning heavily against solution 1 where every thing you did in prefab mode is undone, without entering Prefab Mode.

    Entering Prefab Mode while undoing feels wrong in my opinion, and that is only my opinion, but it also has a few harder to solve issues like instance ids changing on every entry into Prefab Mode which makes the undo operations invalid, certainly solvable, but the first solution is simpler to implement.
     
  9. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    3,467
    I prefer undoing enter/exit prefab mode over undoing the things you did in prefab mode in one go, for several reasons:

    - You lose the ability to undo parts of your prefab edit. If the prefab edit took a while, then you have to redo all the work if you undo, even if you only needed to undo the very last operation. You essentially discard the entire undo stack of the prefab changing when you leave prefab mode, which is pretty destructive.

    - If the prefab edit was quite a few operations ago, and you want to undo a bunch of things in a row, you might hit undo several times, and miss that one of them undid a prefab modification.

    - It teaches people what undo does in the context of the new prefab workflow. Undoing everything in one go could be confusing, as you won't necessarily notice what happened.
     
  10. plindberg

    plindberg

    Joined:
    Nov 25, 2016
    Posts:
    17
    I agree with the previous poster, I think stepping back into/out of prefab mode is the most practical solution.
     
    dadude123 likes this.
  11. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    700
    There's undoing everything in one go seems really problematic.

    Undo/Redo always has fine granularity, so suddenly changing it to "undo everything in a huge batch" is definitely a deviation from how things are working right now.

    There are quite a few applications that have the same problem, and in all of the ones I know solve this by treading a mode/context change as undoable action.
    Unity already treats selection as an undoable event, which makes makes sense.
     
    StunAustralia likes this.
  12. StunAustralia

    StunAustralia

    Joined:
    Jul 1, 2018
    Posts:
    33
    Couple of examples for what it's worth...

    In Blender, to edit a mesh you have to go into 'edit mode'.. this is as atomic, so when you exit edit mode, one single undo undoes the entire edit. This is..... slightly inconvenient...
    • If you pressed undo you could, of course, press redo .... but if you didn't notice till later...

    • Once you exited edit mode you could either undo/redo the entire operation - if that was 2 hours work and you wanted to delete the last 3 things you did.... too bad
    As a workflow - very frustrating.

    The other option I've seen used was an animation program I can't remember the name of, but that had different components with their own undo stack. This mostly worked well, but as you could undo the changes of different objects in a different order than they were made... it made lining things up again flipping difficult!

    The only 'smooth' option I've seen is a global undo - all small changes recorded in order and reversable in the same order...

    I know it would be a big change but I fear if you go with 'atomic' it will become the kind of thing you get asked all the time... #1 question at Unite for years to come.

    And no, I don't imagine that to be a trivial task :(

    It is, however, one that could be introduced down-the-track as delaying prefabs-that-nest (TM) would lead to even more #1 questions at Unite!

    My preference:
    From a user perspective, it should look like editing a prefab is 'zooming in' ... so it doesn't matter what 'zoom level' changes are made at, they are still reversable in that order..

    However, for user clarity, perhaps the 'exit prefab mode' action could be 'undone'... so as you're undoing away, when you get to the 'exit prefab' action, that gets undone so you re-enter prefab mode where the next undo will happen... finish all undos available in the prefab mode 'session'? No problem, next action was entering prefab mode in the first place, so undo takes you back out ... actions made before entering prefab mode are undone in order...
     
    Last edited: Jul 20, 2018