Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Feedback UI/UX suggestion: sprite Inspector has buttons to open Sprite Editor and inspect texture

Discussion in '2D' started by Lo-renzo, Nov 9, 2020.

  1. Lo-renzo

    Lo-renzo

    Joined:
    Apr 8, 2018
    Posts:
    1,503
    This Inspector is useless 99.9% of the time. Whenever I encounter it, for example by clicking on the wrong thing when searching, it would save a bunch of clicks and frustration to be able to immediately redirect to where I meant to go.

    Untitled - Copy.png

    A. Open Sprite Editor and select / zoom in on the sprite, if Multiple mode spritesheet. Else, just open the Sprite Editor for the Single mode sprite. A button with this functionality already exists: just check the "Sprite Editor" button on a Tile.

    B. Open Inspector for Texture asset of the sprite. Especially in situations where I have a spritesheet with many sprites, this would be a godsend. Take this common situation: click on a sprite within the Inspector for a Tile. This will ping the sprite within the spritesheet. However, if it's a large spritesheet, then it could have hundreds of sprites. This means scrolling through the project to go to the texture so I can adjust its properties. This button would allow me to click on any sprite within a spritesheet and navigate immediately to the texture's Inspector in one click. No scrolling, no delay, less clicks.
     
    Xiangting_Su and Lars-Steenhoff like this.
  2. Xiangting_Su

    Xiangting_Su

    Unity Technologies

    Joined:
    Sep 22, 2020
    Posts:
    253
    Heya Lo-renzo! You know what? You made some good points there which I agree with you on so many counts.

    We've been staring at this inspector window and wondering how else could we have put that empty space to better use. This is something we really want to look into. And I like your suggestion of linking the Sprite Editor and Texture Importer Inspector from this inspector window for quicker access.

    Did you mean something like this?

    Sprite Inspector.png
     
    Last edited: Nov 9, 2020
    Baste and JoNax97 like this.
  3. Lo-renzo

    Lo-renzo

    Joined:
    Apr 8, 2018
    Posts:
    1,503
    Yes, that looks great.

    If those fields on the Sprite's Inspector were editable, I can't imagine myself actually using them. That's because adjusting the pivot or border is very much a visual process.

    However, if it were possible to adjust the pivot without necessarily opening up the whole Sprite Editor that might be useful. I often need to adjust pivots over and over to make sure things line up right. Having a way to adjust the pivot for a single sprite without diving into the full spritesheet would be nice. This feature would require showing an accurate preview of the sprite within a spritesheet with an adjustable pivot point. It would be good if it has a 1-click unlock so it's impossible to accidentally adjust.
     
    Last edited: Nov 9, 2020
  4. Xiangting_Su

    Xiangting_Su

    Unity Technologies

    Joined:
    Sep 22, 2020
    Posts:
    253
    Yeah, I guess you are right.
    This is interesting! Yeah, I like the idea of being able to adjust a Sprite's pivot without having to open up the Sprite Editor first.

    Would it make sense if the adjustment of pivots actually happens directly in the Scene View? And like you suggested it could have a safety lock. For example, we can enable a new "Custom Pivot" mode by holding down an additional hot-key say, D. (Such as the case of Maya.) Or the pivot of a Sprite is only editable when an icon that says Edit Pivot within the Sprite Inspector is clicked. And when it's unclicked, the Scene View goes back to how it looks now (without the pivots visible).

    I was also wondering if it would make sense too if we could adjust the pivot in the preview window? But then, it currently only shows the individual Sprites. I guess it would be more helpful if I could look at this Sprite in reference to the Sprite Sheet to better determine the position of my new pivot.
     
  5. Lo-renzo

    Lo-renzo

    Joined:
    Apr 8, 2018
    Posts:
    1,503
    I can see that being a helpful feature. Where things really need to line up for me is when using a grid / tilemaps, e.g. two wall sprites that need perfectly aligned pivots so that they are flush with one another.

    That's a sensible place for it. At least for my usage, I don't need / want to reference the whole spritesheet because ultimately I only know if I've done it right by looking at the sprites in the context of Scene. In the wall sprite example, walls -- which may be different heights, thus having different borders, thus needing different pivots -- can only be roughly eye-balled with reference to the spritesheet. Whether they're really correct I judge from the Scene.
     
    Xiangting_Su likes this.
  6. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,294
    I like the idea, but I don't like the hotkey as the main way to access it - that's not very discoverable. This could be a part of an EditorTool for Sprites that you can activate/deactivate.
     
    Xiangting_Su likes this.
  7. Xiangting_Su

    Xiangting_Su

    Unity Technologies

    Joined:
    Sep 22, 2020
    Posts:
    253
    Yeah! This sounds like a really interesting use case for adjusting pivots in the Scene View. Do you happen to have a screenshot, Lo-renzo? I just want to be sure I understood you correctly. :p
     
  8. Xiangting_Su

    Xiangting_Su

    Unity Technologies

    Joined:
    Sep 22, 2020
    Posts:
    253
    Yeah, after giving it more thought, I'll have to agree with you on this Baste. Having an actual physical button as part of an Editor Tool, Scene Overlays or even in the Inspectors to activate "Pivot Adjusting Mode" would be much more discoverable than an invisible hot-key which users may or may not remember.
     
  9. Lo-renzo

    Lo-renzo

    Joined:
    Apr 8, 2018
    Posts:
    1,503
    @xiangtingsu

    See attached. Funny colors b/c colored in shader.

    There's a short and tall version of every wall. They need to be flush with one another. Because they have different rect sizes, I can only approximate their pivots in the Sprite Editor. I judge from the Scene whether they're really lined up correctly. Likewise, differerent kinds of walls (brick, wood, marble etc etc) need to be flush with one another as well.

    Walls are a simple case of "things that need to be lined up correctly". Other sprites have the same requirement (carefully set pivots) but are more complex.
     

    Attached Files:

    JoNax97 and Xiangting_Su like this.
  10. Xiangting_Su

    Xiangting_Su

    Unity Technologies

    Joined:
    Sep 22, 2020
    Posts:
    253
    Thanks for these screenshots, @Lo-renzo! Yeah I see what you mean now. It does seem to make more sense pivoting in the Scene than referencing the entire Sprite Sheet.

    This pivoting UX does seem like a worthwhile case to dive in a little. Thanks for these helpful insights!
     
  11. Lo-renzo

    Lo-renzo

    Joined:
    Apr 8, 2018
    Posts:
    1,503
    @xiangtingsu I've found a workflow that makes it a bit better, perhaps worth mentioning. If I anchor the SpriteEditor window to the left of the scene, and the scene to the right, it is decent. This is because anchoring the SpriteEditor window removes the need to Tab all the time. At the time of writing my previous criticism, it didn't occur to me that anchoring the window would help.

    One of the things the SpriteEditor does that's annoying, regardless, is when you click Apply, you will lose your zoom level. This isn't a problem for small sprites or spritesheets, but for large spritesheets this is a critical annoyance because zooming in may be very important and losing that hinders careful, small adjustments. If the SpriteEditor could preserve its state between uses of 'Apply', that would help improve the pivot-adjustment workflow.
     
  12. Xiangting_Su

    Xiangting_Su

    Unity Technologies

    Joined:
    Sep 22, 2020
    Posts:
    253
    That's a good temporary workaround! Thanks for sharing with us!

    Yeah I can't imagine to have to zoom in to my exact level again everytime I hit apply. It doesn't sound very pleasant. It sounds like something we should look into. I've tried to replicate this on a 2048x2048 tileset in 2021.2 but the Sprite Editor kept the zoomed-in level even after I hit Apply. May I know which version did that happen to you?
     
  13. Lo-renzo

    Lo-renzo

    Joined:
    Apr 8, 2018
    Posts:
    1,503
    Testing on 2020.1 seems fine, so not that. I can't remember. I did, however, eliminate all large spritesheets for this reason, so it was a problem some time ago (either with clicking Apply... or perhaps it was re-exporting a PNG into Unity, not sure). But since there doesn't seem to be a problem for several major versions, consider it resolved.
     
    Xiangting_Su likes this.